Skip to content

Commit afa1240

Browse files
committed
Auto merge of #41544 - alexcrichton:bump-bootstrap, r=brson
Update stage0 bootstrap compiler We've got a freshly minted beta compiler, let's update to use that on nightly! This has a few other changes associated with it as well * A bump to the rustc version number (to 1.19.0) * Movement of the `cargo` and `rls` submodules to their "proper" location in `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude` option this can work. * Updates of the `cargo` and `rls` submodules to their master branches. * Tweak to the `src/stage0.txt` format to be more amenable for Cargo version numbers. On the beta channel Cargo will bootstrap from a different version than rustc (e.g. the version numbers are different), so we need different configuration for this. * Addition of `dev` as a readable key in the `src/stage0.txt` format. If present then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead of `static.rust-lang.org`. This is added to accomodate our updated release process with Travis and AppVeyor.
2 parents b4d3ed6 + 5daf557 commit afa1240

File tree

25 files changed

+100
-152
lines changed

25 files changed

+100
-152
lines changed

.gitmodules

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
path = src/doc/nomicon
2323
url = https://github.com/rust-lang-nursery/nomicon.git
2424
[submodule "src/tools/cargo"]
25-
path = cargo
26-
url = https://github.com/rust-lang/cargo.git
25+
path = src/tools/cargo
26+
url = https://github.com/rust-lang/cargo
2727
[submodule "reference"]
2828
path = src/doc/reference
2929
url = https://github.com/rust-lang-nursery/reference.git
3030
[submodule "book"]
3131
path = src/doc/book
3232
url = https://github.com/rust-lang/book.git
33-
[submodule "rls"]
34-
path = rls
35-
url = https://github.com/rust-lang-nursery/rls.git
36-
33+
[submodule "src/tools/rls"]
34+
path = src/tools/rls
35+
url = https://github.com/rust-lang-nursery/rls

cargo

-1
This file was deleted.

rls

-1
This file was deleted.

src/Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ members = [
1515
"tools/remote-test-server",
1616
]
1717

18+
# These projects have their own Cargo.lock
19+
exclude = [
20+
"tools/cargo",
21+
"tools/rls",
22+
]
23+
1824
# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
1925
# MSVC when running the compile-fail test suite when a should-fail test panics.
2026
# But hey if this is removed and it gets past the bots, sounds good to me.

src/bootstrap/bootstrap.py

+27-17
Original file line numberDiff line numberDiff line change
@@ -159,40 +159,41 @@ def format_build_time(duration):
159159
class RustBuild(object):
160160
def download_stage0(self):
161161
cache_dst = os.path.join(self.build_dir, "cache")
162-
rustc_cache = os.path.join(cache_dst, self.stage0_rustc_date())
162+
rustc_cache = os.path.join(cache_dst, self.stage0_date())
163163
if not os.path.exists(rustc_cache):
164164
os.makedirs(rustc_cache)
165165

166-
channel = self.stage0_rustc_channel()
166+
rustc_channel = self.stage0_rustc_channel()
167+
cargo_channel = self.stage0_cargo_channel()
167168

168169
if self.rustc().startswith(self.bin_root()) and \
169170
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
170171
self.print_what_it_means_to_bootstrap()
171172
if os.path.exists(self.bin_root()):
172173
shutil.rmtree(self.bin_root())
173-
filename = "rust-std-{}-{}.tar.gz".format(channel, self.build)
174-
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
174+
filename = "rust-std-{}-{}.tar.gz".format(rustc_channel, self.build)
175+
url = self._download_url + "/dist/" + self.stage0_date()
175176
tarball = os.path.join(rustc_cache, filename)
176177
if not os.path.exists(tarball):
177178
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
178179
unpack(tarball, self.bin_root(),
179180
match="rust-std-" + self.build,
180181
verbose=self.verbose)
181182

