From 7c56f862788811c68686c96e74c16d2b3f90107d34aded28b9fda6200c3cfcb6 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 11 Jan 2023 14:53:34 +0000 Subject: [PATCH 1/4] Accepting request 1057809 from home:eeich:branches:network:cluster - Fix var_path: this regression was introduced with the update to the 0.19.0 release (boo#1207053). - Move repos to /usr/share/spack: /var is strictly for local data. OBS-URL: https://build.opensuse.org/request/show/1057809 OBS-URL: https://build.opensuse.org/package/show/network:cluster/spack?expand=0&rev=54 --- ...ths-compliant-to-distro-installation.patch | 29 ++++++++++--------- spack.changes | 7 +++++ spack.spec | 13 ++++----- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Make-spack-paths-compliant-to-distro-installation.patch b/Make-spack-paths-compliant-to-distro-installation.patch index 81fc2f3..ca53956 100644 --- a/Make-spack-paths-compliant-to-distro-installation.patch +++ b/Make-spack-paths-compliant-to-distro-installation.patch @@ -1,7 +1,9 @@ -From e7bbc251529786e68297c8aac700358ab1fb5c14 Mon Sep 17 00:00:00 2001 From: Egbert Eich -Date: Wed, 10 Nov 2021 09:40:07 +0100 -Subject: [PATCH] Make spack paths compliant to distro installation +Date: Wed Jan 11 14:30:19 2023 +0100 +Subject: Make spack paths compliant to distro installation +Patch-mainline: Not yet +Git-commit: c74fb7ed42aa94609c8cc8c005b004357307bb34 +References: Spack is particular about the choice of 'prefix' which will replace $spack. 'prefix' is the 4th ancestor of paths.py, so @@ -9,15 +11,15 @@ it is relative to the spack installation. This will only change the coded setups of var_path -> /var/lib/spack opt_path -> /opt/spack +repo_path -> /usr/share/spack/repos Signed-off-by: Egbert Eich Signed-off-by: Egbert Eich --- - lib/spack/spack/paths.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - + lib/spack/spack/paths.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/paths.py b/lib/spack/spack/paths.py -index fc617342e8..c733da2286 100644 +index f03f6eb1..914aea93 100644 --- a/lib/spack/spack/paths.py +++ b/lib/spack/spack/paths.py @@ -41,7 +41,7 @@ @@ -29,15 +31,16 @@ index fc617342e8..c733da2286 100644 share_path = os.path.join(prefix, "share", "spack") etc_path = os.path.join(prefix, "etc", "spack") -@@ -53,7 +53,7 @@ +@@ -53,10 +53,10 @@ # # Things in $spack/var/spack # -var_path = os.path.join(prefix, "var", "spack") -+var_path = os.path.join("/", "var", "spack") ++var_path = os.path.join("/", "var", "lib", "spack") # read-only things in $spack/var/spack - repos_path = os.path.join(var_path, "repos") --- -2.35.3 - +-repos_path = os.path.join(var_path, "repos") ++repos_path = os.path.join(share_path, "repos") + packages_path = os.path.join(repos_path, "builtin") + mock_packages_path = os.path.join(repos_path, "builtin.mock") + diff --git a/spack.changes b/spack.changes index 09ab9d6..f2da53b 100644 --- a/spack.changes +++ b/spack.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 11 13:04:37 UTC 2023 - Egbert Eich + +- Fix var_path: this regression was introduced with the update + to the 0.19.0 release (boo#1207053). +- Move repos to /usr/share/spack: /var is strictly for local data. + ------------------------------------------------------------------- Tue Nov 22 11:16:26 UTC 2022 - Christian Goll diff --git a/spack.spec b/spack.spec index 1f530e3..1e6a8b3 100644 --- a/spack.spec +++ b/spack.spec @@ -1,7 +1,7 @@ # # spec file for package spack # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -256,9 +256,6 @@ find . -type f -name .gitlab-ci.yml -delete # Fix _spack_root link rm -f lib/spack/docs/_spack_root ln -sf ../.. lib/spack/docs/_spack_root -# Do not ship Docker and container building for now - needs fixing -rm -rf share/spack/{templates/container} -rm -rf share/spack/docker/{centos,ubuntu}*.dockerfile # Do not ship AWS specifics rm -f share/spack/setup-tutorial-env.sh # Fix rpmlint warnings @@ -288,6 +285,8 @@ cp -r etc %{buildroot}%{_prefix} cp -r lib/spack/{env,external,llnl,spack,spack_installable} %{buildroot}%{spack_dir} cp -r share/spack/* %{buildroot}%{_datarootdir}/spack cp -r var/spack/* %{buildroot}%{_localstatedir}/lib/spack +# No repos in /var +mv %{buildroot}%{_localstatedir}/lib/spack/repos %{buildroot}%{_datarootdir}/spack cp -r bin/sbang %{buildroot}/%{_bindir} cp -r bin/spack* %{buildroot}%{_bindir}/ cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/ @@ -407,7 +406,7 @@ rm -f %{buildroot}%{_localstatedir}/lib/spack/cache ln -sf %{_localstatedir}/cache/spack %{buildroot}%{_localstatedir}/lib/spack/cache # Remove problematic binaries which are removed upstream with # 0889be20e0d9dcdf4346cdeaa0647285187375f3 -rm -r %{buildroot}%{_localstatedir}/lib/spack/repos/builtin/packages/patchelf/test/ +rm -r %{buildroot}%{_datarootdir}/spack/repos/builtin/packages/patchelf/test/ echo "g %{name} -" > system-group-%{name}.conf %sysusers_generate_pre system-group-%{name}.conf %{name} system-group-%{name}.conf @@ -477,6 +476,7 @@ chmod 0775 /opt/spack %{_localstatedir}/cache/spack %{_localstatedir}/lib/spack %{_datarootdir}/spack +%exclude %{_datarootdir}/spack/repos %config %{_sysconfdir}/profile.d/spack.sh %ghost %config %{_sysconfdir}/spack/packages.yaml %config %{_sysconfdir}/profile.d/spack.csh @@ -485,12 +485,11 @@ chmod 0775 /opt/spack %config %{_sysconfdir}/skel/.spack/modules.yaml # repos directory is installed in -recipes %{_sysusersdir}/system-group-%{name}.conf -%exclude %{_localstatedir}/lib/spack/repos %files recipes %license COPYRIGHT LICENSE-APACHE LICENSE-MIT %doc CHANGELOG.md NOTICE README.md -%{_localstatedir}/lib/spack/repos +%{_datarootdir}/spack/repos %else From 7bbbed556d74fc6d30790c064c8fc4c670df40d48e5ccc5976ea3f076f39355b Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 11 Jan 2023 21:36:28 +0000 Subject: [PATCH 2/4] Accepting request 1057863 from home:eeich:branches:network:cluster - Fix other issues when moving /var/spack/repos to /usr/share/spack OBS-URL: https://build.opensuse.org/request/show/1057863 OBS-URL: https://build.opensuse.org/package/show/network:cluster/spack?expand=0&rev=55 --- spack.spec | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/spack.spec b/spack.spec index 1e6a8b3..960a1c7 100644 --- a/spack.spec +++ b/spack.spec @@ -167,15 +167,6 @@ done %else cp %{S:5} lib/spack/docs/ %endif -grep -rl '#! /usr/bin/env bash' . | xargs -i@ sed -i 's|#! /usr/bin/env bash|#!/usr/bin/bash|g' @ -grep -rl '#!/bin/env sh' . | xargs -i@ sed -i 's|#!/bin/env sh|#!/usr/bin/sh|g' @ -grep -rl '#!/usr/bin/env bash' . | xargs -i@ sed -i 's|#!/usr/bin/env bash|#!/usr/bin/bash|g' @ -grep -rl "spack/" . | xargs -i@ sed -i \ - -e 's|$spack/opt|/opt|g' \ - -e 's|$spack/var|/var/lib|g'\ - -e 's|$spack/share/spack/lmod|/opt/spack/modules|g'\ - -e 's|$spack/share/spack/modules|/opt/spack/modules|g'\ - @ %build # Nothing to build @@ -236,6 +227,18 @@ make man info || { cat /tmp/sphinx-err-*.log; exit 1; } #text dirhtml rm -rf $tmpdir gzip _build/texinfo/Spack.info _build/man/spack.1 %endif +cd - +grep -rl '#! /usr/bin/env bash' . | xargs -i@ sed -i 's|#! /usr/bin/env bash|#!/usr/bin/bash|g' @ +grep -rl '#!/bin/env sh' . | xargs -i@ sed -i 's|#!/bin/env sh|#!/usr/bin/sh|g' @ +grep -rl '#!/usr/bin/env bash' . | xargs -i@ sed -i 's|#!/usr/bin/env bash|#!/usr/bin/bash|g' @ +grep -rl "spack/" . | xargs -i@ sed -i \ + -e 's|$spack/opt|/opt|g' \ + -e 's|$spack/var|/var/lib|g'\ + -e 's|$spack/share/spack/lmod|/opt/spack/modules|g'\ + -e 's|$spack/share/spack/modules|/opt/spack/modules|g'\ + @ +grep -rl '/var/spack/repos' | grep -v "cmd/list.py" | \ + xargs -i@ sed -i 's|/var/spack/repos|/usr/share/spack/repos|g' @ %install # combine READMEs From 8a571f87383410a95f700a7e6ab4fe8396d39bd4c13cba2532793cd2f4df9988 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 11 Jan 2023 23:27:26 +0000 Subject: [PATCH 3/4] Accepting request 1057874 from home:eeich:branches:network:cluster - Some more fixes to make the switch from /var/lib/spack/repo to /usr/share/spack/repo work. OBS-URL: https://build.opensuse.org/request/show/1057874 OBS-URL: https://build.opensuse.org/package/show/network:cluster/spack?expand=0&rev=56 --- spack.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spack.spec b/spack.spec index 960a1c7..c037ee9 100644 --- a/spack.spec +++ b/spack.spec @@ -231,14 +231,15 @@ cd - grep -rl '#! /usr/bin/env bash' . | xargs -i@ sed -i 's|#! /usr/bin/env bash|#!/usr/bin/bash|g' @ grep -rl '#!/bin/env sh' . | xargs -i@ sed -i 's|#!/bin/env sh|#!/usr/bin/sh|g' @ grep -rl '#!/usr/bin/env bash' . | xargs -i@ sed -i 's|#!/usr/bin/env bash|#!/usr/bin/bash|g' @ +grep -rl '/var/spack/repos' | grep -v "cmd/list.py" | \ + xargs -i@ sed -i 's|/var/spack/repos|/usr/share/spack/repos|g' @ grep -rl "spack/" . | xargs -i@ sed -i \ -e 's|$spack/opt|/opt|g' \ -e 's|$spack/var|/var/lib|g'\ + -e 's|$spack/usr|/usr|g'\ -e 's|$spack/share/spack/lmod|/opt/spack/modules|g'\ -e 's|$spack/share/spack/modules|/opt/spack/modules|g'\ @ -grep -rl '/var/spack/repos' | grep -v "cmd/list.py" | \ - xargs -i@ sed -i 's|/var/spack/repos|/usr/share/spack/repos|g' @ %install # combine READMEs From e664b92828ef438723a131afad80778d41bd8bac835b5d5edd3f25f41e2e8217 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Thu, 12 Jan 2023 11:55:47 +0000 Subject: [PATCH 4/4] Accepting request 1057973 from home:eeich:branches:network:cluster - Yet another fix for /var/spack/repos -> /usr/share/spack/repos move. OBS-URL: https://build.opensuse.org/request/show/1057973 OBS-URL: https://build.opensuse.org/package/show/network:cluster/spack?expand=0&rev=57 --- spack.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spack.spec b/spack.spec index c037ee9..50ad8af 100644 --- a/spack.spec +++ b/spack.spec @@ -202,6 +202,8 @@ sed -i 's/\(^SPHINXOPTS\).*/\1 = --keep-going /' Makefile grep -rl ":target:" | xargs sed -i -e "/:target:/s/^/#/" -e "/figure::/s/^/#/" # Fix path to var - we install this to the 'real' /var grep -rl "\$SPACK_ROOT/var" | xargs sed -i -e "s@\(.*\)\$SPACK_ROOT/var\(/spack.*\)@\1/var/lib\2@g" +grep -rl '/var/lib/spack/repos' | grep -v "cmd/list.py" | \ + xargs -i@ sed -i 's|/var/lib/spack/repos|/usr/share/spack/repos|g' @ # spack cannot run without knowing at least the compiler, so we inject # a dummy one mkdir -p ${HOME}/.spack/linux/ @@ -226,6 +228,7 @@ source /usr/share/spack/setup-env.sh make man info || { cat /tmp/sphinx-err-*.log; exit 1; } #text dirhtml rm -rf $tmpdir gzip _build/texinfo/Spack.info _build/man/spack.1 +# with doc %endif cd - grep -rl '#! /usr/bin/env bash' . | xargs -i@ sed -i 's|#! /usr/bin/env bash|#!/usr/bin/bash|g' @