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

crate version number #3567

Closed
jesse99 opened this issue Sep 24, 2012 · 7 comments
Closed

crate version number #3567

jesse99 opened this issue Sep 24, 2012 · 7 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@jesse99
Copy link
Contributor

jesse99 commented Sep 24, 2012

There should be a reasonably simple way to get at the version number and related meta-data from within a crate, e.g. to better support a --version command line argument.

@graydon
Copy link
Contributor

graydon commented May 2, 2013

nominating for feature complete

@brson
Copy link
Contributor

brson commented May 9, 2013

cc #6322 which talks about making crate map available at runtime

@graydon
Copy link
Contributor

graydon commented May 9, 2013

just a bug, removing milestone/nomination.

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

Visiting for triage. Looks like we currently do this:

$ ./x86_64-unknown-linux-gnu/stage1/bin/rustc --ls ./x86_64-unknown-linux-gnu/stage0/lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so 
=Crate Attributes (d3cb8c2ccd84a7a7)=
#[link(name = "rustc",
       vers = "0.8-pre",
       uuid = "0ce89b41-2f92-459e-bbc1-8f5fe32f16cf",
       url = "https://github.com/mozilla/rust/tree/master/src/rustc")]
#[comment = "The Rust compiler"]
#[license = "MIT/ASL2"]
#[crate_type = "lib"]


=External Dependencies=
1 std-6c65cf4b443341b1-0.8-pre
2 extra-a7c050cfd46b2c9a-0.8-pre
3 syntax-64629f7f0c6a9bc-0.8-pre

Is this sufficient?

@huonw
Copy link
Member

huonw commented Jan 12, 2014

We no longer have #[link] (replaced by #[crate_id]), and we support --crate-id to retrieve this from source, but not from the compiled crates. Having it support both would be neat.

@steveklabnik
Copy link
Member

I think cargo effectively fixes this issue.

@alexcrichton
Copy link
Member

Yes, #[crate_name] means that rustc no longer understands anything about versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

6 participants