-
Notifications
You must be signed in to change notification settings - Fork 381
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
Some RUSTFLAGS Force Cargo Use on the Host #903
Comments
The issue relates to Update: that's exactly the issue: $ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-Zself-profile" cargo metadata --format-version 1 --filter-platform aarch64-unknown-linux-gnu
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Zself-profile --target aarch64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
--- stderr
error: the option `Z` is only accepted on the nightly compiler We should also likely print stderr getting cargo metadata fails. |
There's a nice little todo for that here Line 145 in 00c1de2
|
I've added this code to replace the TODO, so we have good logging: both the if !output.status.success() {
shell::warn("unable to get metadata for package", msg_info)?;
shell::status(String::from_utf8(output.stderr.clone())?, msg_info)?;
return Ok(None);
} This produces output like the following: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-Zself-profile" /home/ahuszagh/git/cross/target/debug/cross +nightly build --target aarch64-unknown-linux-gnu -vv
+ cargo +nightly metadata --format-version 1 --filter-platform aarch64-unknown-linux-gnu
[cross] warning: unable to get metadata for package
error: could not find `Cargo.toml` in `/home/ahuszagh/Desktop/cross` or any parent directory
[cross] note: Falling back to `cargo` on the host.
+ cargo +nightly build --target aarch64-unknown-linux-gnu -vv
error: could not find `Cargo.toml` in `/home/ahuszagh/Desktop/cross` or any parent directory Unfortunately, this might duplicate the error output in some cases. Maybe we should suppress the logging, and just have the warning? |
what about surpressing it when in normal verbosity, but keep it in verbose mode. Also, should probably pretty format it with section (e.g use indented) to make it more distinct |
Checklist
Describe your issue
Attempting to run the following causes
cross
to assume that we do not need docker support, and therefore fallback to the host:I believe this affects every image. Not every rustflag however affects this: only unstable
-Z
flags are affected. For example, this works:$ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C panic=abort" \ cross +nightly build --target aarch64-unknown-linux-gnu -Z build-std -vv
Note that this does not occur when using
cross rustc
and passing the options: the following works as expected:What target(s) are you cross-compiling for?
aarch64-unknown-linux-gnu
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.2 and latest main
Example
No response
Additional information / notes
This affected cross prior to #869 being merged, so this is not related to that.
The text was updated successfully, but these errors were encountered: