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 #80544

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
799e822
Rustdoc render public underscore_imports as Re-exports
0urobor0s Dec 21, 2020
f502263
Improve test
0urobor0s Dec 22, 2020
0c217a6
Add error code
0urobor0s Dec 22, 2020
d261176
Formatting
0urobor0s Dec 22, 2020
b3b74a9
Refactor
0urobor0s Dec 23, 2020
5b32ab6
Update and improve `rustc_codegen_{llvm,ssa}` docs
camelid Dec 23, 2020
8a4e7a7
Fix tests
0urobor0s Dec 23, 2020
1990713
Fix tests
0urobor0s Dec 23, 2020
56ea926
Add `#[track_caller]` to `bug!` and `register_renamed`
jyn514 Dec 30, 2020
bd3499b
bootstrap: never delete the tarball temporary directory
pietroalbini Dec 30, 2020
f02def8
bootstrap: change the dist outputs to GeneratedTarball
pietroalbini Dec 30, 2020
f946b54
bootstrap: use the correct paths during ./x.py install
pietroalbini Dec 30, 2020
40bf3c0
Implement edition-based macro pat feature
mark-i-m Dec 28, 2020
26daa65
Update LLVM
tmandry Dec 30, 2020
947b279
Take type defaults into account in suggestions to reorder generic par…
max-heller Dec 30, 2020
27b81bf
Remove all doc_comment!{} hacks by using #[doc = expr] where needed.
m-ou-se Nov 17, 2020
5694b8e
Don't use doc_comment!{} hack in nonzero_leading_trailing_zeros!{}.
m-ou-se Dec 30, 2020
4614cdd
Fix typos.
m-ou-se Dec 30, 2020
7586279
Rollup merge of #79150 - m-ou-se:bye-bye-doc-comment-hack, r=jyn514
Dylan-DPC Dec 31, 2020
00d66b2
Rollup merge of #80267 - 0urobor0s:ouro/61592, r=jyn514
Dylan-DPC Dec 31, 2020
26b8c0d
Rollup merge of #80323 - camelid:codegen-base-docs, r=nagisa
Dylan-DPC Dec 31, 2020
6452dd4
Rollup merge of #80459 - mark-i-m:or-pat-reg, r=petrochenkov
Dylan-DPC Dec 31, 2020
0d5fba7
Rollup merge of #80500 - jyn514:track-caller, r=nagisa
Dylan-DPC Dec 31, 2020
bd54e4a
Rollup merge of #80514 - pietroalbini:fix-install, r=Mark-Simulacrum
Dylan-DPC Dec 31, 2020
41817ae
Rollup merge of #80519 - max-heller:issue-80512-fix, r=varkor
Dylan-DPC Dec 31, 2020
07ba9e9
Rollup merge of #80526 - tmandry:up-llvm, r=nikic
Dylan-DPC Dec 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bootstrap: change the dist outputs to GeneratedTarball
The struct will allow to store more context on the generated tarballs.
pietroalbini committed Dec 30, 2020

Verified

This commit was signed with the committer’s verified signature.
pietroalbini Pietro Albini
commit f02def829bb958a9771ae97d08afa23c9f29875c
76 changes: 38 additions & 38 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ use crate::builder::{Builder, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
use crate::compile;
use crate::config::TargetSelection;
use crate::tarball::{OverlayKind, Tarball};
use crate::tarball::{GeneratedTarball, OverlayKind, Tarball};
use crate::tool::{self, Tool};
use crate::util::{exe, is_dylib, timeit};
use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS};
@@ -51,7 +51,7 @@ pub struct Docs {
}

impl Step for Docs {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -63,7 +63,7 @@ impl Step for Docs {
}

/// Builds the `rust-docs` installer component.
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let host = self.host;
if !builder.config.docs {
return None;
@@ -86,7 +86,7 @@ pub struct RustcDocs {
}

impl Step for RustcDocs {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -98,7 +98,7 @@ impl Step for RustcDocs {
}

/// Builds the `rustc-docs` installer component.
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let host = self.host;
if !builder.config.compiler_docs {
return None;
@@ -267,7 +267,7 @@ pub struct Mingw {
}

impl Step for Mingw {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -282,7 +282,7 @@ impl Step for Mingw {
///
/// This contains all the bits and pieces to run the MinGW Windows targets
/// without any extra installed software (e.g., we bundle gcc, libraries, etc).
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let host = self.host;
if !host.contains("pc-windows-gnu") {
return None;
@@ -307,7 +307,7 @@ pub struct Rustc {
}

impl Step for Rustc {
type Output = PathBuf;
type Output = GeneratedTarball;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

@@ -321,7 +321,7 @@ impl Step for Rustc {
}

/// Creates the `rustc` installer component.
fn run(self, builder: &Builder<'_>) -> PathBuf {
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
let compiler = self.compiler;
let host = self.compiler.host;

@@ -555,7 +555,7 @@ pub struct Std {
}

impl Step for Std {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -573,7 +573,7 @@ impl Step for Std {
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;

@@ -601,7 +601,7 @@ pub struct RustcDev {
}

impl Step for RustcDev {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

@@ -620,7 +620,7 @@ impl Step for RustcDev {
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;
if skip_host_target_lib(builder, compiler) {
@@ -660,7 +660,7 @@ pub struct Analysis {
}

impl Step for Analysis {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -683,7 +683,7 @@ impl Step for Analysis {
}

/// Creates a tarball of save-analysis metadata, if available.
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;
assert!(builder.config.extended);
@@ -796,7 +796,7 @@ pub struct Src;

impl Step for Src {
/// The output path of the src installer tarball
type Output = PathBuf;
type Output = GeneratedTarball;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

@@ -809,7 +809,7 @@ impl Step for Src {
}

/// Creates the `rust-src` installer component
fn run(self, builder: &Builder<'_>) -> PathBuf {
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
let tarball = Tarball::new_targetless(builder, "rust-src");

// A lot of tools expect the rust-src component to be entirely in this directory, so if you
@@ -848,7 +848,7 @@ pub struct PlainSourceTarball;

impl Step for PlainSourceTarball {
/// Produces the location of the tarball generated
type Output = PathBuf;
type Output = GeneratedTarball;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

@@ -862,7 +862,7 @@ impl Step for PlainSourceTarball {
}

/// Creates the plain source tarball
fn run(self, builder: &Builder<'_>) -> PathBuf {
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
let tarball = Tarball::new(builder, "rustc", "src");
let plain_dst_src = tarball.image_dir();

@@ -941,7 +941,7 @@ pub struct Cargo {
}

impl Step for Cargo {
type Output = PathBuf;
type Output = GeneratedTarball;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -959,7 +959,7 @@ impl Step for Cargo {
});
}

fn run(self, builder: &Builder<'_>) -> PathBuf {
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
let compiler = self.compiler;
let target = self.target;

@@ -995,7 +995,7 @@ pub struct Rls {
}

impl Step for Rls {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1013,7 +1013,7 @@ impl Step for Rls {
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;
assert!(builder.config.extended);
@@ -1041,7 +1041,7 @@ pub struct RustAnalyzer {
}

impl Step for RustAnalyzer {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1059,7 +1059,7 @@ impl Step for RustAnalyzer {
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;
assert!(builder.config.extended);
@@ -1090,7 +1090,7 @@ pub struct Clippy {
}

impl Step for Clippy {
type Output = PathBuf;
type Output = GeneratedTarball;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1108,7 +1108,7 @@ impl Step for Clippy {
});
}

fn run(self, builder: &Builder<'_>) -> PathBuf {
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
let compiler = self.compiler;
let target = self.target;
assert!(builder.config.extended);
@@ -1140,7 +1140,7 @@ pub struct Miri {
}

impl Step for Miri {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1158,7 +1158,7 @@ impl Step for Miri {
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;
assert!(builder.config.extended);
@@ -1193,7 +1193,7 @@ pub struct Rustfmt {
}

impl Step for Rustfmt {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1211,7 +1211,7 @@ impl Step for Rustfmt {
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let compiler = self.compiler;
let target = self.target;

@@ -1870,7 +1870,7 @@ pub struct LlvmTools {
}

impl Step for LlvmTools {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1881,7 +1881,7 @@ impl Step for LlvmTools {
run.builder.ensure(LlvmTools { target: run.target });
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let target = self.target;
assert!(builder.config.extended);

@@ -1924,7 +1924,7 @@ pub struct RustDev {
}

impl Step for RustDev {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

@@ -1936,7 +1936,7 @@ impl Step for RustDev {
run.builder.ensure(RustDev { target: run.target });
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let target = self.target;

/* run only if llvm-config isn't used */
@@ -1989,7 +1989,7 @@ pub struct BuildManifest {
}

impl Step for BuildManifest {
type Output = PathBuf;
type Output = GeneratedTarball;
const DEFAULT: bool = false;
const ONLY_HOSTS: bool = true;

@@ -2001,7 +2001,7 @@ impl Step for BuildManifest {
run.builder.ensure(BuildManifest { target: run.target });
}

fn run(self, builder: &Builder<'_>) -> PathBuf {
fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
let build_manifest = builder.tool_exe(Tool::BuildManifest);

let tarball = Tarball::new(builder, "build-manifest", &self.target.triple);
@@ -2021,7 +2021,7 @@ pub struct ReproducibleArtifacts {
}

impl Step for ReproducibleArtifacts {
type Output = Option<PathBuf>;
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

29 changes: 21 additions & 8 deletions src/bootstrap/tarball.rs
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ impl<'a> Tarball<'a> {
self.temp_dir.clone()
}

pub(crate) fn generate(self) -> PathBuf {
pub(crate) fn generate(self) -> GeneratedTarball {
let mut component_name = self.component.clone();
if self.is_preview {
component_name.push_str("-preview");
@@ -224,20 +224,20 @@ impl<'a> Tarball<'a> {
})
}

pub(crate) fn combine(self, tarballs: &[PathBuf]) {
let mut input_tarballs = tarballs[0].as_os_str().to_os_string();
pub(crate) fn combine(self, tarballs: &[GeneratedTarball]) -> GeneratedTarball {
let mut input_tarballs = tarballs[0].path.as_os_str().to_os_string();
for tarball in &tarballs[1..] {
input_tarballs.push(",");
input_tarballs.push(tarball);
input_tarballs.push(&tarball.path);
}

self.run(|this, cmd| {
cmd.arg("combine").arg("--input-tarballs").arg(input_tarballs);
this.non_bare_args(cmd);
});
})
}

pub(crate) fn bare(self) -> PathBuf {
pub(crate) fn bare(self) -> GeneratedTarball {
// Bare tarballs should have the top level directory match the package
// name, not "image". We rename the image directory just before passing
// into rust-installer.
@@ -273,7 +273,7 @@ impl<'a> Tarball<'a> {
.arg(crate::dist::distdir(self.builder));
}

fn run(self, build_cli: impl FnOnce(&Tarball<'a>, &mut Command)) -> PathBuf {
fn run(self, build_cli: impl FnOnce(&Tarball<'a>, &mut Command)) -> GeneratedTarball {
t!(std::fs::create_dir_all(&self.overlay_dir));
self.builder.create(&self.overlay_dir.join("version"), &self.overlay.version(self.builder));
if let Some(sha) = self.builder.rust_sha() {
@@ -293,6 +293,19 @@ impl<'a> Tarball<'a> {
cmd.arg("--work-dir").arg(&self.temp_dir);
self.builder.run(&mut cmd);

crate::dist::distdir(self.builder).join(format!("{}.tar.gz", package_name))
GeneratedTarball {
path: crate::dist::distdir(self.builder).join(format!("{}.tar.gz", package_name)),
}
}
}

#[derive(Debug, Clone)]
pub struct GeneratedTarball {
path: PathBuf,
}

impl GeneratedTarball {
pub(crate) fn tarball(&self) -> &Path {
&self.path
}
}
4 changes: 2 additions & 2 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
@@ -1963,7 +1963,7 @@ impl Step for Distcheck {

let mut cmd = Command::new("tar");
cmd.arg("-xzf")
.arg(builder.ensure(dist::PlainSourceTarball))
.arg(builder.ensure(dist::PlainSourceTarball).tarball())
.arg("--strip-components=1")
.current_dir(&dir);
builder.run(&mut cmd);
@@ -1987,7 +1987,7 @@ impl Step for Distcheck {

let mut cmd = Command::new("tar");
cmd.arg("-xzf")
.arg(builder.ensure(dist::Src))
.arg(builder.ensure(dist::Src).tarball())
.arg("--strip-components=1")
.current_dir(&dir);
builder.run(&mut cmd);