diff --git a/config.toml.example b/config.toml.example index a20e6e8f0218a..3f5101ebf342f 100644 --- a/config.toml.example +++ b/config.toml.example @@ -283,7 +283,10 @@ #codegen-tests = true # Flag indicating whether git info will be retrieved from .git automatically. -#ignore-git = false +# Having the git information can cause a lot of rebuilds during development. +# Note: If this attribute is not explicity set (e.g. if left commented out) it +# will default to true if channel = "dev", but will default to false otherwise. +#ignore-git = true # When creating source tarballs whether or not to create a source tarball. #dist-src = false diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 2c25f374e12a4..372e0906cc61e 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -401,6 +401,7 @@ impl Config { let mut debuginfo = None; let mut debug_assertions = None; let mut optimize = None; + let mut ignore_git = None; if let Some(ref llvm) = toml.llvm { match llvm.ccache { @@ -432,6 +433,7 @@ impl Config { debuginfo_lines = rust.debuginfo_lines; debuginfo_only_std = rust.debuginfo_only_std; optimize = rust.optimize; + ignore_git = rust.ignore_git; debug_jemalloc = rust.debug_jemalloc; set(&mut config.rust_optimize_tests, rust.optimize_tests); set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests); @@ -440,7 +442,6 @@ impl Config { set(&mut config.use_jemalloc, rust.use_jemalloc); set(&mut config.backtrace, rust.backtrace); set(&mut config.channel, rust.channel.clone()); - set(&mut config.ignore_git, rust.ignore_git); set(&mut config.rust_dist_src, rust.dist_src); set(&mut config.quiet_tests, rust.quiet_tests); config.rustc_default_linker = rust.default_linker.clone(); @@ -516,6 +517,9 @@ impl Config { config.rust_debug_assertions = debug_assertions.unwrap_or(default); config.rust_optimize = optimize.unwrap_or(!default); + let default = config.channel == "dev"; + config.ignore_git = ignore_git.unwrap_or(default); + config } diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 0e11635c3a0b1..fa8b761336068 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -247,11 +247,17 @@ def set(key, value): arr = arr[part] for key in known_args: - # The `set` option is special and an be passed a bunch of times + # The `set` option is special and can be passed a bunch of times if key == 'set': for option, value in known_args[key]: keyval = value.split('=', 1) - set(keyval[0], True if len(keyval) == 1 else keyval[1]) + if len(keyval) == 1 or keyval[1] == "true": + value = True + elif keyval[1] == "false": + value = False + else: + value = keyval[1] + set(keyval[0], value) continue # Ensure each option is only passed once diff --git a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile index 786f59eb9f761..f16dd9809981e 100644 --- a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile +++ b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile @@ -18,6 +18,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh -ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu +ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --set rust.ignore-git=false ENV SCRIPT python2.7 ../x.py test distcheck ENV DIST_SRC 1