-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Failure on subsequent builds when --emit asm
used without -C save-temps
.
#89149
Comments
Does the same thing happen with |
Just following up on this. The problem still exists with the nightly I'm currently using:
To replicate, extract the example project, comment out Line 22 in the crates/boards/cargo/config.toml as follows: Original:
Commented out:
Then run this command sequence:
Then observe the errors:
Running this command sequence, with the same
This indicates that there is an issue with cargo incremental builds right? What happens next? |
The problem still exists on a nightly from yesterday:
|
FWIW it's still broken in current nightly, I have a reproduction case with no external dependencies: a crate with this source pub fn main() -> u32 {
1
} And this command:
No, disabling incremental compilation seem to fix the problem.
As far as I can see there's no assembly files in the incremental cache. They should probably be saved if |
Save/restore more items in cache with incremental compilation Right now they don't play very well together, consider a simple example: ``` $ export RUSTFLAGS="--emit asm" $ cargo new --lib foo Created library `foo` package $ cargo build -q $ touch src/lib.rs $ cargo build error: could not copy "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.4qbzn9k8mosu50a5.rcgu.s" to "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.s": No such file or directory (os error 2) ``` Touch triggers the rebuild, incremental compilation detects no changes (yay) and everything explodes while trying to copy files were they should go. This pull request fixes it by copying and restoring more files in the incremental compilation cache Fixes rust-lang#89149 Fixes rust-lang#88829 Related: https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551
@pacak Great to see this fixed, thanks for the investigation and PR! |
Save/restore more items in cache with incremental compilation Right now they don't play very well together, consider a simple example: ``` $ export RUSTFLAGS="--emit asm" $ cargo new --lib foo Created library `foo` package $ cargo build -q $ touch src/lib.rs $ cargo build error: could not copy "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.4qbzn9k8mosu50a5.rcgu.s" to "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.s": No such file or directory (os error 2) ``` Touch triggers the rebuild, incremental compilation detects no changes (yay) and everything explodes while trying to copy files were they should go. This pull request fixes it by copying and restoring more files in the incremental compilation cache Fixes rust-lang/rust#89149 Fixes rust-lang/rust#88829 Related: https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551
Save/restore more items in cache with incremental compilation Right now they don't play very well together, consider a simple example: ``` $ export RUSTFLAGS="--emit asm" $ cargo new --lib foo Created library `foo` package $ cargo build -q $ touch src/lib.rs $ cargo build error: could not copy "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.4qbzn9k8mosu50a5.rcgu.s" to "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.s": No such file or directory (os error 2) ``` Touch triggers the rebuild, incremental compilation detects no changes (yay) and everything explodes while trying to copy files were they should go. This pull request fixes it by copying and restoring more files in the incremental compilation cache Fixes rust-lang/rust#89149 Fixes rust-lang/rust#88829 Related: https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: hintron/computer-enhance#35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit rust-lang#88829 / rust-lang#89149
I tried this code:
(see attached project)
buildfailure-1.zip
I expected to see this happen:
build the first time, build the second time.
Instead, this happened: explanation
On the first build, success.
On the second build
See log (attached)
log.txt
Upon investigation it appears that the rustflags (in the cargo configuration)
--emit asm
cause the subsequent build failure, but only when-C save-temps
is NOT used.i.e:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: