-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Relative path use in RUSTC_WRAPPER has broken #4865
Comments
Thanks for the report! I believe this was caused by #4788 where the cwd of rustc was locked down. That being said I think this is a bug in Cargo, we should probably, like with |
I see a similar issue if Compilation Error
Success$ export RUST_TARGET_PATH=`pwd`
$ xargo build --target x86_64-rxinu
Compiling volatile v0.1.0
Compiling x86 v0.9.0 (https://github.com/gz/rust-x86#1e2efb6b)
Compiling spin v0.4.6
Compiling bit_field v0.7.0
Compiling bitflags v1.0.1
Compiling bitflags v0.7.0
Compiling once v0.3.3
Compiling rlibc v1.0.0
Compiling lazy_static v0.2.11
Compiling linked_list_allocator v0.4.3
Compiling multiboot2 v0.3.2 (https://github.com/phil-opp/multiboot2-elf64#aeeb2824)
Compiling raw-cpuid v2.0.2
Compiling rxinu v0.1.0 (file:///home/rob/rxinu)
Finished dev [unoptimized + debuginfo] target(s) in 7.64 secs This error happens even if @alexcrichton Let me know if you would prefer a separate issue opened to track this. |
@robert-w-gries since rustc is the one interpreting |
@alexcrichton Judging from your comment in japaric/xargo#186 (comment):
I don't see why @japaric's example in japaric/xargo#186 (comment) shouldn't work: $ cargo new --lib foo
$ cd foo
$ echo '#![no_std]' > src/lib.rs
$ cargo add heapless
$ rustc -Z unstable-options --target x86_64-unknown-linux-gnu --print target-spec-json > foo.json
$ cargo build --target foo
Compiling untagged-option v0.1.1
error: Error loading target specification: Could not find specification for target "foo" Shouldn't |
@SergioBenitez oh I believe the issue there is that you're compiling crates from crates.io and Cargo is now switching the cwd even for those crates (as their own workspace root is themselves in Cargo's |
@alexcrichton Sorry, are you saying there's a bug in |
Ah yeah so to clarify I believe everything is working correctly in cargo/rustc and this is an intentional change on Cargo's behalf. (breaking in the technical/pedantic sense) |
Since the discussion is diverging from the original issue, let's move the discussion to #4905 |
As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it. I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect? The team would be especially grateful if such a comment included details such as:
Thank you for contributing! (The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.) If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
ranty mumble about having different types for relative and absolute paths... I touched the code relative to rustc wrapper recently, so I might be able to find a fix for this. |
@alexcrichton here's one issue with turning Here's one way to solve it maybe, turn it absolute if it contains > 1 path segment. So |
@dwijnand I think that'd definitely work! That or always using an absolute path would be fine by me |
So now this has some notes on how to solve it (and I think it's easy), but I currently don't have much bandwidth to finish this. |
…crichton Test cases proving RUSTC_WRAPPER can be a relative path Test cases for #4865
Hello,
I have a special usage (coverage data collection) of cargo, wherein I run:
This used to work, but now doesn't:
With a little experimentation, it appears that
RUSTC_WRAPPER
now needs to be an absolute path. Is that an expected change in behaviour or inadvertent?Relevant strace snippet from one of the failing subprocesses:
Version: cargo 0.25.0-nightly (e08f310 2017-12-24)
The text was updated successfully, but these errors were encountered: