-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target runner support #30
Comments
I'm assuming this applies to both Reading |
Could probably steal the matching logic from runtime_cfg. I'm thinking we shouldn't use the crate directly because it is focused on handling ASTs for macros. |
In cargo: The logic to get the runner can be found here. As we can see, the logic is to figure out if two cfgs "match" through the matches_key function. The cfg we are interested in is So I straced
(The This outputs something of the form:
First line is crate name, 5 lines below are the names of the various crate types, the line below is the sysroot, and everything afterwards is a cfg. Every such cfg line is parsed with Cfg::from_str, and assembled into our final Vec that we'll use for our final comparison. So I think this behavior should be fairly easy to replicate without too much trouble. None of this seems to use unstable flags, so it should all be stable to use? Might be a good idea to ask the cargo/rustc maintainers first though. EDIT: 🤔 something interesting: |
Cargo has a cute little-known feature that allows running binaries for other targets directly from the
cargo
commands. This works by having arunner
configured for a given target triplet in the cargo configuration. From the cargo reference:The usual use-case would be running the tests through
qemu
to make sure it works on different architecture (Running it under qemu-aarch64 to make sure it works on aarch64, etc...).When escargot spawns a process as part of a
CargoTest
, it should ideally recover therunner
and use it to run the test. This would require reading the.cargo/config
s to get the appropriaterunner
, and running the test as./runner ./test --testargs
(instead of./test --testargs
)The text was updated successfully, but these errors were encountered: