gnzlbg / cargo-asm

cargo subcommand showing the assembly or llvm-ir generated for Rust code
https://github.com/gnzlbg/cargo-asm
Other
1.17k stars 36 forks source link

Replace (incorrect) static lib source path prefix by dynamic stripping #114

Closed therealprof closed 5 years ago

therealprof commented 5 years ago

The compiled-in library source path depends on the git commit hash and thus changes with every release. Stripping the compiled-in path up to the name of the shipped library and then prepending the known sysroot path works nicely on Unixish systems and might work on Windows as well (untested).

Closes #103

Signed-off-by: Daniel Egger daniel@eggers-club.de

gnzlbg commented 5 years ago

Thanks! I think the behavior of the rust-src component has changed quiet a bit since I wrote that. Do you think this closes #103 ? EDIT: yes, it does 😆

therealprof commented 5 years ago

The only OS I couldn't test is Windows but even there I figure the chances of working are higher than the previous one since I'm only using std::path functions.

therealprof commented 5 years ago

Oh, more importantly since the path calculation changes from being target dependent to host dependent it now also works for cross-compilation and no_std 😉.