Closed
Bug 1163214
Opened 10 years ago
Closed 10 years ago
Add a minimum version check for rustc
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox40 affected, firefox41 fixed)
RESOLVED
FIXED
mozilla41
People
(Reporter: rillian, Assigned: rillian)
References
Details
Attachments
(2 files)
(deleted),
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
In addition to checking for the rust compiler's existence, we should check its version against some minimum in case people have old, pre-1.0 installs in their path.
from https://bugzilla.mozilla.org/show_bug.cgi?id=1161339#c22
Comment 1•10 years ago
|
||
`rustc --version --verbose` gives each bit of information on a separate line, and so may be easier to parse. Example output on my system:
$ rustc --version
rustc 1.1.0-nightly (7bd71637c 2015-05-06) (built 2015-05-06)
$ rustc --version --verbose
rustc 1.1.0-nightly (7bd71637c 2015-05-06) (built 2015-05-06)
binary: rustc
commit-hash: 7bd71637ca40910dbd310813a19abf76db84f8f6
commit-date: 2015-05-06
build-date: 2015-05-06
host: x86_64-unknown-linux-gnu
release: 1.1.0-nightly
Assignee | ||
Comment 2•10 years ago
|
||
Thanks. Looks like the first line is still the same, but parsing the release line might be safer than parsing the single line?
Comment 3•10 years ago
|
||
Right, the first line is the same. I don’t know what language these checks are written in, but if it’s something like bash this should work: `rustc -Vv|grep release:|cut -d' ' -f2`
Assignee | ||
Comment 4•10 years ago
|
||
Incidental fixup
Assignee | ||
Comment 5•10 years ago
|
||
(In reply to Simon Sapin (:SimonSapin) from comment #3)
> Right, the first line is the same. I don’t know what language these checks
> are written in, but if it’s something like bash this should work: `rustc
> -Vv|grep release:|cut -d' ' -f2`
Yep, that works. I don't see how it's more reliable than `rustc -V|cut -d' ' -f2` though?
The real difficulty is parsing and comparing semvers in bash. :/
Assignee | ||
Comment 6•10 years ago
|
||
How's this? We can add an additional clause to reject 1.0.0 pre-releases next week after the first stable release is published.
Attachment #8604737 -
Flags: review?(ted)
Assignee | ||
Updated•10 years ago
|
Attachment #8604340 -
Flags: review?(ted)
Comment 7•10 years ago
|
||
Comment on attachment 8604737 [details] [diff] [review]
Add rustc minimum version check
Review of attachment 8604737 [details] [diff] [review]:
-----------------------------------------------------------------
::: configure.in
@@ +438,5 @@
> + _RUSTC_MINOR_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 2`
> + _RUSTC_EXTRA_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 3 | cut -d + -f 1`
> + _RUSTC_PATCH_VERSION=`echo ${_RUSTC_EXTRA_VERSION} | cut -d '-' -f 1`
> + _RUSTC_PRERELEASE_VERSION=`echo $_{RUSTC_EXTRA_VERSION} | cut -d '-' -f 2`
> + _RUSTC_BUILD_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 3 | cut -d + -f 2`
I would say leave the extra/patch/prerelease/build bits out until we need them.
Attachment #8604737 -
Flags: review?(ted) → review+
Comment 8•10 years ago
|
||
Comment on attachment 8604340 [details] [diff] [review]
Align --enable-rust help text
Review of attachment 8604340 [details] [diff] [review]:
-----------------------------------------------------------------
rs=me to fix formatting stuff like this without explicit review in the future.
Attachment #8604340 -
Flags: review?(ted) → review+
Comment 9•10 years ago
|
||
Oh, sorry, I missed your comment there. If you want to add the "reject prereleases" stuff, then keep that in.
Comment 10•10 years ago
|
||
Assignee | ||
Comment 11•10 years ago
|
||
Thanks for the review. I removed the SUFFIX and BUILD variables for now. Post-1.0 rustc is using a train model, which will hopefully keep things regular enough we won't need more than the version number.
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/399e3553eb7f
https://hg.mozilla.org/mozilla-central/rev/611907765657
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•