summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2022-11-23 12:29:17 -0800
committerGitHub <noreply@github.com>2022-11-23 12:29:17 -0800
commit0182603609f289ec43baa95b9e98998cbf268d04 (patch)
tree6fb1d453cb631a786d0e986dbdc1202c97c8ee9b /etc
parentbf1b846f26ec249c947f0cd258afd8f248f64700 (diff)
downloadspack-0182603609f289ec43baa95b9e98998cbf268d04.tar.gz
spack-0182603609f289ec43baa95b9e98998cbf268d04.tar.bz2
spack-0182603609f289ec43baa95b9e98998cbf268d04.tar.xz
spack-0182603609f289ec43baa95b9e98998cbf268d04.zip
Control Werror by converting to Wno-error (#30882)
Using `-Werror` is good practice for development and testing, but causes us a great deal of heartburn supporting multiple compiler versions, especially as newer compiler versions add warnings for released packages. This PR adds support for suppressing `-Werror` through spack's compiler wrappers. There are currently three modes for the `flags:keep_werror` setting: * `none`: (default) cancel all `-Werror`, `-Werror=*` and `-Werror-*` flags by converting them to `-Wno-error[=]*` flags * `specific`: preserve explicitly selected warnings as errors, such as `-Werror=format-truncation`, but reverse the blanket `-Werror` * `all`: keeps all `-Werror` flags These can be set globally in config.yaml, through the config command-line flags, or overridden by a particular package (some packages use Werror as a proxy for determining support for other compiler features). We chose to use this approach because: 1. removing `-Werror` flags entirely broke *many* build systems, especially autoconf based ones, because of things like checking `-Werror=feature` and making the assumption that if that did not error other flags related to that feature would also work 2. Attempting to preserve `-Werror` in some phases but not others caused similar issues 3. The per-package setting came about because some packages, even with all these protections, still use `-Werror` unsafely. Currently there are roughly 3 such packages known.
Diffstat (limited to 'etc')
-rw-r--r--etc/spack/defaults/config.yaml7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml
index b3356428fe..0bf52a0e55 100644
--- a/etc/spack/defaults/config.yaml
+++ b/etc/spack/defaults/config.yaml
@@ -214,4 +214,9 @@ config:
# Number of seconds a buildcache's index.json is cached locally before probing
# for updates, within a single Spack invocation. Defaults to 10 minutes.
- binary_index_ttl: 600 \ No newline at end of file
+ binary_index_ttl: 600
+
+ flags:
+ # Whether to keep -Werror flags active in package builds.
+ keep_werror: 'none'
+