mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-29 21:41:47 +00:00
Rollup merge of #127434 - onur-ozkan:use-bootstrap-instead-of-rustbuild, r=Mark-Simulacrum
use "bootstrap" instead of "rustbuild" in comments and docs Let's stick with the single name "bootstrap" to refer to the bootstrap project to avoid confusion. This should make it clearer, especially for new contributors.
This commit is contained in:
commit
1d59d22ac1
@ -215,7 +215,7 @@ python x.py build
|
||||
|
||||
Right now, building Rust only works with some known versions of Visual Studio.
|
||||
If you have a more recent version installed and the build system doesn't
|
||||
understand, you may need to force rustbuild to use an older version.
|
||||
understand, you may need to force bootstrap to use an older version.
|
||||
This can be done by manually calling the appropriate vcvars file before running
|
||||
the bootstrap.
|
||||
|
||||
|
@ -398,7 +398,7 @@ impl<'a> GccLinker<'a> {
|
||||
self.link_arg("-dylib");
|
||||
|
||||
// Note that the `osx_rpath_install_name` option here is a hack
|
||||
// purely to support rustbuild right now, we should get a more
|
||||
// purely to support bootstrap right now, we should get a more
|
||||
// principled solution at some point to force the compiler to pass
|
||||
// the right `-Wl,-install_name` with an `@rpath` in it.
|
||||
if self.sess.opts.cg.rpath || self.sess.opts.unstable_opts.osx_rpath_install_name {
|
||||
|
@ -2620,7 +2620,7 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
|
||||
// This is the location used by the `rust-src` `rustup` component.
|
||||
let mut candidate = sysroot.join("lib/rustlib/src/rust");
|
||||
if let Ok(metadata) = candidate.symlink_metadata() {
|
||||
// Replace the symlink rustbuild creates, with its destination.
|
||||
// Replace the symlink bootstrap creates, with its destination.
|
||||
// We could try to use `fs::canonicalize` instead, but that might
|
||||
// produce unnecessarily verbose path.
|
||||
if metadata.file_type().is_symlink() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Sample TOML configuration file for building Rust.
|
||||
#
|
||||
# To configure rustbuild, run `./configure` or `./x.py setup`.
|
||||
# To configure bootstrap, run `./configure` or `./x.py setup`.
|
||||
# See https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#create-a-configtoml for more information.
|
||||
#
|
||||
# All options are commented out by default in this file, and they're commented
|
||||
@ -109,7 +109,7 @@
|
||||
# increases the size of binaries and consequently the memory required by
|
||||
# each linker process.
|
||||
# If set to 0, linker invocations are treated like any other job and
|
||||
# controlled by rustbuild's -j parameter.
|
||||
# controlled by bootstrap's -j parameter.
|
||||
#link-jobs = 0
|
||||
|
||||
# Whether to build LLVM as a dynamically linked library (as opposed to statically linked).
|
||||
@ -371,11 +371,11 @@
|
||||
# Useful for modifying only the stage2 compiler without having to pass `--keep-stage 0` each time.
|
||||
#local-rebuild = false
|
||||
|
||||
# Print out how long each rustbuild step took (mostly intended for CI and
|
||||
# Print out how long each bootstrap step took (mostly intended for CI and
|
||||
# tracking over time)
|
||||
#print-step-timings = false
|
||||
|
||||
# Print out resource usage data for each rustbuild step, as defined by the Unix
|
||||
# Print out resource usage data for each bootstrap step, as defined by the Unix
|
||||
# struct rusage. (Note that this setting is completely unstable: the data it
|
||||
# captures, what platforms it supports, the format of its associated output, and
|
||||
# this setting's very existence, are all subject to change.)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# rustbuild - Bootstrapping Rust
|
||||
# Bootstrapping Rust
|
||||
|
||||
This README is aimed at helping to explain how Rust is bootstrapped,
|
||||
and some of the technical details of the build system.
|
||||
and some of the technical details of the bootstrap build system.
|
||||
|
||||
Note that this README only covers internal information, not how to use the tool.
|
||||
Please check [bootstrapping dev guide][bootstrapping-dev-guide] for further information.
|
||||
@ -12,17 +12,17 @@ Please check [bootstrapping dev guide][bootstrapping-dev-guide] for further info
|
||||
|
||||
The build system defers most of the complicated logic of managing invocations
|
||||
of rustc and rustdoc to Cargo itself. However, moving through various stages
|
||||
and copying artifacts is still necessary for it to do. Each time rustbuild
|
||||
and copying artifacts is still necessary for it to do. Each time bootstrap
|
||||
is invoked, it will iterate through the list of predefined steps and execute
|
||||
each serially in turn if it matches the paths passed or is a default rule.
|
||||
For each step, rustbuild relies on the step internally being incremental and
|
||||
parallel. Note, though, that the `-j` parameter to rustbuild gets forwarded
|
||||
For each step, bootstrap relies on the step internally being incremental and
|
||||
parallel. Note, though, that the `-j` parameter to bootstrap gets forwarded
|
||||
to appropriate test harnesses and such.
|
||||
|
||||
## Build phases
|
||||
|
||||
The rustbuild build system goes through a few phases to actually build the
|
||||
compiler. What actually happens when you invoke rustbuild is:
|
||||
Bootstrap build system goes through a few phases to actually build the
|
||||
compiler. What actually happens when you invoke bootstrap is:
|
||||
|
||||
1. The entry point script (`x` for unix like systems, `x.ps1` for windows systems,
|
||||
`x.py` cross-platform) is run. This script is responsible for downloading the stage0
|
||||
@ -151,9 +151,9 @@ build/
|
||||
stage3/
|
||||
```
|
||||
|
||||
## Extending rustbuild
|
||||
## Extending bootstrap
|
||||
|
||||
When you use the bootstrap system, you'll call it through the entry point script
|
||||
When you use bootstrap, you'll call it through the entry point script
|
||||
(`x`, `x.ps1`, or `x.py`). However, most of the code lives in `src/bootstrap`.
|
||||
`bootstrap` has a difficult problem: it is written in Rust, but yet it is run
|
||||
before the Rust compiler is built! To work around this, there are two components
|
||||
|
@ -1038,7 +1038,7 @@ class RustBuild(object):
|
||||
|
||||
def check_vendored_status(self):
|
||||
"""Check that vendoring is configured properly"""
|
||||
# keep this consistent with the equivalent check in rustbuild:
|
||||
# keep this consistent with the equivalent check in bootstrap:
|
||||
# https://github.com/rust-lang/rust/blob/a8a33cf27166d3eabaffc58ed3799e054af3b0c6/src/bootstrap/lib.rs#L399-L405
|
||||
if 'SUDO_USER' in os.environ and not self.use_vendored_sources:
|
||||
if os.getuid() == 0:
|
||||
|
@ -20,7 +20,7 @@ all:
|
||||
$(Q)$(BOOTSTRAP) doc --stage 2 $(BOOTSTRAP_ARGS)
|
||||
|
||||
help:
|
||||
$(Q)echo 'Welcome to the rustbuild build system!'
|
||||
$(Q)echo 'Welcome to bootstrap, the Rust build system!'
|
||||
$(Q)echo
|
||||
$(Q)echo This makefile is a thin veneer over the ./x.py script located
|
||||
$(Q)echo in this directory. To get the full power of the build system
|
||||
|
@ -1,4 +1,4 @@
|
||||
//! rustbuild, the Rust build system
|
||||
//! bootstrap, the Rust build system
|
||||
//!
|
||||
//! This is the entry point for the build system used to compile the `rustc`
|
||||
//! compiler. Lots of documentation can be found in the `README.md` file in the
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Implementation of compiling various phases of the compiler and standard
|
||||
//! library.
|
||||
//!
|
||||
//! This module contains some of the real meat in the rustbuild build system
|
||||
//! This module contains some of the real meat in the bootstrap build system
|
||||
//! which is where Cargo is used to compile the standard library, libtest, and
|
||||
//! the compiler. This module is also responsible for assembling the sysroot as it
|
||||
//! goes along from the output of the previous stage.
|
||||
@ -818,8 +818,8 @@ pub struct Rustc {
|
||||
pub compiler: Compiler,
|
||||
/// Whether to build a subset of crates, rather than the whole compiler.
|
||||
///
|
||||
/// This should only be requested by the user, not used within rustbuild itself.
|
||||
/// Using it within rustbuild can lead to confusing situation where lints are replayed
|
||||
/// This should only be requested by the user, not used within bootstrap itself.
|
||||
/// Using it within bootstrap can lead to confusing situation where lints are replayed
|
||||
/// in two different steps.
|
||||
crates: Vec<String>,
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
//! Documentation generation for rustbuilder.
|
||||
//! Documentation generation for bootstrap.
|
||||
//!
|
||||
//! This module implements generation for all bits and pieces of documentation
|
||||
//! for the Rust project. This notably includes suites like the rust book, the
|
||||
|
@ -3043,7 +3043,7 @@ impl Step for Bootstrap {
|
||||
// https://github.com/rust-lang/rust/issues/49215
|
||||
cmd.env("RUSTFLAGS", flags);
|
||||
}
|
||||
// rustbuild tests are racy on directory creation so just run them one at a time.
|
||||
// bootstrap tests are racy on directory creation so just run them one at a time.
|
||||
// Since there's not many this shouldn't be a problem.
|
||||
run_cargo_test(cmd, &["--test-threads=1"], &[], "bootstrap", None, compiler, host, builder);
|
||||
}
|
||||
|
@ -1627,11 +1627,11 @@ impl<'a> Builder<'a> {
|
||||
}
|
||||
|
||||
// This tells Cargo (and in turn, rustc) to output more complete
|
||||
// dependency information. Most importantly for rustbuild, this
|
||||
// dependency information. Most importantly for bootstrap, this
|
||||
// includes sysroot artifacts, like libstd, which means that we don't
|
||||
// need to track those in rustbuild (an error prone process!). This
|
||||
// need to track those in bootstrap (an error prone process!). This
|
||||
// feature is currently unstable as there may be some bugs and such, but
|
||||
// it represents a big improvement in rustbuild's reliability on
|
||||
// it represents a big improvement in bootstrap's reliability on
|
||||
// rebuilds, so we're using it here.
|
||||
//
|
||||
// For some additional context, see #63470 (the PR originally adding
|
||||
@ -1643,7 +1643,7 @@ impl<'a> Builder<'a> {
|
||||
// Restrict the allowed features so we don't depend on nightly
|
||||
// accidentally.
|
||||
//
|
||||
// binary-dep-depinfo is used by rustbuild itself for all
|
||||
// binary-dep-depinfo is used by bootstrap itself for all
|
||||
// compilations.
|
||||
//
|
||||
// Lots of tools depend on proc_macro2 and proc-macro-error.
|
||||
|
@ -266,7 +266,7 @@ mod defaults {
|
||||
// rustdoc/rustcc/std here (the user only requested a host=B build, so
|
||||
// there's not really a need for us to build for target A in this case
|
||||
// (since we're producing stage 1 libraries/binaries). But currently
|
||||
// rustbuild is just a bit buggy here; this should be fixed though.
|
||||
// bootstrap is just a bit buggy here; this should be fixed though.
|
||||
assert_eq!(
|
||||
first(cache.all::<compile::Std>()),
|
||||
&[
|
||||
|
@ -658,8 +658,7 @@ impl Merge for TomlConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// We are using a decl macro instead of a derive proc macro here to reduce the compile time of
|
||||
// rustbuild.
|
||||
// We are using a decl macro instead of a derive proc macro here to reduce the compile time of bootstrap.
|
||||
macro_rules! define_config {
|
||||
($(#[$attr:meta])* struct $name:ident {
|
||||
$($field:ident: Option<$field_ty:ty> = $field_key:literal,)*
|
||||
@ -704,7 +703,7 @@ macro_rules! define_config {
|
||||
|
||||
// The following is a trimmed version of what serde_derive generates. All parts not relevant
|
||||
// for toml deserialization have been removed. This reduces the binary size and improves
|
||||
// compile time of rustbuild.
|
||||
// compile time of bootstrap.
|
||||
impl<'de> Deserialize<'de> for $name {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
|
@ -1,4 +1,4 @@
|
||||
//! Command-line interface of the rustbuild build system.
|
||||
//! Command-line interface of the bootstrap build system.
|
||||
//!
|
||||
//! This module implements the command-line parsing of the build system which
|
||||
//! has various flags to configure how it's run.
|
||||
|
@ -1,4 +1,4 @@
|
||||
//! Sanity checking performed by rustbuild before actually executing anything.
|
||||
//! Sanity checking performed by bootstrap before actually executing anything.
|
||||
//!
|
||||
//! This module contains the implementation of ensuring that the build
|
||||
//! environment looks reasonable before progressing. This will verify that
|
||||
|
@ -1,9 +1,9 @@
|
||||
//! Implementation of rustbuild, the Rust build system.
|
||||
//! Implementation of bootstrap, the Rust build system.
|
||||
//!
|
||||
//! This module, and its descendants, are the implementation of the Rust build
|
||||
//! system. Most of this build system is backed by Cargo but the outer layer
|
||||
//! here serves as the ability to orchestrate calling Cargo, sequencing Cargo
|
||||
//! builds, building artifacts like LLVM, etc. The goals of rustbuild are:
|
||||
//! builds, building artifacts like LLVM, etc. The goals of bootstrap are:
|
||||
//!
|
||||
//! * To be an easily understandable, easily extensible, and maintainable build
|
||||
//! system.
|
||||
|
@ -1,4 +1,4 @@
|
||||
//! Various utility functions used throughout rustbuild.
|
||||
//! Various utility functions used throughout bootstrap.
|
||||
//!
|
||||
//! Simple things like testing the various filesystem operations here and there,
|
||||
//! not a lot of interesting happenings here unfortunately.
|
||||
|
@ -40,7 +40,7 @@ if isMacOS; then
|
||||
# our own clang can figure out the correct include path on its own.
|
||||
ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
|
||||
|
||||
# Configure `AR` specifically so rustbuild doesn't try to infer it as
|
||||
# Configure `AR` specifically so bootstrap doesn't try to infer it as
|
||||
# `clang-ar` by accident.
|
||||
ciCommandSetEnv AR "ar"
|
||||
elif isWindows && ! isKnownToBeMingwBuild; then
|
||||
|
@ -46,7 +46,7 @@ on how to setup a development and runtime environment.
|
||||
|
||||
As a tier 2 target, the target is built by the Rust project.
|
||||
|
||||
You can configure rustbuild like so:
|
||||
You can configure bootstrap like so:
|
||||
|
||||
```toml
|
||||
[build]
|
||||
|
@ -25,7 +25,7 @@ impl CiEnv {
|
||||
/// If in a CI environment, forces the command to run with colors.
|
||||
pub fn force_coloring_in_ci(self, cmd: &mut Command) {
|
||||
if self != CiEnv::None {
|
||||
// Due to use of stamp/docker, the output stream of rustbuild is not
|
||||
// Due to use of stamp/docker, the output stream of bootstrap is not
|
||||
// a TTY in CI, so coloring is by-default turned off.
|
||||
// The explicit `TERM=xterm` environment is needed for
|
||||
// `--color always` to actually work. This env var was lost when
|
||||
|
@ -37,7 +37,7 @@ impl<'a> LintExtractor<'a> {
|
||||
.map_err(|e| format!("could not read {}: {}", groups_path.display(), e))?;
|
||||
let new_contents =
|
||||
contents.replace("{{groups-table}}", &self.make_groups_table(lints, &groups)?);
|
||||
// Delete the output because rustbuild uses hard links in its copies.
|
||||
// Delete the output because bootstrap uses hard links in its copies.
|
||||
let _ = fs::remove_file(&groups_path);
|
||||
fs::write(&groups_path, new_contents)
|
||||
.map_err(|e| format!("could not write to {}: {}", groups_path.display(), e))?;
|
||||
|
@ -532,7 +532,7 @@ impl<'a> LintExtractor<'a> {
|
||||
}
|
||||
add_rename_redirect(level, &mut result);
|
||||
let out_path = self.out_path.join("listing").join(level.doc_filename());
|
||||
// Delete the output because rustbuild uses hard links in its copies.
|
||||
// Delete the output because bootstrap uses hard links in its copies.
|
||||
let _ = fs::remove_file(&out_path);
|
||||
fs::write(&out_path, result)
|
||||
.map_err(|e| format!("could not write to {}: {}", out_path.display(), e))?;
|
||||
|
@ -15,7 +15,7 @@ pub struct VersionInfo {
|
||||
pub version: &'static str,
|
||||
/// The release channel we were built for (stable/beta/nightly/dev).
|
||||
///
|
||||
/// `None` if not built via rustbuild.
|
||||
/// `None` if not built via bootstrap.
|
||||
pub release_channel: Option<&'static str>,
|
||||
/// Information about the Git repository we may have been built from.
|
||||
///
|
||||
|
@ -109,7 +109,7 @@ impl Combiner {
|
||||
.with_context(|| format!("failed to read components in '{}'", input_tarball))?;
|
||||
for component in pkg_components.split_whitespace() {
|
||||
// All we need to do is copy the component directory. We could
|
||||
// move it, but rustbuild wants to reuse the unpacked package
|
||||
// move it, but bootstrap wants to reuse the unpacked package
|
||||
// dir for OS-specific installers on macOS and Windows.
|
||||
let component_dir = package_dir.join(component);
|
||||
create_dir(&component_dir)?;
|
||||
|
@ -974,7 +974,7 @@ combined_remains() {
|
||||
--package-name=rust \
|
||||
--input-tarballs="$OUT_DIR/rustc.tar.gz,$OUT_DIR/cargo.tar.gz,$OUT_DIR/rust-docs.tar.gz"
|
||||
for component in rustc cargo rust-docs; do
|
||||
# rustbuild wants the original extracted package intact too
|
||||
# bootstrap wants the original extracted package intact too
|
||||
try test -d "$WORK_DIR/$component/$component"
|
||||
try test -d "$WORK_DIR/rust/$component"
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user