Skip to content
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

Rollup of 8 pull requests #42184

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9ad0dba
remove "much" from unicode diagnostic
euclio May 20, 2017
66237af
Fix building without backtrace feature, which was broken in ca8b754
ids1024 May 21, 2017
f4147e5
Implement requires_synchronized_create() for Redox
ids1024 May 21, 2017
6dde3f4
Move some tests from compile-fail to ui
oli-obk May 16, 2017
ec1fa6d
Change macro typo helps to suggestions
oli-obk May 16, 2017
27359bd
Change enum variant help into a suggestion
oli-obk May 16, 2017
e328ef0
Change some "did you mean `self.*`" messages to suggestions
oli-obk May 16, 2017
8add02a
Changes in ui tests
oli-obk May 16, 2017
e618a4f
Add some guidelines for suggestion messages and follow them
oli-obk May 18, 2017
a9b54ab
Update ui tests output
oli-obk May 18, 2017
9d41d0e
Move a compile-fail test to ui
oli-obk May 18, 2017
bff4795
Tidy errors
oli-obk May 18, 2017
6f681c2
Fix line numbers in ui test
oli-obk May 22, 2017
1343bc6
Readd //~ERROR messages
oli-obk May 22, 2017
150d644
rustbuild: split Install out of Dist subcommand
Keruspe May 18, 2017
14b767d
Add example of recursive drop to Drop trait.
Havvy May 22, 2017
ca909c8
Add example of variable declaration drop order to Drop trait.
Havvy May 22, 2017
d7927ff
Add description of how values are dropped to Drop trait.
Havvy May 22, 2017
5f4b0ff
Fix trailing whitespace.
Havvy May 22, 2017
72eb010
update-all-references.sh doesn't deterministically work on ui-fulldeps
oli-obk May 23, 2017
b41b294
Suggested changes by birkenfeld
Havvy May 23, 2017
794e572
Give step_trait a distinct tracking issue from step_by
scottmcm May 23, 2017
9af464b
rustbuild: drop unused macro in tets
Keruspe May 23, 2017
53ae00a
rustbuild: make distcheck depend on dist-plain-source-tarball
Keruspe May 23, 2017
e860655
Remove some needless // gate-test- comments
est31 May 23, 2017
2fc3f28
Rollup merge of #42033 - oli-obk:suggestions, r=petrochenkov
frewsxcv May 24, 2017
c6fbf7e
Rollup merge of #42109 - Keruspe:master, r=alexcrichton
frewsxcv May 24, 2017
d3e05bb
Rollup merge of #42120 - euclio:unicode, r=arielb1
frewsxcv May 24, 2017
057761c
Rollup merge of #42141 - ids1024:nobacktrace, r=aturon
frewsxcv May 24, 2017
de0ab85
Rollup merge of #42142 - ids1024:redox, r=aturon
frewsxcv May 24, 2017
5b88bb8
Rollup merge of #42159 - Havvy:doc-drop, r=steveklabnik
frewsxcv May 24, 2017
03adfe0
Rollup merge of #42169 - scottmcm:new-step-trait-issue, r=alexcrichton
frewsxcv May 24, 2017
2c39c0d
Rollup merge of #42177 - est31:master, r=Mark-Simulacrum
frewsxcv May 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -35,15 +35,15 @@ Read ["Installing Rust"] from [The Book].
3. Build and install:

```sh
$ ./x.py build && sudo ./x.py dist --install
$ ./x.py build && sudo ./x.py install
```

> ***Note:*** Install locations can be adjusted by copying the config file
> from `./src/bootstrap/config.toml.example` to `./config.toml`, and
> adjusting the `prefix` option under `[install]`. Various other options are
> also supported, and are documented in the config file.

When complete, `sudo ./x.py dist --install` will place several programs into
When complete, `sudo ./x.py install` will place several programs into
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
API-documentation tool. This install does not include [Cargo],
Rust's package manager, which you may also want to build.
Expand Down Expand Up @@ -96,7 +96,7 @@ build.
4. Navigate to Rust's source code (or clone it), then build it:

```sh
$ ./x.py build && ./x.py dist --install
$ ./x.py build && ./x.py install
```

#### MSVC
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/config.toml.example
Expand Up @@ -314,3 +314,9 @@
# Note that this address should not contain a trailing slash as file names will
# be appended to it.
#upload-addr = "https://example.com/folder"

# Whether to build a plain source tarball to upload
# We disable that on Windows not to override the one already uploaded on S3
# as the one built on Windows will contain backslashes in paths causing problems
# on linux
#src-tarball = true
182 changes: 91 additions & 91 deletions src/bootstrap/dist.rs
Expand Up @@ -30,11 +30,11 @@ use {Build, Compiler, Mode};
use channel;
use util::{cp_r, libdir, is_dylib, cp_filtered, copy, exe};

fn pkgname(build: &Build, component: &str) -> String {
pub fn pkgname(build: &Build, component: &str) -> String {
if component == "cargo" {
format!("{}-{}", component, build.cargo_package_vers())
} else if component == "rls" {
format!("{}-{}", component, build.package_vers(&build.release_num("rls")))
format!("{}-{}", component, build.rls_package_vers())
} else {
assert!(component.starts_with("rust"));
format!("{}-{}", component, build.rust_package_vers())
Expand Down Expand Up @@ -369,38 +369,7 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
t!(fs::remove_dir_all(&image));
}

const CARGO_VENDOR_VERSION: &'static str = "0.1.4";

/// Creates the `rust-src` installer component and the plain source tarball
pub fn rust_src(build: &Build) {
if !build.config.rust_dist_src {
return
}

println!("Dist src");

// Make sure that the root folder of tarball has the correct name
let plain_name = format!("rustc-{}-src", build.rust_package_vers());
let plain_dst_src = tmpdir(build).join(&plain_name);
let _ = fs::remove_dir_all(&plain_dst_src);
t!(fs::create_dir_all(&plain_dst_src));

// This is the set of root paths which will become part of the source package
let src_files = [
"COPYRIGHT",
"LICENSE-APACHE",
"LICENSE-MIT",
"CONTRIBUTING.md",
"README.md",
"RELEASES.md",
"configure",
"x.py",
];
let src_dirs = [
"man",
"src",
];

fn copy_src_dirs(build: &Build, src_dirs: &[&str], dst_dir: &Path) {
let filter_fn = move |path: &Path| {
let spath = match path.to_str() {
Some(path) => path,
Expand Down Expand Up @@ -429,60 +398,16 @@ pub fn rust_src(build: &Build) {
};

// Copy the directories using our filter
for item in &src_dirs {
let dst = &plain_dst_src.join(item);
t!(fs::create_dir(dst));
for item in src_dirs {
let dst = &dst_dir.join(item);
t!(fs::create_dir_all(dst));
cp_filtered(&build.src.join(item), dst, &filter_fn);
}
// Copy the files normally
for item in &src_files {
copy(&build.src.join(item), &plain_dst_src.join(item));
}

// If we're building from git sources, we need to vendor a complete distribution.
if build.src_is_git {
// Get cargo-vendor installed, if it isn't already.
let mut has_cargo_vendor = false;
let mut cmd = Command::new(&build.cargo);
for line in output(cmd.arg("install").arg("--list")).lines() {
has_cargo_vendor |= line.starts_with("cargo-vendor ");
}
if !has_cargo_vendor {
let mut cmd = Command::new(&build.cargo);
cmd.arg("install")
.arg("--force")
.arg("--debug")
.arg("--vers").arg(CARGO_VENDOR_VERSION)
.arg("cargo-vendor")
.env("RUSTC", &build.rustc);
build.run(&mut cmd);
}

// Vendor all Cargo dependencies
let mut cmd = Command::new(&build.cargo);
cmd.arg("vendor")
.current_dir(&plain_dst_src.join("src"));
build.run(&mut cmd);
}

// Create the version file
write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes());

// Create plain source tarball
let mut tarball = rust_src_location(build);
tarball.set_extension(""); // strip .gz
tarball.set_extension(""); // strip .tar
if let Some(dir) = tarball.parent() {
t!(fs::create_dir_all(dir));
}
let mut cmd = rust_installer(build);
cmd.arg("tarball")
.arg("--input").arg(&plain_name)
.arg("--output").arg(&tarball)
.arg("--work-dir=.")
.current_dir(tmpdir(build));
build.run(&mut cmd);
}

/// Creates the `rust-src` installer component
pub fn rust_src(build: &Build) {
println!("Dist src");

let name = pkgname(build, "rust-src");
let image = tmpdir(build).join(format!("{}-image", name));
Expand Down Expand Up @@ -516,11 +441,7 @@ pub fn rust_src(build: &Build) {
"src/rustc/libc_shim",
];

for item in &std_src_dirs {
let dst = &dst_src.join(item);
t!(fs::create_dir_all(dst));
cp_r(&plain_dst_src.join(item), dst);
}
copy_src_dirs(build, &std_src_dirs[..], &dst_src);

// Create source tarball in rust-installer format
let mut cmd = rust_installer(build);
Expand All @@ -537,7 +458,86 @@ pub fn rust_src(build: &Build) {
build.run(&mut cmd);

t!(fs::remove_dir_all(&image));
t!(fs::remove_dir_all(&plain_dst_src));
}

const CARGO_VENDOR_VERSION: &'static str = "0.1.4";

/// Creates the plain source tarball
pub fn plain_source_tarball(build: &Build) {
println!("Create plain source tarball");

// Make sure that the root folder of tarball has the correct name
let plain_name = format!("{}-src", pkgname(build, "rustc"));
let plain_dst_src = tmpdir(build).join(&plain_name);
let _ = fs::remove_dir_all(&plain_dst_src);
t!(fs::create_dir_all(&plain_dst_src));

// This is the set of root paths which will become part of the source package
let src_files = [
"COPYRIGHT",
"LICENSE-APACHE",
"LICENSE-MIT",
"CONTRIBUTING.md",
"README.md",
"RELEASES.md",
"configure",
"x.py",
];
let src_dirs = [
"man",
"src",
];

copy_src_dirs(build, &src_dirs[..], &plain_dst_src);

// Copy the files normally
for item in &src_files {
copy(&build.src.join(item), &plain_dst_src.join(item));
}

// Create the version file
write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes());

// If we're building from git sources, we need to vendor a complete distribution.
if build.src_is_git {
// Get cargo-vendor installed, if it isn't already.
let mut has_cargo_vendor = false;
let mut cmd = Command::new(&build.cargo);
for line in output(cmd.arg("install").arg("--list")).lines() {
has_cargo_vendor |= line.starts_with("cargo-vendor ");
}
if !has_cargo_vendor {
let mut cmd = Command::new(&build.cargo);
cmd.arg("install")
.arg("--force")
.arg("--debug")
.arg("--vers").arg(CARGO_VENDOR_VERSION)
.arg("cargo-vendor")
.env("RUSTC", &build.rustc);
build.run(&mut cmd);
}

// Vendor all Cargo dependencies
let mut cmd = Command::new(&build.cargo);
cmd.arg("vendor")
.current_dir(&plain_dst_src.join("src"));
build.run(&mut cmd);
}

// Create plain source tarball
let mut tarball = rust_src_location(build);
tarball.set_extension(""); // strip .gz
tarball.set_extension(""); // strip .tar
if let Some(dir) = tarball.parent() {
t!(fs::create_dir_all(dir));
}
let mut cmd = rust_installer(build);
cmd.arg("tarball")
.arg("--input").arg(&plain_name)
.arg("--output").arg(&tarball)
.arg("--work-dir=.")
.current_dir(tmpdir(build));
build.run(&mut cmd);
}

fn install(src: &Path, dstdir: &Path, perms: u32) {
Expand Down
17 changes: 12 additions & 5 deletions src/bootstrap/flags.rs
Expand Up @@ -69,7 +69,9 @@ pub enum Subcommand {
Clean,
Dist {
paths: Vec<PathBuf>,
install: bool,
},
Install {
paths: Vec<PathBuf>,
},
}

Expand All @@ -85,7 +87,8 @@ Subcommands:
bench Build and run some benchmarks
doc Build documentation
clean Clean out build directories
dist Build and/or install distribution artifacts
dist Build distribution artifacts
install Install distribution artifacts

To learn more about a subcommand, run `./x.py <subcommand> -h`");

Expand Down Expand Up @@ -125,7 +128,8 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
|| (s == "bench")
|| (s == "doc")
|| (s == "clean")
|| (s == "dist"));
|| (s == "dist")
|| (s == "install"));
let subcommand = match possible_subcommands.first() {
Some(s) => s,
None => {
Expand All @@ -139,7 +143,6 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
match subcommand.as_str() {
"test" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
"bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
"dist" => { opts.optflag("", "install", "run installer as well"); },
_ => { },
};

Expand Down Expand Up @@ -281,7 +284,11 @@ Arguments:
"dist" => {
Subcommand::Dist {
paths: paths,
install: matches.opt_present("install"),
}
}
"install" => {
Subcommand::Install {
paths: paths,
}
}
_ => {
Expand Down