-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Handle RUSTC_WRAPPER properly #180
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
taiki-e
commented
Jun 2, 2022
Comment on lines
+52
to
+55
// The following priorities are not documented, but at as of cargo | ||
// 1.63.0-nightly (2022-05-31), `RUSTC*` are preferred over `CARGO_BUILD_RUSTC*`. | ||
// 1. RUSTC | ||
// 2. build.rustc (CARGO_BUILD_RUSTC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ tail -n +1 a.sh b.sh
==> a.sh <==
#!/bin/bash
echo "$(basename "$0") called with arguments: $*"
==> b.sh <==
#!/bin/bash
echo "$(basename "$0") called with arguments: $*"
$ RUSTC="$(pwd)/a.sh" CARGO_BUILD_RUSTC="$(pwd)/b.sh" cargo build
error: `rustc -vV` didn't have a line for `host:`, got:
a.sh called with arguments: -vV
$ RUSTC_WRAPPER="$(pwd)/a.sh" CARGO_BUILD_RUSTC_WRAPPER="$(pwd)/b.sh" cargo build
error: malformed output when learning about crate-type rlib information
command was: `/Users/taiki/projects/cargo-llvm-cov/a.sh rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`
--- stdout
a.sh called with arguments: rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg
$ RUSTC_WORKSPACE_WRAPPER="$(pwd)/a.sh" CARGO_BUILD_RUSTC_WORKSPACE_WRAPPER="$(pwd)/b.sh" cargo build
error: malformed output when learning about crate-type rlib information
command was: `/Users/taiki/projects/cargo-llvm-cov/a.sh rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`
--- stdout
a.sh called with arguments: rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg
$ RUSTC_WRAPPER="$(pwd)/a.sh" RUSTC_WORKSPACE_WRAPPER="$(pwd)/b.sh" cargo build
error: malformed output when learning about crate-type rlib information
command was: `/Users/taiki/projects/cargo-llvm-cov/a.sh /Users/taiki/projects/cargo-llvm-cov/b.sh rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`
--- stdout
a.sh called with arguments: /Users/taiki/projects/cargo-llvm-cov/b.sh rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg
$ CARGO_BUILD_RUSTC_WRAPPER="$(pwd)/a.sh" RUSTC_WORKSPACE_WRAPPER="$(pwd)/b.sh" cargo build
error: malformed output when learning about crate-type rlib information
command was: `/Users/taiki/projects/cargo-llvm-cov/a.sh /Users/taiki/projects/cargo-llvm-cov/b.sh rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`
--- stdout
a.sh called with arguments: /Users/taiki/projects/cargo-llvm-cov/b.sh rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg
RUSTC vs RUSTC_WRAPPER is more complex.
When rustc -vV fails:
$ tail -n +1 a.sh b.sh
==> a.sh <==
#!/bin/bash
echo "$(basename "$0") called with arguments: $*"
==> b.sh <==
#!/bin/bash
echo "$(basename "$0") called with arguments: $*"
$ RUSTC="$(pwd)/a.sh" RUSTC_WRAPPER="$(pwd)/b.sh" cargo build
error: `rustc -vV` didn't have a line for `host:`, got:
a.sh called with arguments: -vV
But when if sucsees:
$ tail -n +1 a.sh b.sh
==> a.sh <==
#!/bin/bash
echo "$(basename "$0") called with arguments: $*"
echo "rustc 1.63.0-nightly (12cd71f4d 2022-06-01)
binary: rustc
commit-hash: 12cd71f4d3ea6df9c2093781d55134cd9651d754
commit-date: 2022-06-01
host: x86_64-apple-darwin
release: 1.63.0-nightly
LLVM version: 14.0.4"
==> b.sh <==
#!/bin/bash
echo "$(basename "$0") called with arguments: $*"
echo "rustc 1.63.0-nightly (12cd71f4d 2022-06-01)
binary: rustc
commit-hash: 12cd71f4d3ea6df9c2093781d55134cd9651d754
commit-date: 2022-06-01
host: x86_64-apple-darwin
release: 1.63.0-nightly
LLVM version: 14.0.4"
$ RUSTC="$(pwd)/a.sh" RUSTC_WRAPPER="$(pwd)/b.sh" cargo build
error: output of --print=file-names has changed in the compiler, cannot parse
command was: `/Users/taiki/projects/cargo-llvm-cov/b.sh /Users/taiki/projects/cargo-llvm-cov/a.sh - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`
--- stdout
b.sh called with arguments: /Users/taiki/projects/cargo-llvm-cov/a.sh - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg
rustc 1.63.0-nightly (12cd71f4d 2022-06-01)
binary: rustc
commit-hash: 12cd71f4d3ea6df9c2093781d55134cd9651d754
commit-date: 2022-06-01
host: x86_64-apple-darwin
release: 1.63.0-nightly
LLVM version: 14.0.4
bors r+ |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.