-
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
rustpkg: CrateId cleanup #11478
rustpkg: CrateId cleanup #11478
Conversation
Looks good. Could we switch fully to semver, though, rather than using string version names? So it'd be |
(Needs a rebase too.) |
We shouldn't switch only to SemVer because the version might be a branch or revid. Or at least that was the intent. |
pub fn system_library(sysroot: &Path, crate_id: &str) -> Option<Path> { | ||
let (lib_name, version) = split_crate_id(crate_id); | ||
library_in(lib_name, &version, &sysroot.join(relative_target_lib_path(host_triple()))) | ||
// rustc doesn't use target-specific subdirectories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should be removed, see https://github.com/mozilla/rust/pull/11338/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, forgot to remove it when I rebased it. I'll push corrected commit soon.
Test currently fails because rustpkg tries to find |
Rebased; it now passes all tests. |
@klutzy needs another rebase. |
rustpkg accessed git repo to read tags and guess package version, but it's not quite useful: version can be given explicitly by user, and implicit guess may cause confusions.
Currently rustpkg doesn't use SemanticVersion or Tagged, so they are removed. Remaining variants are replaced by `Option<~str>`.
Previously rustpkg tried to parse filenames to find crate. Now ue use deterministic hashes, so it becomes possible to directly construct filename and check if the file exists.
There is no significant difference between `rustpkg::crate_id::CrateId` and `syntax::crateid::CrateId`. rustpkg's one is replaced by syntax's one.
Rebased! |
This patchset consists of three parts: - rustpkg doesn't guess crate version if it is not given by user. - `rustpkg::version::Version` is replaced by `Option<~str>`. It removes some semantic versioning portions which is not currently used. (cc #8405 and #11396) `rustpkg::crate_id::CrateId` is also replaced by `syntax::crateid::CrateId`. - rustpkg now computes hash to find crate, instead of manual filename parse. cc @metajack
This patchset consists of three parts: - rustpkg doesn't guess crate version if it is not given by user. - `rustpkg::version::Version` is replaced by `Option<~str>`. It removes some semantic versioning portions which is not currently used. (cc #8405 and #11396) `rustpkg::crate_id::CrateId` is also replaced by `syntax::crateid::CrateId`. - rustpkg now computes hash to find crate, instead of manual filename parse. cc @metajack
This patchset consists of three parts:
rustpkg::version::Version
is replaced byOption<~str>
.It removes some semantic versioning portions which is not currently used.
(cc rustpkg should support semantic versions #8405 and Semantically version the language specification, compiler, and libraries #11396)
rustpkg::crate_id::CrateId
is also replaced bysyntax::crateid::CrateId
.cc @metajack