Skip to content
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

cargo-asm hangs in projects with at least one dependency #77

Open
MarceColl opened this issue Dec 19, 2018 · 5 comments
Open

cargo-asm hangs in projects with at least one dependency #77

MarceColl opened this issue Dec 19, 2018 · 5 comments

Comments

@MarceColl
Copy link

Hi!

I was just testing your tool and I am having some problems with all projects that have dependencies.
On several projects cargo-asm just hangs and nothing happens.

I tried running it with --debug-mode and the output is the following in every single project:

[DEBUG][cargo_asm][/home/<USER>/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-asm-0.1.16/src/main.rs:75]: Options: RwLock { data: Asm(AsmOptions { path: None, TRIPLE: None, no_color: false, asm_style: Intel, build_type: Release, features: [], rust: true, comments: false, directives: false, json: false, debug_mode: true, manifest_path: None, debug_info: false, lib: false, no_default_features: false }) }
[DEBUG][cargo_asm::build][/home/mcoll/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-asm-0.1.16/src/build.rs:29]: Building project...
[DEBUG][cargo_asm::build][/home/mcoll/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-asm-0.1.16/src/build.rs:37]: RUSTFLAGS=
[DEBUG][cargo_asm::build][/home/mcoll/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-asm-0.1.16/src/build.rs:106]: starting cargo build... "cargo" "build" "--color=always" "--release" "--verbose"

It seems that happens as soon as I add a dependency to a new project.

Steps to reproduce:

  1. Create a new project with cargo new --bin test_asm
  2. Run cargo-asm --debug-mode, it runs fine
  3. Add a dependency (e.g. rand = "0.6.1" to Cargo.toml)
  4. Run cargo-asm --debug-mode, it hangs

Alternatively I've created a repo with the minimum example that hangs for me (essentially the result of doing the above): https://github.com/MarceColl/debug_cargo_asm

Environment

Rust toolchain:
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.32.0-nightly (14997d56a 2018-12-05)
cargo-asm 0.1.16

OS
Linux 4.17.19-1-MANJARO #1 SMP PREEMPT Fri Aug 24 17:46:14 UTC 2018 x86_64 GNU/Linux
Up-to-date as of the above date

If you need any more information I'll be happy to provide it.

@MarceColl MarceColl changed the title cargo-asm hangs cargo-asm hangs in projects with at least one dependency Dec 19, 2018
@MarceColl
Copy link
Author

MarceColl commented Dec 19, 2018

Update: It looks that it's just that cargo is building at that point but there is no output from it, so when I add the dependency it stays in that line until it has recompiled everything. This is a bit of a slow machine so it was taking a long time building the rand crate and its dependencies.

@gnzlbg
Copy link
Owner

gnzlbg commented Dec 19, 2018

It looks that it's just that cargo is building at that point but there is no output from it, so when I add the dependency it stays in that line until it has recompiled everything.

Yes, so cargo asm needs to dump the assembly for all your dependencies while building, that can take a while the first time it builds everything.

I don't know what to do about this. AFAIK there is nothing we can do to speed things up here, beyond making rustc faster.

@MarceColl
Copy link
Author

Hmmm... I don't think there is that much to do. It was just confusing to me.
Maybe just adding a "This may take a while if it's the first time you run it" when running cargo asm? Honestly not sure if other people were confused the first time, maybe it was just me.

@gnzlbg
Copy link
Owner

gnzlbg commented Dec 21, 2018

I was confused too, as in, I sometimes do not know if the project is still building, or if something went wrong. Maybe I could spin up a thread that writes:

...project has been building for 30 seconds...
...project has been building for 60 seconds...

similarly to how cargo test does it if a test runs for too long.

@MarceColl
Copy link
Author

Yeah, that seems like a good and fairly easy way to reduce confusion with long builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants