Accepting request 1057974 from network:cluster

- Yet another fix for /var/spack/repos -> /usr/share/spack/repos
  move. (forwarded request 1057973 from eeich)

OBS-URL: https://build.opensuse.org/request/show/1057974
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/spack?expand=0&rev=26
This commit is contained in:
Dominique Leuenberger 2023-01-12 21:44:47 +00:00 committed by Git OBS Bridge
commit 112084556a
3 changed files with 45 additions and 29 deletions

View File

@ -1,7 +1,9 @@
From e7bbc251529786e68297c8aac700358ab1fb5c14 Mon Sep 17 00:00:00 2001
From: Egbert Eich <eich@suse.com> From: Egbert Eich <eich@suse.com>
Date: Wed, 10 Nov 2021 09:40:07 +0100 Date: Wed Jan 11 14:30:19 2023 +0100
Subject: [PATCH] Make spack paths compliant to distro installation 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 Spack is particular about the choice of 'prefix' which will
replace $spack. 'prefix' is the 4th ancestor of paths.py, so 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 This will only change the coded setups of
var_path -> /var/lib/spack var_path -> /var/lib/spack
opt_path -> /opt/spack opt_path -> /opt/spack
repo_path -> /usr/share/spack/repos
Signed-off-by: Egbert Eich <eich@suse.com> Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de> Signed-off-by: Egbert Eich <eich@suse.de>
--- ---
lib/spack/spack/paths.py | 4 ++-- lib/spack/spack/paths.py | 6 +++---
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/spack/spack/paths.py b/lib/spack/spack/paths.py 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 --- a/lib/spack/spack/paths.py
+++ b/lib/spack/spack/paths.py +++ b/lib/spack/spack/paths.py
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
@ -29,15 +31,16 @@ index fc617342e8..c733da2286 100644
share_path = os.path.join(prefix, "share", "spack") share_path = os.path.join(prefix, "share", "spack")
etc_path = os.path.join(prefix, "etc", "spack") etc_path = os.path.join(prefix, "etc", "spack")
@@ -53,7 +53,7 @@ @@ -53,10 +53,10 @@
# #
# Things in $spack/var/spack # Things in $spack/var/spack
# #
-var_path = os.path.join(prefix, "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 # read-only things in $spack/var/spack
repos_path = os.path.join(var_path, "repos") -repos_path = os.path.join(var_path, "repos")
-- +repos_path = os.path.join(share_path, "repos")
2.35.3 packages_path = os.path.join(repos_path, "builtin")
mock_packages_path = os.path.join(repos_path, "builtin.mock")

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jan 11 13:04:37 UTC 2023 - Egbert Eich <eich@suse.com>
- 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 <cgoll@suse.com> Tue Nov 22 11:16:26 UTC 2022 - Christian Goll <cgoll@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package spack # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -167,15 +167,6 @@ done
%else %else
cp %{S:5} lib/spack/docs/ cp %{S:5} lib/spack/docs/
%endif %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 %build
# Nothing to build # Nothing to build
@ -211,6 +202,8 @@ sed -i 's/\(^SPHINXOPTS\).*/\1 = --keep-going /' Makefile
grep -rl ":target:" | xargs sed -i -e "/:target:/s/^/#/" -e "/figure::/s/^/#/" grep -rl ":target:" | xargs sed -i -e "/:target:/s/^/#/" -e "/figure::/s/^/#/"
# Fix path to var - we install this to the 'real' /var # 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 "\$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 # spack cannot run without knowing at least the compiler, so we inject
# a dummy one # a dummy one
mkdir -p ${HOME}/.spack/linux/ mkdir -p ${HOME}/.spack/linux/
@ -235,7 +228,21 @@ source /usr/share/spack/setup-env.sh
make man info || { cat /tmp/sphinx-err-*.log; exit 1; } #text dirhtml make man info || { cat /tmp/sphinx-err-*.log; exit 1; } #text dirhtml
rm -rf $tmpdir rm -rf $tmpdir
gzip _build/texinfo/Spack.info _build/man/spack.1 gzip _build/texinfo/Spack.info _build/man/spack.1
# with doc
%endif %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 '/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'\
@
%install %install
# combine READMEs # combine READMEs
@ -256,9 +263,6 @@ find . -type f -name .gitlab-ci.yml -delete
# Fix _spack_root link # Fix _spack_root link
rm -f lib/spack/docs/_spack_root rm -f lib/spack/docs/_spack_root
ln -sf ../.. 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 # Do not ship AWS specifics
rm -f share/spack/setup-tutorial-env.sh rm -f share/spack/setup-tutorial-env.sh
# Fix rpmlint warnings # Fix rpmlint warnings
@ -288,6 +292,8 @@ cp -r etc %{buildroot}%{_prefix}
cp -r lib/spack/{env,external,llnl,spack,spack_installable} %{buildroot}%{spack_dir} cp -r lib/spack/{env,external,llnl,spack,spack_installable} %{buildroot}%{spack_dir}
cp -r share/spack/* %{buildroot}%{_datarootdir}/spack cp -r share/spack/* %{buildroot}%{_datarootdir}/spack
cp -r var/spack/* %{buildroot}%{_localstatedir}/lib/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/sbang %{buildroot}/%{_bindir}
cp -r bin/spack* %{buildroot}%{_bindir}/ cp -r bin/spack* %{buildroot}%{_bindir}/
cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/ cp etc/spack/defaults/config.yaml %{buildroot}%{_sysconfdir}/skel/.spack/
@ -407,7 +413,7 @@ rm -f %{buildroot}%{_localstatedir}/lib/spack/cache
ln -sf %{_localstatedir}/cache/spack %{buildroot}%{_localstatedir}/lib/spack/cache ln -sf %{_localstatedir}/cache/spack %{buildroot}%{_localstatedir}/lib/spack/cache
# Remove problematic binaries which are removed upstream with # Remove problematic binaries which are removed upstream with
# 0889be20e0d9dcdf4346cdeaa0647285187375f3 # 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 echo "g %{name} -" > system-group-%{name}.conf
%sysusers_generate_pre system-group-%{name}.conf %{name} system-group-%{name}.conf %sysusers_generate_pre system-group-%{name}.conf %{name} system-group-%{name}.conf
@ -477,6 +483,7 @@ chmod 0775 /opt/spack
%{_localstatedir}/cache/spack %{_localstatedir}/cache/spack
%{_localstatedir}/lib/spack %{_localstatedir}/lib/spack
%{_datarootdir}/spack %{_datarootdir}/spack
%exclude %{_datarootdir}/spack/repos
%config %{_sysconfdir}/profile.d/spack.sh %config %{_sysconfdir}/profile.d/spack.sh
%ghost %config %{_sysconfdir}/spack/packages.yaml %ghost %config %{_sysconfdir}/spack/packages.yaml
%config %{_sysconfdir}/profile.d/spack.csh %config %{_sysconfdir}/profile.d/spack.csh
@ -485,12 +492,11 @@ chmod 0775 /opt/spack
%config %{_sysconfdir}/skel/.spack/modules.yaml %config %{_sysconfdir}/skel/.spack/modules.yaml
# repos directory is installed in -recipes # repos directory is installed in -recipes
%{_sysusersdir}/system-group-%{name}.conf %{_sysusersdir}/system-group-%{name}.conf
%exclude %{_localstatedir}/lib/spack/repos
%files recipes %files recipes
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT %license COPYRIGHT LICENSE-APACHE LICENSE-MIT
%doc CHANGELOG.md NOTICE README.md %doc CHANGELOG.md NOTICE README.md
%{_localstatedir}/lib/spack/repos %{_datarootdir}/spack/repos
%else %else