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

Consider mixing __CARGO_DEFAULT_LIB_METADATA into the hash. #34

Closed
ehuss opened this issue Sep 6, 2019 · 1 comment
Closed

Consider mixing __CARGO_DEFAULT_LIB_METADATA into the hash. #34

ehuss opened this issue Sep 6, 2019 · 1 comment
Labels
implementation Implementation exploration and tracking issues

Comments

@ehuss
Copy link
Contributor

ehuss commented Sep 6, 2019

The metadata hash currently includes the __CARGO_DEFAULT_LIB_METADATA environment variable which is used for embedding the release channel in the hash. This is used by rustbuild, but the current cargo implementation does not use it. Need to consider if this is necessary.

@ehuss ehuss added the implementation Implementation exploration and tracking issues label Sep 6, 2019
@alexcrichton
Copy link
Member

I think that we can safely ignore this. The rationale for adding this in the compiler itself was due to various sorts of build failures that cropped up in the real world and this fixed them, so if we don't have any build failures I think it's fine.

I ran a test locally to verify this. Today libstd links to libc 0.2.61, so I ran cargo new --lib, added:

[dependencies]
libc = "=0.2.61"

and then updated code to be

pub fn foo() -> usize {
    libc::open as usize
}

A cargo +nightly build -Z build-std --target x86_64-unknown-linux-gnu build then worked for me. Sure enough there's two liblibc-*.rlib in the output directory.

I think we can safely ignore this until it's actually a problem, and I predict that enough has changed in the meantime that this isn't needed anyway from within Cargo. As a result I'm gonna go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation Implementation exploration and tracking issues
Projects
None yet
Development

No branches or pull requests

2 participants