Closed petr-tik closed 6 years ago
Hi! Thanks for the report. So I cannot reproduce with rust nightly :/
Could you try:
RUSTFLAGS="--emit=asm" cargo build --release
and report the output?
hi and wow for the quick reply.
According to the readme cargo asm supports rust stable, so I have been building with most recent stable compiler in examples above
$$$$ rustc -V
rustc 1.27.1 (5f2b325f6 2018-07-07)
As you suggested
$$$$ RUSTFLAGS="--emit=asm" cargo build --release
Compiling order_book v0.1.0 (file:///home/petr_tik/Coding/order_book)
DICompileUnit not listed in llvm.dbg.cu
!46476 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !1856, producer: "clang LLVM (rustc version 1.27.1 (5f2b325f6 2018-07-07))", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)
LLVM ERROR: Broken module found, compilation aborted!
error: Could not compile `order_book`.
To learn more, run the command again with --verbose.
running same with verbose
$$$$ RUSTFLAGS="--emit=asm" cargo build --release --verbose
Fresh fnv v1.0.6
Compiling order_book v0.1.0 (file:///home/petr_tik/Coding/order_book)
Running `rustc --crate-name order_book src/main.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C debuginfo=2 -C metadata=12b7d539aa0f5d9d -C extra-filename=-12b7d539aa0f5d9d --out-dir /home/petr_tik/Coding/order_book/target/release/deps -L dependency=/home/petr_tik/Coding/order_book/target/release/deps --extern fnv=/home/petr_tik/Coding/order_book/target/release/deps/libfnv-5881d5b4694d1337.rlib --emit=asm`
DICompileUnit not listed in llvm.dbg.cu
!30643 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !1328, producer: "clang LLVM (rustc version 1.27.1 (5f2b325f6 2018-07-07))", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !1662, globals: !30644)
LLVM ERROR: Broken module found, compilation aborted!
error: Could not compile `order_book`.
Caused by:
process didn't exit successfully: `rustc --crate-name order_book src/main.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C debuginfo=2 -C metadata=12b7d539aa0f5d9d -C extra-filename=-12b7d539aa0f5d9d --out-dir /home/petr_tik/Coding/order_book/target/release/deps -L dependency=/home/petr_tik/Coding/order_book/target/release/deps --extern fnv=/home/petr_tik/Coding/order_book/target/release/deps/libfnv-5881d5b4694d1337.rlib --emit=asm` (exit code: 1)
So this is a bug in that Rust stable version that happens to trigger for your crate :/
The only thing I could do is report the bug, but the bug is already reported and fixed on nightly, so, this has been efficient! :D
The stable toolchain that you are using might work for other crates, but for this particular one my recommendation is for you to use the nightly one in combination with cargo asm
until Rust 1.28 is released (that release should hopefully contain the fix, otherwise you might have to wait until Rust 1.29...).
I will add a note about this to the readme.
thanks for the swift triage and fix suggestion - again you (and others) are one of the strongest reasons to use rust.
quick n00b question that I cannot seem to google the answer for.
How can I set toolchain=nightly in the Cargo.toml of my project?
I don't think you can (maybe .cargo/config? check that in the cargo book).
To switch toolchains I personally do that manually: rustup default nightly
changes to nightly, and rustup default stable
to stable. There are beginner channels on IRC and Discord with lot of people answering questions, so if you are getting started I recommend you to join #rust-beginners on IRC to get quick feedback.
off-top to the original issue, but I found a way (more googling is usually the answer) - you might find it useful too
Create a rust-toolchain file in the root dir with the description of required toolchain
thanks again - closing
Intro and thanks!
First of all, thanks for a great extension - you and the rest of the community is one of the reasons I enjoy using rust! I read about cargo asm on reddit and am looking forward to using and hopefully helping stabilise it.
Problem description
I installed cargo-asm tonight to look at the asm output for my open-source project
My project builds using vanilla rustc 1.27.1
but the build breaks when I run cargo asm
Stacktrace
Ideas/inference to related issues
seems related to #6 https://github.com/rust-lang/rust/issues/52039
Steps to reproduce
TODO
Please let me know what other information you need and/or how I can help