From d769f1a808fc291674f656ea12cc54b55ddcdc03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 18 Nov 2021 14:35:53 +0100 Subject: [PATCH 01/22] merge latest upstream changes --- bootstrap-prefix.sh | 125 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 27 deletions(-) mode change 100755 => 100644 bootstrap-prefix.sh diff --git a/bootstrap-prefix.sh b/bootstrap-prefix.sh old mode 100755 new mode 100644 index d7204e6a..9a6aaa04 --- a/bootstrap-prefix.sh +++ b/bootstrap-prefix.sh @@ -105,7 +105,7 @@ efetch() { configure_cflags() { export CPPFLAGS="-I${ROOT}/tmp/usr/include" - + case ${CHOST} in *-darwin*) export LDFLAGS="-Wl,-search_paths_first -L${ROOT}/tmp/usr/lib" @@ -203,9 +203,9 @@ configure_toolchain() { ;; *"Apple clang version "*|*"Apple LLVM version "*) # recent binutils-apple are hard to build (C++11 - # features, and cmake buildsystem) so avoid going + # features, and cmake build system) so avoid going # there, the system ld is good enough to bring us to - # stage3, after which system set will take care of + # stage3, after which the @system set will take care of # the rest linker=sys-devel/native-cctools ;; @@ -319,8 +319,15 @@ bootstrap_setup() { echo "CONFIG_SHELL=\"${ROOT}/bin/bash\"" echo "DISTDIR=\"${DISTDIR:-${ROOT}/var/cache/distfiles}\"" if is-rap ; then - echo "# sandbox does not work well on Prefix, bug 490246" + echo "# sandbox does not work well on Prefix, bug #490246" echo 'FEATURES="${FEATURES} -usersandbox -sandbox"' + # bug #759424 + [[ -n ${STABLE_PREFIX} ]] && \ + echo 'ACCEPT_KEYWORDS="${ARCH} -~${ARCH}"' + else + echo "# last mirror is for Prefix specific distfiles, you" + echo "# might experience fetch failures if you remove it" + echo "GENTOO_MIRRORS=\"${GENTOO_MIRRORS} ${DISTFILES_PFX}\"" fi if [[ ${FS_INSENSITIVE} == 1 ]] ; then echo @@ -337,10 +344,24 @@ bootstrap_setup() { fi if is-rap ; then - [[ -f ${ROOT}/etc/passwd ]] || getent passwd > "${ROOT}"/etc/passwd || \ - ln -sf {,"${ROOT}"}/etc/passwd - [[ -f ${ROOT}/etc/group ]] || getent group > "${ROOT}"/etc/group || \ - ln -sf {,"${ROOT}"}/etc/group + if [[ ! -f ${ROOT}/etc/passwd ]]; then + if grep -q $(id -un) /etc/passwd; then + ln -sf {,"${ROOT}"}/etc/passwd + else + getent passwd > "${ROOT}"/etc/passwd + # add user if it's not in /etc/passwd, bug #766417 + getent passwd $(id -un) >> "${ROOT}"/etc/passwd + fi + fi + if [[ ! -f ${ROOT}/etc/group ]]; then + if grep -q $(id -gn) /etc/group; then + ln -sf {,"${ROOT}"}/etc/group + else + getent group > "${ROOT}"/etc/group + # add group if it's not in /etc/group, bug #766417 + getent group $(id -gn) >> "${ROOT}"/etc/group + fi + fi [[ -f ${ROOT}/etc/resolv.conf ]] || ln -s {,"${ROOT}"}/etc/resolv.conf [[ -f ${ROOT}/etc/hosts ]] || cp {,"${ROOT}"}/etc/hosts local profile_linux=default/linux/ARCH/17.0/prefix/$(profile-kernel) @@ -361,15 +382,31 @@ bootstrap_setup() { rev=${CHOST##*darwin} profile="prefix/darwin/macos/10.$((rev - 4))/x64" ;; - x86_64-apple-darwin2[0123456789]) + x86_64-apple-darwin20) # Big Sur is 11.0 rev=${CHOST##*darwin} profile="prefix/darwin/macos/11.$((rev - 20))/x64" ;; - arm64-apple-darwin2[0123456789]) + x86_64-apple-darwin2[123456789]) + # Monterey is 12.0 + rev=${CHOST##*darwin} + profile="prefix/darwin/macos/12.$((rev - 21))/x64" + ;; + arm64-apple-darwin20) rev=${CHOST##*darwin} profile="prefix/darwin/macos/11.$((rev - 20))/arm64" ;; + # TODO: Come up with something better for macOS 11+ + x86_64-apple-darwin2[123456789]) + # Monterey is 12.0 + rev=${CHOST##*darwin} + profile="prefix/darwin/macos/12.$((rev - 21))/x64" + ;; + arm64-apple-darwin2[123456789]) + # Monterey is 12.0 + rev=${CHOST##*darwin} + profile="prefix/darwin/macos/12.$((rev - 21))/arm64" + ;; i*86-pc-linux-gnu) profile=${profile_linux/ARCH/x86} ;; @@ -410,7 +447,7 @@ bootstrap_setup() { x86_64-pc-cygwin*) profile="prefix/windows/cygwin/x64" ;; - *) + *) eerror "UNKNOWN ARCH: You need to set up a make.profile symlink to a" eerror "profile in ${PORTDIR} for your CHOST ${CHOST}" exit 1 @@ -440,7 +477,7 @@ bootstrap_setup() { profile=${PROFILE_BASE:-prefix}/${profile#prefix/}${PROFILE_VARIANT:+/${PROFILE_VARIANT}} if [[ -n ${profile} && ! -e ${ROOT}/etc/portage/make.profile ]] ; then local fullprofile="${PORTDIR}/profiles/${profile}" - + ln -s "${fullprofile}" "${ROOT}"/etc/portage/make.profile einfo "Your profile is set to ${fullprofile}." fi @@ -540,7 +577,7 @@ do_tree() { bootstrap_tree() { # RAP uses the latest gentoo main repo snapshot to bootstrap. is-rap && LATEST_TREE_YES=1 - local PV="20210213" + local PV="20211105" if is-rap ; then do_tree "${CUSTOM_SNAPSHOT_URL:-$SNAPSHOT_URL}" portage-${CUSTOM_SNAPSHOT_VERSION:-latest}.tar.bz2 else @@ -607,12 +644,12 @@ bootstrap_portage() { # STABLE_PV that is known to work. Intended for power users only. ## It is critical that STABLE_PV is the lastest (non-masked) version that is ## included in the snapshot for bootstrap_tree. - STABLE_PV="3.0.12.0.2" - [[ ${TESTING_PV} == latest ]] && TESTING_PV="3.0.12.0.2" + STABLE_PV="3.0.21" + [[ ${TESTING_PV} == latest ]] && TESTING_PV="3.0.21" PV="${TESTING_PV:-${STABLE_PV}}" A=prefix-portage-${PV}.tar.bz2 einfo "Bootstrapping ${A%.tar.*}" - + efetch ${DISTFILES_URL}/${A} || return 1 einfo "Unpacking ${A%.tar.*}" @@ -661,7 +698,7 @@ bootstrap_portage() { cd "${ROOT}" rm -Rf ${ptmp} >& /dev/null - # Some people will skip the tree() step and hence var/log is not created + # Some people will skip the tree() step and hence var/log is not created # As such, portage complains.. mkdir -p "${ROOT}"/tmp/var/log @@ -942,9 +979,9 @@ bootstrap_gnu() { einfo "${A%.tar.*} successfully bootstrapped" } -PYTHONMAJMIN=3.8 # keep this number in line with PV below for stage1,2 +PYTHONMAJMIN=3.9 # keep this number in line with PV below for stage1,2 bootstrap_python() { - PV=3.8.6 + PV=3.9.6 A=Python-${PV}.tar.xz einfo "Bootstrapping ${A%.tar.*}" @@ -1010,8 +1047,8 @@ bootstrap_python() { -e 's/KQUEUE/KQUEUE_DISABLED/' \ configure # fixup thread id detection - efetch "http://dev.gentoo.org/~grobian/distfiles/python-3.8.6-darwin9.patch" - patch -p1 < "${DISTDIR}"/python-3.8.6-darwin9.patch + efetch "https://dev.gentoo.org/~sam/distfiles/dev-lang/python/python-3.9.6-darwin9_pthreadid.patch" + patch -p1 < "${DISTDIR}"/python-3.9.6-darwin9_pthreadid.patch ;; (arm64-*-darwin*) # Teach Python a new trick (arm64) @@ -1153,7 +1190,7 @@ bootstrap_cmake_core() { emake install || return 1 # we need sysroot crap to build cmake itself, but it makes trouble - # lateron, so kill it in the installed version + # later on, so kill it in the installed version ver=${A%-*} ; ver=${ver%.*} sed -i -e '/cmake_gnu_set_sysroot_flag/d' \ "${ROOT}"/tmp/usr/share/${ver}/Modules/Platform/Apple-GNU-*.cmake || die @@ -1365,7 +1402,7 @@ bootstrap_stage_host_gentoo() { einfo "are bootstrapping prefix-rpath. Do nothing." return 0 fi - + if [[ ! -L ${ROOT}/tmp ]] ; then if [[ -e ${ROOT}/tmp ]] ; then einfo "${ROOT}/tmp exists and is not a symlink to ${HOST_GENTOO_EROOT}" @@ -1602,6 +1639,7 @@ do_emerge_pkgs() { -python -qmanifest -qtegrity -readline + -sanitize bootstrap clang internal-glib @@ -2002,6 +2040,7 @@ bootstrap_stage3() { pkgs=( sys-apps/attr sys-libs/libcap + sys-libs/libxcrypt ) BOOTSTRAP_RAP=yes \ USE="${USE} -pam" \ @@ -2041,7 +2080,7 @@ bootstrap_stage3() { # in addition, avoid collisions rm -Rf "${ROOT}"/tmp/usr/lib/python${PYTHONMAJMIN}/site-packages/clang - # try to get ourself out of the mudd, bug #575324 + # try to get ourself out of the mud, bug #575324 EXTRA_ECONF="--disable-compiler-version-checks $(rapx '--disable-lto --disable-bootstrap')" \ GCC_MAKE_TARGET=$(rapx all) \ MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \ @@ -2129,10 +2168,10 @@ bootstrap_stage3() { # Avoid glib compiling for Cocoa libs if it finds them, since we're # still with an old llvm that may not understand the system headers # very well on Darwin (-DGNUSTEP_BASE_VERSION hack) - einfo "running emerge -u system" - estatus "stage3: emerge -u system" + einfo "running emerge -uDNav system" + estatus "stage3: emerge -uDNav system" CPPFLAGS="-DGNUSTEP_BASE_VERSION" \ - CFLAGS= CXXFLAGS= emerge --color n -u -v system || return 1 + CFLAGS= CXXFLAGS= emerge --color n -uDNav system || return 1 # remove anything that we don't need (compilers most likely) einfo "running emerge --depclean" @@ -2694,6 +2733,38 @@ EOF esac fi + # The experimental support for Stable Prefix. + # When expanding this to other CHOSTs, don't forget to update + # make.conf generation in bootstrap_setup(). + # TODO: Consider at some point removing the ~ARCH override from + # profiles/features/prefix/standalone/make.defaults. + # https://bugs.gentoo.org/759424 + if is-rap ; then + if [[ "${CHOST}" == x86_64-pc-linux-gnu ]]; then + cat < Date: Thu, 18 Nov 2021 14:36:11 +0100 Subject: [PATCH 02/22] add execute permissions --- bootstrap-prefix.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bootstrap-prefix.sh diff --git a/bootstrap-prefix.sh b/bootstrap-prefix.sh old mode 100644 new mode 100755 From 885c3f5b3cf6ba4c1f4fa3e0c0f5e74e4a46774e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 18 Nov 2021 16:10:18 +0100 Subject: [PATCH 03/22] bump version to 2021.12 --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index a5bd0895..696f6a6d 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -1,6 +1,6 @@ # Defaults file for the compatibility layer role. --- -eessi_version: "2021.06" +eessi_version: "2021.12" custom_overlays: - name: eessi From ece202175316971ad6b7ae3c6348490d025e3e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 18 Nov 2021 16:10:53 +0100 Subject: [PATCH 04/22] use newer snapshot --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 696f6a6d..ab88ad95 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -18,7 +18,7 @@ gentoo_prefix_path: /cvmfs/{{ cvmfs_repository }}/{{ eessi_version }}/compat/{{ # How to build the prefix prefix_required_space: 15 GB prefix_snapshot_url: https://eessi-gentoo-snapshot.s3-eu-west-1.amazonaws.com -prefix_snapshot_version: 20210607 +prefix_snapshot_version: 20211117 prefix_user_defined_trusted_dirs: - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib" prefix_singularity_command: "singularity run -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}" From abfbaa93d552e3babca00a0a39fdb4ed13d11524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Nov 2021 16:13:44 +0100 Subject: [PATCH 05/22] remove the -a from emerge system --- bootstrap-prefix.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap-prefix.sh b/bootstrap-prefix.sh index 9a6aaa04..0e0e58ea 100755 --- a/bootstrap-prefix.sh +++ b/bootstrap-prefix.sh @@ -2168,10 +2168,10 @@ bootstrap_stage3() { # Avoid glib compiling for Cocoa libs if it finds them, since we're # still with an old llvm that may not understand the system headers # very well on Darwin (-DGNUSTEP_BASE_VERSION hack) - einfo "running emerge -uDNav system" - estatus "stage3: emerge -uDNav system" + einfo "running emerge -uDNv system" + estatus "stage3: emerge -uDNv system" CPPFLAGS="-DGNUSTEP_BASE_VERSION" \ - CFLAGS= CXXFLAGS= emerge --color n -uDNav system || return 1 + CFLAGS= CXXFLAGS= emerge --color n -uDNv system || return 1 # remove anything that we don't need (compilers most likely) einfo "running emerge --depclean" From c76978276cbc3ad6583c77d42ada4f7d50127071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 12:08:00 +0100 Subject: [PATCH 06/22] add task step for copying custom bootstrap script --- .../compatibility_layer/tasks/install_prefix.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml index 531ee308..a96903e7 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml @@ -70,6 +70,17 @@ tags: - build_prefix +- name: debug + debug: + msg: "{{ prefix_custom_bootstrap_script.local }} {{ prefix_custom_bootstrap_script.remote }}" + +- name: "Copy custom bootstrap script" + copy: + src: "{{ prefix_custom_bootstrap_script.local }}" + dest: "{{ prefix_custom_bootstrap_script.remote }}" + mode: 0755 + when: not prefix_use_builtin_bootstrap + - name: "Install Gentoo prefix via {{ prefix_install }}" shell: set -o pipefail && ( {{ prefix_install }} | tee -a {{ prefix_build_log }} | grep -E '^(>>> Installing|\\* )' ) become: no From b1a449ef39d9f5a1531a319a9a8f0a5800fb4d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 12:08:14 +0100 Subject: [PATCH 07/22] add options for using a custom bootstrap script --- .../roles/compatibility_layer/defaults/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index ab88ad95..92c74ae2 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -21,14 +21,19 @@ prefix_snapshot_url: https://eessi-gentoo-snapshot.s3-eu-west-1.amazonaws.com prefix_snapshot_version: 20211117 prefix_user_defined_trusted_dirs: - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib" -prefix_singularity_command: "singularity run -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}" +prefix_use_builtin_bootstrap: no +prefix_custom_bootstrap_script: + local: "{{ playbook_dir }}/../../bootstrap-prefix.sh" + remote: /tmp/bootstrap-prefix.sh +prefix_bootstrap_script_path: "{{ prefix_use_builtin_bootstrap | ternary('/usr/local/bin/bootstrap-prefix.sh', prefix_custom_bootstrap_script.remote) }}" +prefix_singularity_command: "singularity exec -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}" prefix_source: "docker://ghcr.io/eessi/bootstrap-prefix:centos8" prefix_source_options: "{{ gentoo_prefix_path }} noninteractive" prefix_install: >- SINGULARITYENV_USE_CPU_CORES={{ ansible_processor_vcpus }} SINGULARITYENV_CUSTOM_SNAPSHOT_URL="{{ prefix_snapshot_url }}" SINGULARITYENV_CUSTOM_SNAPSHOT_VERSION="{{ prefix_snapshot_version }}" - {{ prefix_singularity_command }} {{ prefix_source }} {{ prefix_source_options }} + {{ prefix_singularity_command }} {{ prefix_source }} {{ prefix_bootstrap_script_path }} {{ prefix_source_options }} # Logging eessi_log_dir: "/tmp/eessi-logs" From 67df4bec37181735a5d94c5d894d21d3db61726b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 12:22:39 +0100 Subject: [PATCH 08/22] update README --- ansible/playbooks/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/README.md b/ansible/playbooks/README.md index 12ddd783..7c6c819e 100644 --- a/ansible/playbooks/README.md +++ b/ansible/playbooks/README.md @@ -42,8 +42,9 @@ Before running the playbook, make sure the following settings are correct, and o | prefix_required_space | Minimal amount of disk space that is required for the Gentoo Prefix bootstrap | | prefix_snapshot_url | Directory (served over http(s)) containing snapshot files | | prefix_snapshot_version | Date (`YYYYMMDD`) of the Portage snapshot file for the Prefix installation | -| prefix_python_targets | String consisting of [Gentoo Python targets](https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS) Python targets used for the Prefix installation | | prefix_user_defined_trusted_dirs | List of paths to the user defined trusted dirs for glibc | +| prefix_use_builtin_bootstrap | Use the container's built-in bootstrap script? | +| prefix_custom_bootstrap_script | Dictionary with the `local` source and `remote` destination of the bootstrap script | | prefix_singularity_command | Singularity command for launching the container with the bootstrap script | | prefix_source | Singularity container path used for the Prefix installtion | | prefix_source_options | Arguments to be passed to the Prefix bootstrap script | From f1026d6efd8c70990472c3b39d10715bb505c0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 12:24:19 +0100 Subject: [PATCH 09/22] remove debug step --- .../roles/compatibility_layer/tasks/install_prefix.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml index a96903e7..e5f64c44 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml @@ -70,10 +70,6 @@ tags: - build_prefix -- name: debug - debug: - msg: "{{ prefix_custom_bootstrap_script.local }} {{ prefix_custom_bootstrap_script.remote }}" - - name: "Copy custom bootstrap script" copy: src: "{{ prefix_custom_bootstrap_script.local }}" From 24641e1483f1a4dbb79857510760623a707b20f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 12:24:45 +0100 Subject: [PATCH 10/22] remove unnecessary variable --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 92c74ae2..79bfda6f 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -33,7 +33,9 @@ prefix_install: >- SINGULARITYENV_USE_CPU_CORES={{ ansible_processor_vcpus }} SINGULARITYENV_CUSTOM_SNAPSHOT_URL="{{ prefix_snapshot_url }}" SINGULARITYENV_CUSTOM_SNAPSHOT_VERSION="{{ prefix_snapshot_version }}" - {{ prefix_singularity_command }} {{ prefix_source }} {{ prefix_bootstrap_script_path }} {{ prefix_source_options }} + {{ prefix_singularity_command }} {{ prefix_source }} + {{ prefix_use_builtin_bootstrap | ternary('/usr/local/bin/bootstrap-prefix.sh', prefix_custom_bootstrap_script.remote) }} + {{ prefix_source_options }} # Logging eessi_log_dir: "/tmp/eessi-logs" From 821c24b1c3b17fd0130a0a2e543d242ca10be50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 12:25:04 +0100 Subject: [PATCH 11/22] remove unnecessary variable --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 79bfda6f..5a733496 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -25,7 +25,6 @@ prefix_use_builtin_bootstrap: no prefix_custom_bootstrap_script: local: "{{ playbook_dir }}/../../bootstrap-prefix.sh" remote: /tmp/bootstrap-prefix.sh -prefix_bootstrap_script_path: "{{ prefix_use_builtin_bootstrap | ternary('/usr/local/bin/bootstrap-prefix.sh', prefix_custom_bootstrap_script.remote) }}" prefix_singularity_command: "singularity exec -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}" prefix_source: "docker://ghcr.io/eessi/bootstrap-prefix:centos8" prefix_source_options: "{{ gentoo_prefix_path }} noninteractive" From 16511c0a67e96e88ccbb0c5dce2bee17896769b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 20 Nov 2021 16:33:34 +0100 Subject: [PATCH 12/22] add note about which bootstrap script can/will be used by the playbook --- ansible/playbooks/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/playbooks/README.md b/ansible/playbooks/README.md index 7c6c819e..badbc177 100644 --- a/ansible/playbooks/README.md +++ b/ansible/playbooks/README.md @@ -76,3 +76,7 @@ ip-or-hostname-of-your-stratum0 eessi_host_arch=x86_64 eessi_host_os=linux The `eessi_host_arch` corresponds to the architecture of the machine that executes the playbook and for which this compatibility layer has to be built, e.g. `x86_64`, `aarch64`, or `ppc64le`. Similarly, `eessi_host_os` should refer to the operating system of the machine, and should be set to either `linux` or `macos`. + +Note that, by default, the bootstrap script from the root directory of this git repository will be used, unless you set `prefix_use_builtin_bootstrap` to `yes` +(in which case the bootstrap script included in the Prefix build container will be used). +A different bootstrap script can be used by changing `prefix_custom_bootstrap_script.local` to a local path. From 1ee7f64d7d7a7b21131530fbb79931074e223340 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Sun, 21 Nov 2021 16:08:22 +0100 Subject: [PATCH 13/22] update portage snapshot to 20211120 to pick up fix for sys-libs/libcap (see https://bugs.gentoo.org/825374) and masked sys-devel/binutils-2.37_p1-r1 (https://bugs.gentoo.org/824482) --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 5a733496..4f96431e 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -18,7 +18,7 @@ gentoo_prefix_path: /cvmfs/{{ cvmfs_repository }}/{{ eessi_version }}/compat/{{ # How to build the prefix prefix_required_space: 15 GB prefix_snapshot_url: https://eessi-gentoo-snapshot.s3-eu-west-1.amazonaws.com -prefix_snapshot_version: 20211117 +prefix_snapshot_version: 20211120 prefix_user_defined_trusted_dirs: - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib" prefix_use_builtin_bootstrap: no From 7c87d658095bb1ec2dd58b656f42e75db6cd9a48 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Sun, 21 Nov 2021 22:36:58 +0100 Subject: [PATCH 14/22] disable 'stable mode' in Gentoo Prefix bootstrap script, since it's only used for x86_64 (cfr. #131) --- bootstrap-prefix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-prefix.sh b/bootstrap-prefix.sh index 0e0e58ea..1776e0a0 100755 --- a/bootstrap-prefix.sh +++ b/bootstrap-prefix.sh @@ -2751,7 +2751,7 @@ I can limit your Prefix to use only packages keyworded for stable amd64 by default. Of course, you can still enable testing ~amd64 for the packages you want, when the need arises. EOF - [[ ${TODO} == 'noninteractive' ]] && ans=yes || + [[ ${TODO} == 'noninteractive' ]] && ans=no || read -p " Do you want to use stable Prefix? [Yn] " ans case "${ans}" in [Yy][Ee][Ss]|[Yy]|"") From b94e4933e7a3a81649922b22d355a6f0b710a904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 23 Nov 2021 09:52:51 +0100 Subject: [PATCH 15/22] use equery to find out if user_defined_trusted_dirs was used --- .../tasks/set_glibc_trusted_dirs.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/set_glibc_trusted_dirs.yml b/ansible/playbooks/roles/compatibility_layer/tasks/set_glibc_trusted_dirs.yml index 0650d73d..0f1ab4f9 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/set_glibc_trusted_dirs.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/set_glibc_trusted_dirs.yml @@ -1,15 +1,12 @@ # Make sure that glibc is always compiled with a user-defined-trusted-dirs option --- -- name: Find all strings in libc library - command: "strings {{ gentoo_prefix_path }}/usr/lib64/libc.a" - register: libc_strings +- name: Check the EXTRA_EMAKE flags of glibc + command: "equery has --package glibc EXTRA_EMAKE" + changed_when: false + ignore_errors: yes + register: glibc_extra_emake when: eessi_host_os == "linux" -- name: Find user defined trusted dirs in libc strings output - set_fact: match='{{ libc_strings.stdout | regex_search("\n" + item + "/?\n") | default('', True) | string | length>0 }}' - with_items: "{{ prefix_user_defined_trusted_dirs }}" - register: trusted_dirs_in_libc - - name: (Re)install glibc with the user-defined-trusted-dirs option portage: package: sys-libs/glibc @@ -20,7 +17,7 @@ EXTRA_EMAKE: "user-defined-trusted-dirs={{ prefix_user_defined_trusted_dirs | join(':') }}" when: - eessi_host_os == "linux" - - trusted_dirs_in_libc.results | selectattr('ansible_facts.match', 'equalto', False) | list | length>0 + - glibc_extra_emake.stdout != "user-defined-trusted-dirs=" + ":".join(prefix_user_defined_trusted_dirs) - name: Create portage env directory file: From 46ee4c99e8d2b8410cd8611f5bf4da7a19754630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 25 Nov 2021 11:45:27 +0100 Subject: [PATCH 16/22] Add steps for creating a package.mask right before the bootstrap, change order of some steps, add tags --- .../tasks/install_prefix.yml | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml index e5f64c44..4e9be26e 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml @@ -61,6 +61,33 @@ tags: - build_prefix +- name: "Copy custom bootstrap script" + copy: + src: "{{ prefix_custom_bootstrap_script.local }}" + dest: "{{ prefix_custom_bootstrap_script.remote }}" + mode: 0755 + when: not prefix_use_builtin_bootstrap + tags: + - build_prefix + +- name: "Create $EPREFIX/etc/portage directory" + file: + path: "{{ gentoo_prefix_path }}/etc/portage" + state: directory + mode: 0755 + when: prefix_mask_packages is defined and prefix_mask_packages | length > 0 + tags: + - build_prefix + +- name: "Mask packages for the bootstrap" + copy: + dest: "{{ gentoo_prefix_path }}/etc/portage/package.mask" + content: "{{ prefix_mask_packages }}" + mode: 0644 + when: prefix_mask_packages is defined and prefix_mask_packages | length > 0 + tags: + - build_prefix + - name: "Give {{ username_on_host.stdout }} recursive user and group ownership of {{ gentoo_prefix_path }}" file: dest: "{{ gentoo_prefix_path }}" @@ -70,13 +97,6 @@ tags: - build_prefix -- name: "Copy custom bootstrap script" - copy: - src: "{{ prefix_custom_bootstrap_script.local }}" - dest: "{{ prefix_custom_bootstrap_script.remote }}" - mode: 0755 - when: not prefix_use_builtin_bootstrap - - name: "Install Gentoo prefix via {{ prefix_install }}" shell: set -o pipefail && ( {{ prefix_install }} | tee -a {{ prefix_build_log }} | grep -E '^(>>> Installing|\\* )' ) become: no @@ -88,8 +108,12 @@ stat: path: "{{ gentoo_prefix_path }}/startprefix" register: startprefix + tags: + - build_prefix - name: "Fail if startprefix script has not been created" fail: msg: "The resulting Gentoo Prefix installation does not have a startprefix script. Something went wrong!" when: not startprefix.stat.exists + tags: + - build_prefix From 2cbd6154e235f332bfbcb70dee25acfde8d217c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 25 Nov 2021 11:46:44 +0100 Subject: [PATCH 17/22] Add variable for setting a package.mask for the bootstrap --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 4f96431e..d6cb7df3 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -21,6 +21,9 @@ prefix_snapshot_url: https://eessi-gentoo-snapshot.s3-eu-west-1.amazonaws.com prefix_snapshot_version: 20211120 prefix_user_defined_trusted_dirs: - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib" +prefix_mask_packages: | + # Mask glibc >= 2.34, as it's causing issues with the bootstrap, and it's not compatible with CUDA 11. + >=sys-libs/glibc-2.34 prefix_use_builtin_bootstrap: no prefix_custom_bootstrap_script: local: "{{ playbook_dir }}/../../bootstrap-prefix.sh" From 42caa87d144f2fb42e0056f395068882540714f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 25 Nov 2021 11:50:42 +0100 Subject: [PATCH 18/22] remove tab on empty line --- .../roles/compatibility_layer/tasks/install_prefix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml index 4e9be26e..8bf3d77e 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/install_prefix.yml @@ -78,7 +78,7 @@ when: prefix_mask_packages is defined and prefix_mask_packages | length > 0 tags: - build_prefix - + - name: "Mask packages for the bootstrap" copy: dest: "{{ gentoo_prefix_path }}/etc/portage/package.mask" From e7597d4d57c70d74b4f53eda4a60593313a11c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 25 Nov 2021 11:54:57 +0100 Subject: [PATCH 19/22] add prefix_mask_packages to README --- ansible/playbooks/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/playbooks/README.md b/ansible/playbooks/README.md index badbc177..8a4a235e 100644 --- a/ansible/playbooks/README.md +++ b/ansible/playbooks/README.md @@ -43,6 +43,7 @@ Before running the playbook, make sure the following settings are correct, and o | prefix_snapshot_url | Directory (served over http(s)) containing snapshot files | | prefix_snapshot_version | Date (`YYYYMMDD`) of the Portage snapshot file for the Prefix installation | | prefix_user_defined_trusted_dirs | List of paths to the user defined trusted dirs for glibc | +| prefix_mask_packages | Contents of a [package.mask file](https://wiki.gentoo.org/wiki//etc/portage/package.mask) that should be used during the bootstrap | | prefix_use_builtin_bootstrap | Use the container's built-in bootstrap script? | | prefix_custom_bootstrap_script | Dictionary with the `local` source and `remote` destination of the bootstrap script | | prefix_singularity_command | Singularity command for launching the container with the bootstrap script | From a38c421b3ea0c80def555d46cd7727f460fe40dc Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 25 Nov 2021 18:52:11 +0100 Subject: [PATCH 20/22] also add dev-libs/libgcrypt to package.mask to work around compilation error on ppc64le during Prefix bootstrap --- .../playbooks/roles/compatibility_layer/defaults/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index d6cb7df3..28703077 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -22,8 +22,12 @@ prefix_snapshot_version: 20211120 prefix_user_defined_trusted_dirs: - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/lib" prefix_mask_packages: | - # Mask glibc >= 2.34, as it's causing issues with the bootstrap, and it's not compatible with CUDA 11. + # avoid glibc 2.34, as it's causing issues with the bootstrap, and it's not compatible with CUDA 11. + # see https://github.com/EESSI/compatibility-layer/issues/137 + https://bugs.gentoo.org/824482 >=sys-libs/glibc-2.34 + # avoid libgcrypt 1.9.4 due to compiler errros on ppc64le, + # see https://github.com/EESSI/compatibility-layer/issues/134 + https://bugs.gentoo.org/825722 + >=dev-libs/libgcrypt-1.9.4 prefix_use_builtin_bootstrap: no prefix_custom_bootstrap_script: local: "{{ playbook_dir }}/../../bootstrap-prefix.sh" From 20206a53999737241cac6821afb10ad49a60b3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 25 Nov 2021 19:41:12 +0100 Subject: [PATCH 21/22] only mask specific versions of glibc and libgcrypt --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 28703077..f699452c 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -24,10 +24,10 @@ prefix_user_defined_trusted_dirs: prefix_mask_packages: | # avoid glibc 2.34, as it's causing issues with the bootstrap, and it's not compatible with CUDA 11. # see https://github.com/EESSI/compatibility-layer/issues/137 + https://bugs.gentoo.org/824482 - >=sys-libs/glibc-2.34 + =sys-libs/glibc-2.34 # avoid libgcrypt 1.9.4 due to compiler errros on ppc64le, # see https://github.com/EESSI/compatibility-layer/issues/134 + https://bugs.gentoo.org/825722 - >=dev-libs/libgcrypt-1.9.4 + =dev-libs/libgcrypt-1.9.4 prefix_use_builtin_bootstrap: no prefix_custom_bootstrap_script: local: "{{ playbook_dir }}/../../bootstrap-prefix.sh" From fbe11eeb18106bc412b99469bc5d9e295203d6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 26 Nov 2021 08:33:23 +0100 Subject: [PATCH 22/22] mask glibc >= 2.34 --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index f699452c..866ee26b 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -24,7 +24,7 @@ prefix_user_defined_trusted_dirs: prefix_mask_packages: | # avoid glibc 2.34, as it's causing issues with the bootstrap, and it's not compatible with CUDA 11. # see https://github.com/EESSI/compatibility-layer/issues/137 + https://bugs.gentoo.org/824482 - =sys-libs/glibc-2.34 + >=sys-libs/glibc-2.34 # avoid libgcrypt 1.9.4 due to compiler errros on ppc64le, # see https://github.com/EESSI/compatibility-layer/issues/134 + https://bugs.gentoo.org/825722 =dev-libs/libgcrypt-1.9.4