mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
tools/test_target: Fix mingw64 usage
You can now use: ./tools/test_target --build-target=mingw64 set host && source .envrc to set up the local environment to build/test via wine64. BUG=b:241495641 TEST=see above Change-Id: I498d4fda4cb84c2b8326e91f10b42cf33d8c8c41 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3885375 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Dennis Kempin <denniskempin@google.com> Tested-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
parent
a91002bb46
commit
2d1a214d38
1 changed files with 8 additions and 4 deletions
|
@ -193,7 +193,7 @@ def guess_emulator(native_triple: Triple, build_triple: Triple) -> Optional[List
|
|||
return None
|
||||
# Use wine64 to run windows binaries on linux
|
||||
if build_triple.sys == "windows" and str(native_triple) == "x86_64-unknown-linux-gnu":
|
||||
return ["wine64"]
|
||||
return ["wine64-stable"]
|
||||
# Use qemu to run aarch64 on x86
|
||||
if build_triple.arch == "aarch64" and native_triple.arch == "x86_64":
|
||||
return ["qemu-aarch64-static"]
|
||||
|
@ -221,7 +221,11 @@ class TestTarget(object):
|
|||
|
||||
@classmethod
|
||||
def default(cls):
|
||||
return cls(os.environ.get("CROSVM_TEST_TARGET", "host"))
|
||||
build_target = os.environ.get("CARGO_BUILD_TARGET", None)
|
||||
return cls(
|
||||
os.environ.get("CROSVM_TEST_TARGET", "host"),
|
||||
Triple.from_str(build_target) if build_target else None,
|
||||
)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -324,7 +328,7 @@ def get_cargo_env(target: TestTarget):
|
|||
cargo_target = str(target.build_triple)
|
||||
upper_target = cargo_target.upper().replace("-", "_")
|
||||
env["CARGO_BUILD_TARGET"] = cargo_target
|
||||
if not target.is_host:
|
||||
if not target.is_host or target.emulator_cmd:
|
||||
script_path = CROSVM_ROOT / "tools/test_target"
|
||||
env[f"CARGO_TARGET_{upper_target}_RUNNER"] = f"{script_path} exec-file"
|
||||
env["CROSVM_TEST_TARGET"] = target.target_str
|
||||
|
@ -487,7 +491,7 @@ def main():
|
|||
if args.command == "set":
|
||||
if len(args.remainder) != 1:
|
||||
parser.error("Need to specify a target.")
|
||||
set_target(TestTarget(args.remainder[0], args.build_target))
|
||||
set_target(TestTarget(args.remainder[0], Triple.from_shorthand(args.build_target)))
|
||||
return
|
||||
|
||||
if args.target:
|
||||
|
|
Loading…
Reference in a new issue