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

Find the library hash used by a toolchain #302

Open
brson opened this Issue Apr 12, 2016 · 1 comment

Comments

3 participants
@brson
Copy link
Contributor

brson commented Apr 12, 2016

For custom linking purposes, sometimes people need to know the hash used in std's filename. It was suggested that show hash could be used for this.

It's a real use case, but I'm not sure yet that it's rustup's job, or if it is that it shouldn't be folded into some other version-displaying function.

@m4b

This comment has been minimized.

Copy link

m4b commented Apr 13, 2016

For reference, I'm working on a Makefile for hopefully doing the linking in a more extensible manner, and I currently grab the hash with a huge hack, e.g.:

PREFIX=$(HOME)/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu
LIB=$(PREFIX)/lib
RUSTLIB=$(LIB)/rustlib/x86_64-unknown-linux-musl/lib
HASH=$(shell ls $(RUSTLIB) | grep libstd | grep -oe "-[[:alnum:]]*" | grep -oe "[[:alnum:]]*")

(also, and if anyone else looks at the Makefile, what I'm doing should not be understood at all as a typical Rust build process)

There's so many places the above can break tho, e.g., if multirust is installed somewhere different, if the rustlib nightly dir changes (although you mentioned should be stablized soon), etc.

I agree not sure if it's rustup's job, or what all that would look like, but yea, hopefully a good solution arises somewhere :)

@Diggsey Diggsey added this to Features (inclination: accept) in Issue Categorisation May 4, 2017

@Diggsey Diggsey added the enhancement label May 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.