182-
filename = "rustc-{}-{}.tar.gz".format(channel, self.build)
183-
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
183+
filename = "rustc-{}-{}.tar.gz".format(rustc_channel, self.build)
184+
url = self._download_url + "/dist/" + self.stage0_date()
184185
tarball = os.path.join(rustc_cache, filename)
185186
if not os.path.exists(tarball):
186187
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
187188
unpack(tarball, self.bin_root(), match="rustc", verbose=self.verbose)
188189
self.fix_executable(self.bin_root() + "/bin/rustc")
189190
self.fix_executable(self.bin_root() + "/bin/rustdoc")
190191
with open(self.rustc_stamp(), 'w') as f:
191-
f.write(self.stage0_rustc_date())
192+
f.write(self.stage0_date())
192193

193194
if "pc-windows-gnu" in self.build:
194-
filename = "rust-mingw-{}-{}.tar.gz".format(channel, self.build)
195-
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
195+
filename = "rust-mingw-{}-{}.tar.gz".format(rustc_channel, self.build)
196+
url = self._download_url + "/dist/" + self.stage0_date()
196197
tarball = os.path.join(rustc_cache, filename)
197198
if not os.path.exists(tarball):
198199
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
@@ -201,15 +202,15 @@ def download_stage0(self):
201202
if self.cargo().startswith(self.bin_root()) and \
202203
(not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
203204
self.print_what_it_means_to_bootstrap()
204-
filename = "cargo-{}-{}.tar.gz".format(channel, self.build)
205-
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
205+
filename = "cargo-{}-{}.tar.gz".format(cargo_channel, self.build)
206+
url = self._download_url + "/dist/" + self.stage0_date()
206207
tarball = os.path.join(rustc_cache, filename)
207208
if not os.path.exists(tarball):
208209
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
209210
unpack(tarball, self.bin_root(), match="cargo", verbose=self.verbose)
210211
self.fix_executable(self.bin_root() + "/bin/cargo")
211212
with open(self.cargo_stamp(), 'w') as f:
212-
f.write(self.stage0_rustc_date())
213+
f.write(self.stage0_date())
213214

214215
def fix_executable(self, fname):
215216
# If we're on NixOS we need to change the path to the dynamic loader
@@ -264,12 +265,15 @@ def fix_executable(self, fname):
264265
print("warning: failed to call patchelf: %s" % e)
265266
return
266267

267-
def stage0_rustc_date(self):
268-
return self._rustc_date
268+
def stage0_date(self):
269+
return self._date
269270

270271
def stage0_rustc_channel(self):
271272
return self._rustc_channel
272273

274+
def stage0_cargo_channel(self):
275+
return self._cargo_channel
276+
273277
def rustc_stamp(self):
274278
return os.path.join(self.bin_root(), '.rustc-stamp')
275279

@@ -280,13 +284,13 @@ def rustc_out_of_date(self):
280284
if not os.path.exists(self.rustc_stamp()) or self.clean:
281285
return True
282286
with open(self.rustc_stamp(), 'r') as f:
283-
return self.stage0_rustc_date() != f.read()
287+
return self.stage0_date() != f.read()
284288

285289
def cargo_out_of_date(self):
286290
if not os.path.exists(self.cargo_stamp()) or self.clean:
287291
return True
288292
with open(self.cargo_stamp(), 'r') as f:
289-
return self.stage0_rustc_date() != f.read()
293+
return self.stage0_date() != f.read()
290294

291295
def bin_root(self):
292296
return os.path.join(self.build_dir, self.build, "stage0")
@@ -585,7 +589,13 @@ def bootstrap():
585589
shutil.rmtree('.cargo')
586590

587591
data = stage0_data(rb.rust_root)
588-
rb._rustc_channel, rb._rustc_date = data['rustc'].split('-', 1)
592+
rb._date = data['date']
593+
rb._rustc_channel = data['rustc']
594+
rb._cargo_channel = data['cargo']
595+
if 'dev' in data:
596+
rb._download_url = 'https://dev-static.rust-lang.org'
597+
else:
598+
rb._download_url = 'https://static.rust-lang.org'
589599

590600
# Fetch/build the bootstrap
591601
rb.build = rb.build_triple()

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use build_helper::output;
2323
use Build;
2424

2525
// The version number
26-
pub const CFG_RELEASE_NUM: &'static str = "1.18.0";
26+
pub const CFG_RELEASE_NUM: &'static str = "1.19.0";
2727

2828
// An optional number to put after the label, e.g. '.2' -> '-beta.2'
2929
// Be sure to make this starts with a dot to conform to semver pre-release

src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub fn cargo(build: &Build, stage: u32, host: &str) {
106106
let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
107107

108108
let mut cargo = build.cargo(compiler, Mode::Tool, host, "test");
109-
cargo.arg("--manifest-path").arg(build.src.join("cargo/Cargo.toml"));
109+
cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
110110

111111
// Don't build tests dynamically, just a pain to work with
112112
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");

src/bootstrap/compile.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,7 @@ pub fn tool(build: &Build, stage: u32, target: &str, tool: &str) {
461461
let compiler = Compiler::new(stage, &build.config.build);
462462

463463
let mut cargo = build.cargo(&compiler, Mode::Tool, target, "build");
464-
let mut dir = build.src.join(tool);
465-
if !dir.exists() {
466-
dir = build.src.join("src/tools").join(tool);
467-
}
464+
let dir = build.src.join("src/tools").join(tool);
468465
cargo.arg("--manifest-path").arg(dir.join("Cargo.toml"));
469466

470467
// We don't want to build tools dynamically as they'll be running across

src/bootstrap/dist.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,6 @@ pub fn rust_src(build: &Build) {
394394
let src_dirs = [
395395
"man",
396396
"src",
397-
"cargo",
398-
"rls",
399397
];
400398

401399
let filter_fn = move |path: &Path| {
@@ -576,7 +574,7 @@ pub fn cargo(build: &Build, stage: u32, target: &str) {
576574
println!("Dist cargo stage{} ({})", stage, target);
577575
let compiler = Compiler::new(stage, &build.config.build);
578576

579-
let src = build.src.join("cargo");
577+
let src = build.src.join("src/tools/cargo");
580578
let etc = src.join("src/etc");
581579
let release_num = build.release_num("cargo");
582580
let name = pkgname(build, "cargo");
@@ -637,7 +635,7 @@ pub fn rls(build: &Build, stage: u32, target: &str) {
637635
println!("Dist RLS stage{} ({})", stage, target);
638636
let compiler = Compiler::new(stage, &build.config.build);
639637

640-
let src = build.src.join("rls");
638+
let src = build.src.join("src/tools/rls");
641639
let release_num = build.release_num("rls");
642640
let name = pkgname(build, "rls");
643641
let version = build.rls_info.version(build, &release_num);

src/bootstrap/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ impl Build {
234234
None => false,
235235
};
236236
let rust_info = channel::GitInfo::new(&src);
237-
let cargo_info = channel::GitInfo::new(&src.join("cargo"));
238-
let rls_info = channel::GitInfo::new(&src.join("rls"));
237+
let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo"));
238+
let rls_info = channel::GitInfo::new(&src.join("src/tools/rls"));
239239
let src_is_git = src.join(".git").exists();
240240

241241
Build {
@@ -1071,7 +1071,7 @@ impl Build {
10711071
/// Returns the `a.b.c` version that the given package is at.
10721072
fn release_num(&self, package: &str) -> String {
10731073
let mut toml = String::new();
1074-
let toml_file_name = self.src.join(&format!("{}/Cargo.toml", package));
1074+
let toml_file_name = self.src.join(&format!("src/tools/{}/Cargo.toml", package));
10751075
t!(t!(File::open(toml_file_name)).read_to_string(&mut toml));
10761076
for line in toml.lines() {
10771077
let prefix = "version = \"";

src/bootstrap/step.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
574574
.dep(|s| s.name("maybe-clean-tools"))
575575
.dep(|s| s.name("libstd-tool"))
576576
.run(move |s| compile::tool(build, s.stage, s.target, "remote-test-client"));
577-
rules.build("tool-cargo", "cargo")
577+
rules.build("tool-cargo", "src/tools/cargo")
578578
.host(true)
579579
.default(build.config.extended)
580580
.dep(|s| s.name("maybe-clean-tools"))
@@ -588,7 +588,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
588588
.host(&build.config.build)
589589
})
590590
.run(move |s| compile::tool(build, s.stage, s.target, "cargo"));
591-
rules.build("tool-rls", "rls")
591+
rules.build("tool-rls", "src/tools/rls")
592592
.host(true)
593593
.default(build.config.extended)
594594
.dep(|s| s.name("librustc-tool"))

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
#![feature(needs_allocator)]
8888
#![feature(optin_builtin_traits)]
8989
#![feature(placement_in_syntax)]
90-
#![cfg_attr(stage0, feature(pub_restricted))]
9190
#![feature(shared)]
9291
#![feature(staged_api)]
9392
#![feature(unboxed_closures)]

src/libcore/intrinsics.rs

-24
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
issue = "0")]
4747
#![allow(missing_docs)]
4848

49-
#[cfg(not(stage0))]
5049
#[stable(feature = "drop_in_place", since = "1.8.0")]
5150
#[rustc_deprecated(reason = "no longer an intrinsic - use `ptr::drop_in_place` directly",
5251
since = "1.18.0")]
@@ -645,27 +644,6 @@ extern "rust-intrinsic" {
645644
pub fn size_of_val<T: ?Sized>(_: &T) -> usize;
646645
pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
647646

648-
#[cfg(stage0)]
649-
/// Executes the destructor (if any) of the pointed-to value.
650-
///
651-
/// This has two use cases:
652-
///
653-
/// * It is *required* to use `drop_in_place` to drop unsized types like
654-
/// trait objects, because they can't be read out onto the stack and
655-
/// dropped normally.
656-
///
657-
/// * It is friendlier to the optimizer to do this over `ptr::read` when
658-
/// dropping manually allocated memory (e.g. when writing Box/Rc/Vec),
659-
/// as the compiler doesn't need to prove that it's sound to elide the
660-
/// copy.
661-
///
662-
/// # Undefined Behavior
663-
///
664-
/// This has all the same safety problems as `ptr::read` with respect to
665-
/// invalid pointers, types, and double drops.
666-
#[stable(feature = "drop_in_place", since = "1.8.0")]
667-
pub fn drop_in_place<T: ?Sized>(to_drop: *mut T);
668-
669647
/// Gets a static string slice containing the name of a type.
670648
pub fn type_name<T: ?Sized>() -> &'static str;
671649

@@ -1261,11 +1239,9 @@ extern "rust-intrinsic" {
12611239

12621240
/// Performs an unchecked left shift, resulting in undefined behavior when
12631241
/// y < 0 or y >= N, where N is the width of T in bits.
1264-
#[cfg(not(stage0))]
12651242
pub fn unchecked_shl<T>(x: T, y: T) -> T;
12661243
/// Performs an unchecked right shift, resulting in undefined behavior when
12671244
/// y < 0 or y >= N, where N is the width of T in bits.
1268-
#[cfg(not(stage0))]
12691245
pub fn unchecked_shr<T>(x: T, y: T) -> T;
12701246

12711247
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.

src/libcore/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ mod impls {
559559
/// any `UnsafeCell` internally, but not through an indirection.
560560
/// This affects, for example, whether a `static` of that type is
561561
/// placed in read-only static memory or writable static memory.
562-
#[cfg_attr(not(stage0), lang = "freeze")]
562+
#[lang = "freeze"]
563563
unsafe trait Freeze {}
564564

565565
unsafe impl Freeze for .. {}

0 commit comments

Comments
 (0)