-
Notifications
You must be signed in to change notification settings - Fork 13k
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
RFC: remove linkage attributes #8523
Comments
where does rustc get the name and version? how will this impact non-rustpkg crates? |
I'm ok keeping support for the name and vers attributes in the compiler for non-rustpkg crates. Rustpkg should warn on them though, as they override (possibly break) those provided by it, and we should remove all uses as we convert to rustpkg. Uuid and url should go entirely, though I don't think we even use them for anything presently. |
@catamorphism I'm going to need some guidance on emberian/rustdoc_ng#15 if this goes through. |
I think that's fine, although I think version is the exception here. Maybe only warn if it's inferrable and set? |
We decided to allow name and version in both non-rustpkg and rustpkg crates, but rustpkg will check that the name is the same as the inferred name, and the version is the same as the inferred version, and error out if either is inconsistent. We will eliminate any code that recognizes "uuid" and "url" specially, but we will still allow arbitrary additional attributes (these get used to compute the hash from the link attributes). |
So if you leave those two off in a library, will And you can just add additional attributes to allow distinguishing versions of the library beyond the default fields? |
@Kimundi The first is a good question. I'm inclined not to change the current behavior, so then the answer would be yes. And yes, you'll still be able to add additional attributes to allow distinguishing versions of the library. |
@metajack points out that our proposed solution has a problem: if you compile the same package with both rustc and rustpkg, you have to remove the |
As an interim step, rustpkg should at least always inject a package ID; currently, it doesn't do that if you supply your own name and vers, causing confusion. |
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes rust-lang#10188, rust-lang#8523.
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes rust-lang#10188, rust-lang#8523.
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
#[link(name="foo", version="3.1415927", uuid=xxxxxxxx)]
is an artifact of the pre-rustpkg days. rustpkg infers the link name from the package ID, and the version from version control if it's available. @graydon and I suggest that we warn if linkage attributes are present, and eventually start ignoring them as well as warning.The text was updated successfully, but these errors were encountered: