Skip to content

Commit a9b0a7b

Browse files
committed
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
1 parent 398aaff commit a9b0a7b

File tree

8 files changed

+653
-1217
lines changed

8 files changed

+653
-1217
lines changed

config.toml.example

+31
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
# controlled by rustbuild's -j parameter.
7474
#link-jobs = 0
7575

76+
# When invoking `llvm-config` this configures whether the `--shared` argument is
77+
# passed to prefer linking to shared libraries.
78+
#link-shared = false
79+
7680
# =============================================================================
7781
# General build configuration options
7882
# =============================================================================
@@ -166,6 +170,15 @@
166170
# to +10 on Unix platforms, and by using a "low priority" job object on Windows.
167171
#low-priority = false
168172

173+
# Arguments passed to the `./configure` script, used during distcheck. You
174+
# probably won't fill this in but rather it's filled in by the `./configure`
175+
# script.
176+
#configure-args = []
177+
178+
# Indicates that a local rebuild is ocurring instead of a full bootstrap,
179+
# essentially skipping stage0 as the local compiler is recompiling itself again.
180+
#local-rebuild = false
181+
169182
# =============================================================================
170183
# General install configuration options
171184
# =============================================================================
@@ -195,6 +208,13 @@
195208
# =============================================================================
196209
[rust]
197210

211+
# Indicates that the build should be optimized for debugging Rust. Note that
212+
# this is typically not what you want as it takes an incredibly large amount of
213+
# time to have a debug-mode rustc compile any code (notably libstd). If this
214+
# value is set to `true` it will affect a number of configuration options below
215+
# as well, if unconfigured.
216+
#debug = false
217+
198218
# Whether or not to optimize the compiler and standard library
199219
# Note: the slowness of the non optimized compiler compiling itself usually
200220
# outweighs the time gains in not doing optimizations, therefore a
@@ -249,6 +269,10 @@
249269
# desired in distributions, for example.
250270
#rpath = true
251271

272+
# Suppresses extraneous output from tests to ensure the output of the test
273+
# harness is relatively clean.
274+
#quiet-tests = false
275+
252276
# Flag indicating whether tests are compiled with optimizations (the -O flag) or
253277
# with debuginfo (the -g flag)
254278
#optimize-tests = true
@@ -261,6 +285,9 @@
261285
# Flag indicating whether git info will be retrieved from .git automatically.
262286
#ignore-git = false
263287

288+
# When creating source tarballs whether or not to create a source tarball.
289+
#dist-src = false
290+
264291
# =============================================================================
265292
# Options for specific targets
266293
#
@@ -304,6 +331,10 @@
304331
# linked binaries
305332
#musl-root = "..."
306333

334+
# Used in testing for configuring where the QEMU images are located, you
335+
# probably don't want to use this.
336+
#qemu-rootfs = "..."
337+
307338
# =============================================================================
308339
# Distribution options
309340
#

0 commit comments

Comments
 (0)