cargo-asm icon indicating copy to clipboard operation
cargo-asm copied to clipboard

`--target` not working properly — could not find any output files

Open masklinn opened this issue 3 years ago • 2 comments

According to e.g. #142, it seems like cargo asm --target=$TARGET should work, but when I try it cargo asm replies:

[ERROR]: cargo asm could not find any output files!%                                                                                                                                                                                                 

All I've done was rustup target add $TARGET, on compilation the artefacts end up into target/$TARGET/release but otherwise seem fine (the binary runs). The Cargo.toml was not updated with any sort of toolchain or target information (not sure it's relevant).

Also if the builddir is not clean, rather than fail cargo asm dumps the contents from the default target.

> rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
> cargo --version
cargo 1.58.0 (7f08ace4f 2021-11-24)
> rustup toolchain list
stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin
> rustup target list | rg installed
aarch64-apple-darwin (installed)
x86_64-apple-darwin (installed)

I was trying to look at the x86_64 output from an aarch64 machine.

masklinn avatar Jan 18 '22 18:01 masklinn

Can reproduce, I uses .cargo/config.toml target.

luojia65 avatar Jul 06 '22 08:07 luojia65

https://crates.io/crates/cargo-show-asm should support crosscompilation as expected.

pacak avatar Jan 13 '23 00:01 pacak