Skip to content

Bump semver to 0.2, remove version_matches() #5

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

Merged
merged 1 commit into from
Mar 5, 2017

Conversation

kamalmarhubi
Copy link
Contributor

semver 0.2 was the first to include a fix to how VersionReq
comparisons work with pre-release identifiers. The fix results in, eg,

version_matches(">= 1.4.0")

not matching for a compiler version 1.8.0-nightly. For more details,
see dtolnay/semver#54.

This makes version_matches() far less useful, and so it is removed.
It's still possible to get the original intent by using the Ord impl
on semver::Version. To make this more convenient, semver::Version is
exported from this crate.

This is a breaking change.

semver 0.2 was the first to include a fix to how `VersionReq`
comparisons work with pre-release identifiers. The fix results in, eg,

    version_matches(">= 1.4.0")

not matching for a compiler version `1.8.0-nightly`. For more details,
see dtolnay/semver#54.

This makes `version_matches()` far less useful, and so it is removed.
It's still possible to get the original intent by using the `Ord` impl
on `semver::Version`. To make this more convenient, `semver::Version` is
exported from this crate.

This is a breaking change.
@bluss
Copy link

bluss commented Apr 9, 2016

This pulls in nom, what's the impact on compile time?

@kamalmarhubi
Copy link
Contributor Author

On my machine, wall time goes from 1.96s to 3.84s (median over 10 runs):

rustc-version-rs> git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
rustc-version-rs> for i in (seq 10); cargo clean; time -f '%e' cargo build >/dev/null; end 2>| r -de 'write(summary(X), stdout())'
Min.   :1.950  
1st Qu.:1.950  
Median :1.960  
Mean   :1.961  
3rd Qu.:1.960  
Max.   :2.010  
rustc-version-rs> git checkout bump-semver 
Switched to branch 'bump-semver'
Your branch is up-to-date with 'origin/bump-semver'.
rustc-version-rs> for i in (seq 10); cargo clean; time -f '%e' cargo build >/dev/null; end 2>| r -de 'write(summary(X), stdout())'
Min.   :3.830  
1st Qu.:3.840  
Median :3.840  
Mean   :3.854  
3rd Qu.:3.850  
Max.   :3.930

@bluss
Copy link

bluss commented Apr 9, 2016

That's pretty quick for nom, didn't expect that! Still, a build script should be as lean as possible in my wishlist.

@kamalmarhubi
Copy link
Contributor Author

Agreed. For background on this change, I want the bump to get at SemVerError so that a non-panicking variant can be implemented. (See 64ab21a)

@kamalmarhubi
Copy link
Contributor Author

Realistically, a build script is compiled once per development session since it should rarely change. I don't think it's too bad to increase that by a second or two.

@bluss
Copy link

bluss commented Oct 8, 2016

Newest semver unfortunately requires building this list. Most of them small, but it's still.. not ideal 😄

   Fresh utf8-ranges v0.1.3
   Fresh winapi v0.2.8
   Fresh lazy_static v0.2.1
   Fresh libc v0.2.16
   Fresh regex-syntax v0.3.5
   Fresh winapi-build v0.1.1
   Fresh memchr v0.1.11
   Fresh aho-corasick v0.5.3
   Fresh kernel32-sys v0.2.2
   Fresh thread-id v2.0.0
   Fresh thread_local v0.2.7
   Fresh regex v0.1.77
   Fresh semver-parser v0.6.1
   Fresh semver v0.5.0

@kamalmarhubi
Copy link
Contributor Author

Indeed! I filed steveklabnik/semver-parser#7 to see if a non-regex approach would be welcome.

@steveklabnik
Copy link

This should probably be going to v.5.0 now 😄

frewsxcv added a commit to frewsxcv/servo that referenced this pull request Nov 8, 2016
clippy uses semver==0.2.x

rustc-version uses semver==0.1.x

djc/rustc-version-rs#5
@Ms2ger
Copy link

Ms2ger commented Jan 16, 2017

@Kimundi what's the status here?

@steveklabnik
Copy link

Update: i've merged in a PR for semver-parser that removes the regex dependency; I'm going to cut new versions of both it and semver soon, which have no breaking interface changes, just the dependnecy changes.

@kamalmarhubi
Copy link
Contributor Author

@steveklabnik thanks for the ping!

@Kimundi
Copy link
Collaborator

Kimundi commented Mar 5, 2017

Hi, I'm sincerely sorry for taking so long to respond.

Thanks for the PR! I'll merge this and #4, then will update the semver dep to the current version

@Kimundi Kimundi merged commit bbff0c6 into djc:master Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants