diff options
| author | bors <bors@rust-lang.org> | 2023-06-04 16:41:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-04 16:41:37 +0000 |
| commit | dc25fbe9844f4c8bddc316685d270a49d7b159b9 (patch) | |
| tree | 16d8bd582299b7029f82e9b5649eb541d7715b00 | |
| parent | e04e19d2229a48f5b4cb68e832121f9cadbb2fa3 (diff) | |
| parent | 42a9898fd1a6a5302b3b5b0661c8d08532594087 (diff) | |
Auto merge of #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'] ```
| -rwxr-xr-x | src/bootstrap/configure.py | 13 | ||||
| -rwxr-xr-x | src/ci/run.sh | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 571062a3a6f..4481e1668b6 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -45,7 +45,6 @@ o("llvm-static-stdcpp", "llvm.static-libstdcpp", "statically link to libstdc++ f o("llvm-link-shared", "llvm.link-shared", "prefer shared linking to LLVM (llvm-config --link-shared)") o("rpath", "rust.rpath", "build rpaths into rustc itself") o("codegen-tests", "rust.codegen-tests", "run the tests/codegen tests") -o("option-checking", None, "complain about unrecognized options in this configure script") o("ninja", "llvm.ninja", "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)") o("locked-deps", "build.locked-deps", "force Cargo.lock to be up to date") o("vendor", "build.vendor", "enable usage of vendored Rust crates") @@ -170,6 +169,9 @@ v("build", "build.build", "GNUs ./configure syntax LLVM build triple") v("host", None, "List of GNUs ./configure syntax LLVM host triples") v("target", None, "List of GNUs ./configure syntax LLVM target triples") +# Options specific to this configure script +o("option-checking", None, "complain about unrecognized options in this configure script") +o("verbose-configure", None, "don't truncate options when printing them in this configure script") v("set", None, "set arbitrary key/value pairs in TOML configuration") @@ -211,6 +213,8 @@ if '--help' in sys.argv or '-h' in sys.argv: print('be passed with `--disable-foo` to forcibly disable the option') sys.exit(0) +VERBOSE = False + # Parse all command line arguments into one of these three lists, handling # boolean and value-based options separately def parse_args(args): @@ -271,6 +275,9 @@ def parse_args(args): if len(need_value_args) > 0: err("Option '{0}' needs a value ({0}=val)".format(need_value_args[0])) + global VERBOSE + VERBOSE = 'verbose-configure' in known_args + config = {} set('build.configure-args', sys.argv[1:], config) @@ -290,7 +297,7 @@ def set(key, value, config): value = [v for v in value if v] s = "{:20} := {}".format(key, value) - if len(s) < 70: + if len(s) < 70 or VERBOSE: p(s) else: p(s[:70] + " ...") @@ -371,7 +378,7 @@ def apply_args(known_args, option_checking, config): set('rust.lld', True, config) set('rust.llvm-tools', True, config) set('build.extended', True, config) - elif option.name == 'option-checking': + elif option.name in ['option-checking', 'verbose-configure']: # this was handled above pass elif option.name == 'dist-compression-formats': diff --git a/src/ci/run.sh b/src/ci/run.sh index 966af3abc6f..5363086f68b 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -53,6 +53,7 @@ if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch HAS_METRICS=1 fi +RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-verbose-configure" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-manage-submodules" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-locked-deps" |
