summaryrefslogtreecommitdiff
path: root/lib/spack/docs/build_systems
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-09-28 00:38:14 +0200
committerGitHub <noreply@github.com>2021-09-27 18:38:14 -0400
commit87450f3688d5d4799bb08526f82061ab4b9cb944 (patch)
tree48e8cfdd4021028bf1800148ba1b80678f33c479 /lib/spack/docs/build_systems
parentc0da0d83ff0f377dc622503127bc1f4c686ac52c (diff)
downloadspack-87450f3688d5d4799bb08526f82061ab4b9cb944.tar.gz
spack-87450f3688d5d4799bb08526f82061ab4b9cb944.tar.bz2
spack-87450f3688d5d4799bb08526f82061ab4b9cb944.tar.xz
spack-87450f3688d5d4799bb08526f82061ab4b9cb944.zip
Use gnuconfig package for config file replacement (#26035)
* Use gnuconfig package for config file replacement Currently the autotools build system tries to pick up config.sub and config.guess files from the system (in /usr/share) on arm and power. This is introduces an implicit system dependency which we can avoid by distributing config.guess and config.sub files in a separate package, such as the new `gnuconfig` package which is very lightweight/text only (unlike automake where we previously pulled these files from as a backup). This PR adds `gnuconfig` as an unconditional build dependency for arm and power archs. In case the user needs a system version of config.sub and config.guess, they are free to mark `gnuconfig` as an external package with the prefix pointing to the directory containing the config files: ```yaml gnuconfig: externals: - spec: gnuconfig@master prefix: /tmp/tmp.ooBlkyAKdw/lol buildable: false ``` Apart from that, this PR gives some better instructions for users when replacing config files goes wrong. * Mock needs this package too now, because autotools adds a depends_on * Add documentation * Make patch_config_files a prop, fix the docs, add integrations tests * Make macOS happy
Diffstat (limited to 'lib/spack/docs/build_systems')
-rw-r--r--lib/spack/docs/build_systems/autotoolspackage.rst51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/spack/docs/build_systems/autotoolspackage.rst b/lib/spack/docs/build_systems/autotoolspackage.rst
index 0cb87a58eb..71d8d7d866 100644
--- a/lib/spack/docs/build_systems/autotoolspackage.rst
+++ b/lib/spack/docs/build_systems/autotoolspackage.rst
@@ -159,6 +159,57 @@ create a new patch that directly modifies ``configure``. That way,
Spack can use the secondary patch and additional build system
dependencies aren't necessary.
+""""""""""""""""""""""""""""
+Old Autotools helper scripts
+""""""""""""""""""""""""""""
+
+Autotools based tarballs come with helper scripts such as ``config.sub`` and
+``config.guess``. It is the responsibility of the developers to keep these files
+up to date so that they run on every platform, but for very old software
+releases this is impossible. In these cases Spack can help to replace these
+files with newer ones, without having to add the heavy dependency on
+``automake``.
+
+Automatic helper script replacement is currently enabled by default on
+``ppc64le`` and ``aarch64``, as these are the known cases where old scripts fail.
+On these targets, ``AutotoolsPackage`` adds a build dependency on ``gnuconfig``,
+which is a very light-weight package with newer versions of the helper files.
+Spack then tries to run all the helper scripts it can find in the release, and
+replaces them on failure with the helper scripts from ``gnuconfig``.
+
+To opt out of this feature, use the following setting:
+
+.. code-block:: python
+
+ patch_config_files = False
+
+To enable it conditionally on different architectures, define a property and
+make the package depend on ``gnuconfig`` as a build dependency:
+
+.. code-block
+
+ depends_on('gnuconfig', when='@1.0:')
+
+ @property
+ def patch_config_files(self):
+ return self.spec.satisfies("@1.0:")
+
+.. note::
+
+ On some exotic architectures it is necessary to use system provided
+ ``config.sub`` and ``config.guess`` files. In this case, the most
+ transparent solution is to mark the ``gnuconfig`` package as external and
+ non-buildable, with a prefix set to the directory containing the files:
+
+ .. code-block:: yaml
+
+ gnuconfig:
+ buildable: false
+ externals:
+ - spec: gnuconfig@master
+ prefix: /usr/share/configure_files/
+
+
""""""""""""""""
force_autoreconf
""""""""""""""""