# Use different pre-set defaults than the global defaults.
#
# See `src/bootstrap/defaults` for more information.
# Note that this has no default value (x.py uses the defaults in `config.example.toml`).
profile = 'dist'

[llvm]

# Indicates whether LLVM should be built with ThinLTO. Note that this will
# only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++
# toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below).
# More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap
thin-lto = true

# When true, link libstdc++ statically into the rustc_llvm.
# This is useful if you don't want to use the dynamic version of that
# library provided by LLVM.
static-libstdcpp = true

# Enable LLVM to use zstd for compression.
libzstd = true

# Whether to use Ninja to build LLVM. This runs much faster than make.
ninja = false

# Whether to build LLVM as a dynamically linked library (as opposed to statically linked).
# Under the hood, this passes `--shared` to llvm-config.
# NOTE: To avoid performing LTO multiple times, we suggest setting this to `true` when `thin-lto` is enabled.
link-shared = true

[build]

# Build triple for the pre-compiled snapshot compiler. If `rustc` is set, this must match its host
# triple (see `rustc --version --verbose`; cross-compiling the rust build system itself is NOT
# supported). If `rustc` is unset, this must be a platform with pre-compiled host tools
# (https://doc.rust-lang.org/nightly/rustc/platform-support.html). The current platform must be
# able to run binaries of this build triple.
#
# If `rustc` is present in path, this defaults to the host it was compiled for.
# Otherwise, `x.py` will try to infer it from the output of `uname`.
# If `uname` is not found in PATH, we assume this is `x86_64-pc-windows-msvc`.
# This may be changed in the future.
build = 'aarch64-unknown-linux-gnu'

# Indicate whether to build compiler documentation by default.
# You can still build documentation when this is disabled by explicitly passing a path: `x doc compiler`.
compiler-docs = true

# Indicate whether git submodules are managed and updated automatically.
submodules = false

# Force Cargo to check that Cargo.lock describes the precise dependency
# set that all the Cargo.toml files create, instead of updating it.
locked-deps = true

# Enable a build of the extended Rust tool set which is not only the compiler
# but also tools such as Cargo. This will also produce "combined installers"
# which are used to install Rust and Cargo together.
# The `tools` (check `config.example.toml` to see its default value) option specifies
# which tools should be built if `extended = true`.
#
# This is disabled by default.
extended = true

# Build the sanitizer runtimes
sanitizers = true

# Build the profiler runtime (required when compiling with options that depend
# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`).
profiler = true

# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics.
# Requires the LLVM submodule to be managed by bootstrap (i.e. not external) so that `compiler-rt`
# sources are available.
#
# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
# order to run `x check`.
optimized-compiler-builtins = true

# Indicates whether the native libraries linked into Cargo will be statically
# linked or not.
cargo-native-static = true

# Arguments passed to the `./configure` script, used during distcheck. You
# probably won't fill this in but rather it's filled in by the `./configure`
# script. Useful for debugging.
configure-args = ['--build=aarch64-unknown-linux-gnu', '--enable-full-tools', '--enable-profiler', '--enable-sanitizers', '--enable-compiler-docs', '--set', 'target.aarch64-unknown-linux-gnu.linker=clang', '--set', 'target.aarch64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar', '--set', 'target.aarch64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib', '--set', 'llvm.link-shared=true', '--set', 'llvm.thin-lto=true', '--set', 'llvm.libzstd=true', '--set', 'llvm.ninja=false', '--set', 'rust.debug-assertions=false', '--set', 'rust.jemalloc', '--set', 'rust.use-lld=true', '--set', 'rust.lto=thin', '--set', 'rust.codegen-units=1', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=stable', '--enable-llvm-static-stdcpp', '--set', 'rust.remap-debuginfo', '--debuginfo-level-std=1', '--set', 'rust.codegen-backends=llvm,cranelift']

# Print out how long each bootstrap step took (mostly intended for CI and
# tracking over time)
print-step-timings = true

# Collect information and statistics about the current build, and write it to
# disk. Enabling this has no impact on the resulting build output. The
# schema of the file generated by the build metrics feature is unstable, and
# this is not intended to be used during local development.
metrics = true

# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).
# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use
# a specific version.
ccache = 'sccache'

[install]

[rust]

# Number of codegen units to use for each compiler invocation. A value of 0
# means "the number of cores on this machine", and 1+ is passed through to the
# compiler.
#
# Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
codegen-units = 1

# Sets the number of codegen units to build the standard library with,
# regardless of what the codegen-unit setting for the rest of the compiler is.
# NOTE: building with anything other than 1 is known to occasionally have bugs.
codegen-units-std = 1

# Whether or not debug assertions are enabled for the compiler and standard library.
# These can help find bugs at the cost of a small runtime slowdown.
#
# Defaults to rust.debug value
debug-assertions = false

# Debuginfo level for the standard library.
debuginfo-level-std = 1

# The "channel" for the Rust build to produce. The stable/beta channels only
# allow using stable features, whereas the nightly and dev channels allow using
# nightly features
#
# If using tarball sources, default value for `channel` is taken from the `src/ci/channel` file;
# otherwise, it's "dev".
channel = 'stable'

# Prints each test name as it is executed, to help debug issues in the test harness itself.
verbose-tests = true

# Whether to create a source tarball by default when running `x dist`.
#
# You can still build a source tarball when this is disabled by explicitly passing `x dist rustc-src`.
dist-src = false

# This is an array of the codegen backends that will be compiled for the rustc
# that's being compiled. The default is to only build the LLVM codegen backend,
# and currently the only standard options supported are `"llvm"`, `"cranelift"`
# and `"gcc"`. The first backend in this list will be used as default by rustc
# when no explicit backend is specified.
codegen-backends = ['llvm', 'cranelift']

# Indicates whether LLD will be compiled and made available in the sysroot for rustc to execute, and
# whether to set it as rustc's default linker on `x86_64-unknown-linux-gnu`. This will also only be
# when *not* building an external LLVM (so only when using `download-ci-llvm` or building LLVM from
# the in-tree source): setting `llvm-config` in the `[target.x86_64-unknown-linux-gnu]` section will
# make this default to false.
lld = true

# Indicates whether LLD will be used to link Rust crates during bootstrap on
# supported platforms.
# If set to `true` or `"external"`, a global `lld` binary that has to be in $PATH
# will be used.
# If set to `"self-contained"`, rust-lld from the snapshot compiler will be used.
#
# On MSVC, LLD will not be used if we're cross linking.
#
# Explicitly setting the linker for a target will override this option when targeting MSVC.
use-lld = true

# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
# sysroot.
llvm-tools = true

# Indicates whether the `self-contained` llvm-bitcode-linker, will be made available
# in the sysroot. It is required for running nvptx tests.
llvm-bitcode-linker = true

# Map debuginfo paths to `/rust/$sha/...`.
# Useful for reproducible builds. Generally only set for releases
remap-debuginfo = true

# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
# This option is only tested on Linux and OSX.
jemalloc = true

# Select LTO mode that will be used for compiling rustc. By default, thin local LTO
# (LTO within a single crate) is used (like for any Rust crate). You can also select
# "thin" or "fat" to apply Thin/Fat LTO to the `rustc_driver` dylib, or "off" to disable
# LTO entirely.
lto = 'thin'

[target.aarch64-unknown-linux-gnu]

# Archiver to be used to assemble static libraries compiled from C/C++ code.
# Note: an absolute path should be used, otherwise LLVM build will break.
ar = '/rustroot/bin/llvm-ar'

# Ranlib to be used to assemble static libraries compiled from C/C++ code.
# Note: an absolute path should be used, otherwise LLVM build will break.
ranlib = '/rustroot/bin/llvm-ranlib'

# Linker to be used to bootstrap Rust code. Note that the
# default value is platform specific, and if not specified it may also depend on
# what platform is crossing to what platform.
# Setting this will override the `use-lld` option for Rust code when targeting MSVC.
linker = 'clang'

[dist]

# List of compression formats to use when generating dist tarballs. The list of
# formats is provided to rust-installer, which must support all of them.
#
# This list must be non-empty.
compression-formats = ['xz']

# How much time should be spent compressing the tarballs. The better the
# compression profile, the longer compression will take.
#
# Available options: fast, balanced, best
compression-profile = 'balanced'

