Skip to content

Commit 51a54b6

Browse files
committed
Auto merge of #43895 - JeremySorensen:master, r=alexcrichton
make ignore-git true by default when channel is dev Fixes #43771 (Handle git info in rustbuild differently)
2 parents ca9cf35 + 4f591a4 commit 51a54b6

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

config.toml.example

+4-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,10 @@
283283
#codegen-tests = true
284284

285285
# Flag indicating whether git info will be retrieved from .git automatically.
286-
#ignore-git = false
286+
# Having the git information can cause a lot of rebuilds during development.
287+
# Note: If this attribute is not explicity set (e.g. if left commented out) it
288+
# will default to true if channel = "dev", but will default to false otherwise.
289+
#ignore-git = true
287290

288291
# When creating source tarballs whether or not to create a source tarball.
289292
#dist-src = false

src/bootstrap/config.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ impl Config {
401401
let mut debuginfo = None;
402402
let mut debug_assertions = None;
403403
let mut optimize = None;
404+
let mut ignore_git = None;
404405

405406
if let Some(ref llvm) = toml.llvm {
406407
match llvm.ccache {
@@ -432,6 +433,7 @@ impl Config {
432433
debuginfo_lines = rust.debuginfo_lines;
433434
debuginfo_only_std = rust.debuginfo_only_std;
434435
optimize = rust.optimize;
436+
ignore_git = rust.ignore_git;
435437
debug_jemalloc = rust.debug_jemalloc;
436438
set(&mut config.rust_optimize_tests, rust.optimize_tests);
437439
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
@@ -440,7 +442,6 @@ impl Config {
440442
set(&mut config.use_jemalloc, rust.use_jemalloc);
441443
set(&mut config.backtrace, rust.backtrace);
442444
set(&mut config.channel, rust.channel.clone());
443-
set(&mut config.ignore_git, rust.ignore_git);
444445
set(&mut config.rust_dist_src, rust.dist_src);
445446
set(&mut config.quiet_tests, rust.quiet_tests);
446447
config.rustc_default_linker = rust.default_linker.clone();
@@ -516,6 +517,9 @@ impl Config {
516517
config.rust_debug_assertions = debug_assertions.unwrap_or(default);
517518
config.rust_optimize = optimize.unwrap_or(!default);
518519

520+
let default = config.channel == "dev";
521+
config.ignore_git = ignore_git.unwrap_or(default);
522+
519523
config
520524
}
521525

src/bootstrap/configure.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,17 @@ def set(key, value):
247247
arr = arr[part]
248248

249249
for key in known_args:
250-
# The `set` option is special and an be passed a bunch of times
250+
# The `set` option is special and can be passed a bunch of times
251251
if key == 'set':
252252
for option, value in known_args[key]:
253253
keyval = value.split('=', 1)
254-
set(keyval[0], True if len(keyval) == 1 else keyval[1])
254+
if len(keyval) == 1 or keyval[1] == "true":
255+
value = True
256+
elif keyval[1] == "false":
257+
value = False
258+
else:
259+
value = keyval[1]
260+
set(keyval[0], value)
255261
continue
256262

257263
# Ensure each option is only passed once

src/ci/docker/x86_64-gnu-distcheck/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1818
COPY scripts/sccache.sh /scripts/
1919
RUN sh /scripts/sccache.sh
2020

21-
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
21+
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --set rust.ignore-git=false
2222
ENV SCRIPT python2.7 ../x.py test distcheck
2323
ENV DIST_SRC 1

0 commit comments

Comments
 (0)