From c3b27d5a710a053a71bcee7e3a2a2c646eeef2af Mon Sep 17 00:00:00 2001 From: JeremySorensen Date: Tue, 15 Aug 2017 18:26:29 -0700 Subject: [PATCH 1/8] make ignore-git true by default when channel is dev --- config.toml.example | 5 ++++- src/bootstrap/config.rs | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config.toml.example b/config.toml.example index 962be2e608501..bae36ed925fe4 100644 --- a/config.toml.example +++ b/config.toml.example @@ -259,7 +259,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. it left commented out) it +# will default to true if channel = "dev", but will default to false otherwise. +#ignore-git = true # ============================================================================= # Options for specific targets diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index aa688fc66e267..f284bafd2d67e 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -296,7 +296,7 @@ impl Config { config.rust_codegen_units = 1; config.channel = "dev".to_string(); config.codegen_tests = true; - config.ignore_git = false; + config.ignore_git = true; config.rust_dist_src = true; config.on_fail = flags.on_fail; @@ -419,7 +419,12 @@ impl Config { set(&mut config.use_jemalloc, rust.use_jemalloc); set(&mut config.backtrace, rust.backtrace); set(&mut config.channel, rust.channel.clone()); + + // on the dev channel, ignore_git should be true by default + // on other channels it should be false by default + config.ignore_git = config.channel == "dev"; set(&mut config.ignore_git, rust.ignore_git); + config.rustc_default_linker = rust.default_linker.clone(); config.rustc_default_ar = rust.default_ar.clone(); config.musl_root = rust.musl_root.clone().map(PathBuf::from); From 5e472c20aabbb5bee5f50bb18e33cd9d71e76a75 Mon Sep 17 00:00:00 2001 From: JeremySorensen Date: Thu, 17 Aug 2017 07:26:57 -0700 Subject: [PATCH 2/8] fix typo in git-ignore comment --- config.toml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml.example b/config.toml.example index bae36ed925fe4..48d27fa58caa1 100644 --- a/config.toml.example +++ b/config.toml.example @@ -260,7 +260,7 @@ # Flag indicating whether git info will be retrieved from .git automatically. # Having the git information can cause a lot of rebuilds during development. -# Note: If this attribute is not explicity set (e.g. it left commented out) it +# 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 From bdb7901ec9e5784942b62a682de2e2f1a2c58e79 Mon Sep 17 00:00:00 2001 From: JeremySorensen Date: Thu, 17 Aug 2017 07:37:04 -0700 Subject: [PATCH 3/8] initialize ignore-git to false --- src/bootstrap/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index f284bafd2d67e..5975c88c560c4 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -296,7 +296,7 @@ impl Config { config.rust_codegen_units = 1; config.channel = "dev".to_string(); config.codegen_tests = true; - config.ignore_git = true; + config.ignore_git = false; config.rust_dist_src = true; config.on_fail = flags.on_fail; From 5009a222e0597902731470544288fc01fa6d7038 Mon Sep 17 00:00:00 2001 From: Jeremy Sorensen Date: Mon, 28 Aug 2017 20:44:40 -0700 Subject: [PATCH 4/8] use an optional bool to keep track of ignore-git setting, if not specified by the end, use the channel to determine its value --- src/bootstrap/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 } From 68aab69af313e9f9fd2c755a93ec557e062bf33e Mon Sep 17 00:00:00 2001 From: Jeremy Sorensen Date: Tue, 29 Aug 2017 08:27:30 -0700 Subject: [PATCH 5/8] add ignore-git=true option to RUST_CONFIGURE_ARGS --- src/ci/docker/x86_64-gnu-distcheck/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile index 786f59eb9f761..497aeb65107b6 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 build.ignore-git=true ENV SCRIPT python2.7 ../x.py test distcheck ENV DIST_SRC 1 From d24ee2380f0a50748c8e463325b7d03c027de6cb Mon Sep 17 00:00:00 2001 From: Jeremy Sorensen Date: Tue, 29 Aug 2017 09:39:12 -0700 Subject: [PATCH 6/8] change option for RUST_CONFIGURE_ARGS to ignore-git=false --- src/ci/docker/x86_64-gnu-distcheck/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile index 497aeb65107b6..7a4582e2057d4 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 --set build.ignore-git=true +ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --set build.ignore-git=false ENV SCRIPT python2.7 ../x.py test distcheck ENV DIST_SRC 1 From 873a05e85c124f34f086d67d6f993aa846a1b4e7 Mon Sep 17 00:00:00 2001 From: Jeremy Sorensen Date: Tue, 29 Aug 2017 21:57:48 -0700 Subject: [PATCH 7/8] allow value of key/value pair argument to set option be boolean --- src/bootstrap/configure.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 From 4f591a47d5c165785a8715f39fc6474c4e33a57f Mon Sep 17 00:00:00 2001 From: Jeremy Sorensen Date: Tue, 29 Aug 2017 22:01:51 -0700 Subject: [PATCH 8/8] fix option for RUST_CONFIGURE_ARGS to be rust.ignore-git=false --- src/ci/docker/x86_64-gnu-distcheck/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile index 7a4582e2057d4..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 --set build.ignore-git=false +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