aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/buildfile
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-11-29 15:50:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-12-01 18:24:34 +0300
commitadb93716f41a3325f6d590cbfe6ecc8fa27d637e (patch)
treef57f83c58e1c33188f258fbf7dd77aa5f075c5e3 /libbuild2/buildfile
parente7e558bd258e42c8092f8e229ef6ee140dbdc3c7 (diff)
Don't save test configuration variables to ~build2 configuration
Also stop saving blank lines between groups of options.
Diffstat (limited to 'libbuild2/buildfile')
-rw-r--r--libbuild2/buildfile25
1 files changed, 14 insertions, 11 deletions
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index f21be7b..ee320e4 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -62,28 +62,31 @@ config/cxx{host-config}: config/in{host-config}
# For ~build2 we want to keep everything except dist.
#
# We also remove comment lines which could be confused with preprocessor
- # directives by some lesser compilers.
+ # directives by some lesser compilers and blank lines between groups of
+ # options which could cause spurious rebuilds when we filter out entire
+ # groups.
#
# For ~build2 also filter out config.install.chroot -- we definitely don't
- # want it carried through.
+ # want it carried through. Also filter out variables that control tests
+ # execution.
#
# Finally, for both ~host and ~build2 we keep config.config.environment
# but strip config.config.hermetic* (we shouldn't be forcing hermiticity
# on the users of ~host/~build2; they can decide for themselves if they
# want it).
#
- build2_config = $regex.replace_lines( \
- $config.save(), \
- '^ *(#|(config\.(dist\.|install\.chroot|config\.hermetic))).*$', \
- [null], \
+ build2_config = $regex.replace_lines( \
+ $config.save(), \
+ '^( *(#|(config\.(test[. ]|dist\.|install\.chroot|config\.hermetic))).*|)$', \
+ [null], \
return_lines)
- # Also preserve config.version and blank lines between groups of options.
+ # Also preserve config.version.
#
- host_config = $regex.replace_lines( \
- $build2_config, \
- '^( *config\.(c[. ]|cxx[. ]|cc[.]|bin[.]|config.environment |version ).*|)$', \
- '$&', \
+ host_config = $regex.replace_lines( \
+ $build2_config, \
+ '^ *config\.(c[. ]|cxx[. ]|cc[.]|bin[.]|config.environment |version ).*$', \
+ '$&', \
format_no_copy return_lines)
}