Skip to content

Commit 9ad13c8

Browse files
committed
rustbuild: Fix a few locations with makefiles gone
* Add version info to channel.rs as main.mk is no longer available * Update `Makefile.in` used with bootstrap to not try to require `mk/util.mk` * Update the `dist` target to avoid the makefile pieces
1 parent ffd3070 commit 9ad13c8

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

src/bootstrap/channel.rs

+15-25
Original file line numberDiff line numberDiff line change
@@ -15,55 +15,45 @@
1515
//! `package_vers`, and otherwise indicating to the compiler what it should
1616
//! print out as part of its version information.
1717
18-
use std::fs::File;
19-
use std::io::prelude::*;
2018
use std::process::Command;
2119

2220
use build_helper::output;
2321

2422
use Build;
2523

26-
pub fn collect(build: &mut Build) {
27-
// Currently the canonical source for the release number (e.g. 1.10.0) and
28-
// the prerelease version (e.g. `.1`) is in `mk/main.mk`. We "parse" that
29-
// here to learn about those numbers.
30-
let mut main_mk = String::new();
31-
t!(t!(File::open(build.src.join("mk/main.mk"))).read_to_string(&mut main_mk));
32-
let mut release_num = "";
33-
let mut prerelease_version = "";
34-
for line in main_mk.lines() {
35-
if line.starts_with("CFG_RELEASE_NUM") {
36-
release_num = line.split('=').skip(1).next().unwrap().trim();
37-
}
38-
if line.starts_with("CFG_PRERELEASE_VERSION") {
39-
prerelease_version = line.split('=').skip(1).next().unwrap().trim();
40-
}
41-
}
24+
// The version number
25+
const CFG_RELEASE_NUM: &'static str = "1.17.0";
26+
27+
// An optional number to put after the label, e.g. '.2' -> '-beta.2'
28+
// Be sure to make this starts with a dot to conform to semver pre-release
29+
// versions (section 9)
30+
const CFG_PRERELEASE_VERSION: &'static str = ".1";
4231

43-
build.release_num = release_num.to_string();
44-
build.prerelease_version = release_num.to_string();
32+
pub fn collect(build: &mut Build) {
33+
build.release_num = CFG_RELEASE_NUM.to_string();
34+
build.prerelease_version = CFG_RELEASE_NUM.to_string();
4535

4636
// Depending on the channel, passed in `./configure --release-channel`,
4737
// determine various properties of the build.
4838
match &build.config.channel[..] {
4939
"stable" => {
50-
build.release = release_num.to_string();
40+
build.release = CFG_RELEASE_NUM.to_string();
5141
build.package_vers = build.release.clone();
5242
build.unstable_features = false;
5343
}
5444
"beta" => {
55-
build.release = format!("{}-beta{}", release_num,
56-
prerelease_version);
45+
build.release = format!("{}-beta{}", CFG_RELEASE_NUM,
46+
CFG_PRERELEASE_VERSION);
5747
build.package_vers = "beta".to_string();
5848
build.unstable_features = false;
5949
}
6050
"nightly" => {
61-
build.release = format!("{}-nightly", release_num);
51+
build.release = format!("{}-nightly", CFG_RELEASE_NUM);
6252
build.package_vers = "nightly".to_string();
6353
build.unstable_features = true;
6454
}
6555
_ => {
66-
build.release = format!("{}-dev", release_num);
56+
build.release = format!("{}-dev", CFG_RELEASE_NUM);
6757
build.package_vers = build.release.clone();
6858
build.unstable_features = true;
6959
}

src/bootstrap/dist.rs

-2
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,11 @@ pub fn rust_src(build: &Build) {
381381
"README.md",
382382
"RELEASES.md",
383383
"configure",
384-
"Makefile.in",
385384
"x.py",
386385
];
387386
let src_dirs = [
388387
"man",
389388
"src",
390-
"mk"
391389
];
392390

393391
let filter_fn = move |path: &Path| {

src/bootstrap/mk/Makefile.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
# except according to those terms.
1010

1111
include config.mk
12-
include $(CFG_SRC_DIR)mk/util.mk
1312

1413
ifdef VERBOSE
14+
Q :=
1515
BOOTSTRAP_ARGS := -v
1616
else
17+
Q := @
1718
BOOTSTRAP_ARGS :=
1819
endif
1920

0 commit comments

Comments
 (0)