Skip to content

Commit dc25fbe

Browse files
committed
Auto merge of rust-lang#112176 - jyn514:ci-debugging, r=clubby789
Print the full arguments passed to `./configure` in CI This is useful to replicate CI failures locally. Before, the arguments would be truncated and it would be hard to tell what it was actually doing. Before: ``` configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--save-t ... ``` After: ``` configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--save-toolstates=/tmp/toolstate/toolstates.json', '--enable-verbose', '--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', '--disable-dist-src', '--set', 'rust.download-rustc=if-unchanged', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'llvm.download-ci-llvm=if-available', '--enable-missing-tools'] ```
2 parents e04e19d + 42a9898 commit dc25fbe

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/bootstrap/configure.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def v(*args):
4545
o("llvm-link-shared", "llvm.link-shared", "prefer shared linking to LLVM (llvm-config --link-shared)")
4646
o("rpath", "rust.rpath", "build rpaths into rustc itself")
4747
o("codegen-tests", "rust.codegen-tests", "run the tests/codegen tests")
48-
o("option-checking", None, "complain about unrecognized options in this configure script")
4948
o("ninja", "llvm.ninja", "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)")
5049
o("locked-deps", "build.locked-deps", "force Cargo.lock to be up to date")
5150
o("vendor", "build.vendor", "enable usage of vendored Rust crates")
@@ -170,6 +169,9 @@ def v(*args):
170169
v("host", None, "List of GNUs ./configure syntax LLVM host triples")
171170
v("target", None, "List of GNUs ./configure syntax LLVM target triples")
172171

172+
# Options specific to this configure script
173+
o("option-checking", None, "complain about unrecognized options in this configure script")
174+
o("verbose-configure", None, "don't truncate options when printing them in this configure script")
173175
v("set", None, "set arbitrary key/value pairs in TOML configuration")
174176

175177

@@ -211,6 +213,8 @@ def is_value_list(key):
211213
print('be passed with `--disable-foo` to forcibly disable the option')
212214
sys.exit(0)
213215

216+
VERBOSE = False
217+
214218
# Parse all command line arguments into one of these three lists, handling
215219
# boolean and value-based options separately
216220
def parse_args(args):
@@ -271,6 +275,9 @@ def parse_args(args):
271275
if len(need_value_args) > 0:
272276
err("Option '{0}' needs a value ({0}=val)".format(need_value_args[0]))
273277

278+
global VERBOSE
279+
VERBOSE = 'verbose-configure' in known_args
280+
274281
config = {}
275282

276283
set('build.configure-args', sys.argv[1:], config)
@@ -290,7 +297,7 @@ def set(key, value, config):
290297
value = [v for v in value if v]
291298

292299
s = "{:20} := {}".format(key, value)
293-
if len(s) < 70:
300+
if len(s) < 70 or VERBOSE:
294301
p(s)
295302
else:
296303
p(s[:70] + " ...")
@@ -371,7 +378,7 @@ def apply_args(known_args, option_checking, config):
371378
set('rust.lld', True, config)
372379
set('rust.llvm-tools', True, config)
373380
set('build.extended', True, config)
374-
elif option.name == 'option-checking':
381+
elif option.name in ['option-checking', 'verbose-configure']:
375382
# this was handled above
376383
pass
377384
elif option.name == 'dist-compression-formats':

src/ci/run.sh

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch
5353
HAS_METRICS=1
5454
fi
5555

56+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-verbose-configure"
5657
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache"
5758
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-manage-submodules"
5859
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-locked-deps"

0 commit comments

Comments
 (0)