Commit a9b0a7ba authored by Alex Crichton's avatar Alex Crichton

rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
parent 398aaffc
......@@ -73,6 +73,10 @@
# controlled by rustbuild's -j parameter.
#link-jobs = 0
# When invoking `llvm-config` this configures whether the `--shared` argument is
# passed to prefer linking to shared libraries.
#link-shared = false
# =============================================================================
# General build configuration options
# =============================================================================
......@@ -166,6 +170,15 @@
# to +10 on Unix platforms, and by using a "low priority" job object on Windows.
#low-priority = false
# 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.
#configure-args = []
# Indicates that a local rebuild is ocurring instead of a full bootstrap,
# essentially skipping stage0 as the local compiler is recompiling itself again.
#local-rebuild = false
# =============================================================================
# General install configuration options
# =============================================================================
......@@ -195,6 +208,13 @@
# =============================================================================
[rust]
# Indicates that the build should be optimized for debugging Rust. Note that
# this is typically not what you want as it takes an incredibly large amount of
# time to have a debug-mode rustc compile any code (notably libstd). If this
# value is set to `true` it will affect a number of configuration options below
# as well, if unconfigured.
#debug = false
# Whether or not to optimize the compiler and standard library
# Note: the slowness of the non optimized compiler compiling itself usually
# outweighs the time gains in not doing optimizations, therefore a
......@@ -249,6 +269,10 @@
# desired in distributions, for example.
#rpath = true
# Suppresses extraneous output from tests to ensure the output of the test
# harness is relatively clean.
#quiet-tests = false
# Flag indicating whether tests are compiled with optimizations (the -O flag) or
# with debuginfo (the -g flag)
#optimize-tests = true
......@@ -261,6 +285,9 @@
# Flag indicating whether git info will be retrieved from .git automatically.
#ignore-git = false
# When creating source tarballs whether or not to create a source tarball.
#dist-src = false
# =============================================================================
# Options for specific targets
#
......@@ -304,6 +331,10 @@
# linked binaries
#musl-root = "..."
# Used in testing for configuring where the QEMU images are located, you
# probably don't want to use this.
#qemu-rootfs = "..."
# =============================================================================
# Distribution options
#
......
This diff is collapsed.
......@@ -76,10 +76,9 @@ The script accepts commands, flags, and arguments to determine what to do:
There are currently two methods for configuring the rustbuild build system.
First, rustbuild offers a TOML-based configuration system with a `config.toml`
file in the same location as `config.mk`. An example of this configuration can
be found at `config.toml.example`, and the configuration file can also be passed
as `--config path/to/config.toml` if the build system is being invoked manually
(via the python script).
file. An example of this configuration can be found at `config.toml.example`,
and the configuration file can also be passed as `--config path/to/config.toml`
if the build system is being invoked manually (via the python script).
Next, the `./configure` options serialized in `config.mk` will be
parsed and read. That is, if any `./configure` options are passed, they'll be
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -822,6 +822,7 @@ impl Step for PlainSourceTarball {
"RELEASES.md",
"configure",
"x.py",
"config.toml.example",
];
let src_dirs = [
"man",
......
......@@ -8,8 +8,6 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
include config.mk
ifdef VERBOSE
Q :=
BOOTSTRAP_ARGS := -v
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment