mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-06-15 08:17:05 +00:00
- gcc ships no supported switch to build libstdc++ with -fsanitize=thread, and spack's gcc recipe filters all flags out of the target-library build (CXXFLAGS_FOR_TARGET is owned by its generated --with-build-config=spack makefile), so provide a dedicated libstdcxx-tsan package in a custom repo - build only the libstdc++-v3 subtree from the matching gcc release tarball, configured standalone against the already-installed toolchain (recipe modeled on https://iree.dev/developers/debugging/sanitizers/), instead of rebuilding all of gcc - the result is a drop-in runtime replacement for the compiler's libstdc++ (same soname and symbol versions), to be loaded only by the instrumented test executables - normalize the install layout after make install: the standalone build puts the runtime libraries into the multilib os dir (lib64 on x86_64) regardless of --libdir, and --with-toolexeclibdir only applies to cross builds - register the repo in the setup-deps action before creating the env
79 lines
3.1 KiB
YAML
79 lines
3.1 KiB
YAML
name: Install dependencies
|
|
description: Setup spack and install dependencies
|
|
|
|
inputs:
|
|
gcc:
|
|
description: 'GCC version to use'
|
|
required: true
|
|
env:
|
|
description: 'Spack environment name (latest, boost187)'
|
|
default: 'latest'
|
|
fresh:
|
|
description: 'Use fresh concretization'
|
|
default: 'false'
|
|
push-gcc:
|
|
description: 'Push the freshly-built gcc node to the buildcache (buildcache workflow only)'
|
|
default: 'false'
|
|
push-token:
|
|
description: 'Token with packages:write, required when push-gcc is true'
|
|
default: ''
|
|
|
|
runs:
|
|
using: composite
|
|
# Composite action step names are not shown in the UI (https://github.com/actions/runner/issues/1877),
|
|
# so we use ::group:: to make them visible.
|
|
steps:
|
|
- name: Setup spack
|
|
uses: spack/setup-spack@v3
|
|
with:
|
|
color: true
|
|
buildcache: true
|
|
|
|
- name: Find system compiler
|
|
shell: spack-bash {0}
|
|
run: |
|
|
echo "::group::Find system compiler"
|
|
spack compiler find
|
|
echo "::endgroup::"
|
|
|
|
- name: Add FairMQ buildcache mirror
|
|
shell: spack-bash {0}
|
|
run: |
|
|
echo "::group::Add FairMQ buildcache mirror"
|
|
spack mirror add --unsigned --type binary \
|
|
ghcr-buildcache oci://ghcr.io/fairrootgroup/fairmq-spack-buildcache
|
|
echo "::endgroup::"
|
|
|
|
- name: Install GCC
|
|
shell: spack-bash {0}
|
|
env:
|
|
GITHUB_TOKEN: ${{ inputs.push-token }}
|
|
run: |
|
|
echo "::group::Install GCC"
|
|
spack install ${{ inputs.fresh == 'true' && '--fresh' || '' }} gcc@${{ inputs.gcc }} target=x86_64_v3
|
|
gcc_hash=$(spack find --json gcc@${{ inputs.gcc }} target=x86_64_v3 | jq -r 'sort_by(.version | split(".") | map(tonumber)) | last | .hash')
|
|
if [ "${{ inputs.push-gcc }}" = "true" ]; then
|
|
# Push the gcc node now, BEFORE `spack compiler find` registers it as an
|
|
# external -- externals are excluded from `buildcache push`. This is what
|
|
# lets CI pull gcc from the cache (~1 min) instead of building it (~1 h).
|
|
# --allow-missing: when gcc itself was pulled from the cache, its
|
|
# build-time dependencies are not installed locally and would
|
|
# otherwise fail the push.
|
|
spack mirror set --oci-username ${{ github.actor }} --oci-password-variable GITHUB_TOKEN ghcr-buildcache
|
|
spack buildcache push --unsigned --allow-missing ghcr-buildcache /$gcc_hash
|
|
fi
|
|
spack compiler find "$(spack location -i /$gcc_hash)"
|
|
echo "::endgroup::"
|
|
|
|
- name: Install dependencies
|
|
shell: spack-bash {0}
|
|
run: |
|
|
echo "::group::Install dependencies"
|
|
spack repo add "$GITHUB_WORKSPACE/test/ci/spack_repo/fairmq_ci"
|
|
spack env create fairmq test/ci/spack-${{ inputs.env }}.yaml
|
|
spack -e fairmq add gcc@${{ inputs.gcc }}
|
|
spack -e fairmq config add "packages:all:require:'%gcc@${{ inputs.gcc }}'"
|
|
spack -e fairmq install --fail-fast ${{ inputs.fresh == 'true' && '--fresh' || '' }}
|
|
spack env activate --sh fairmq | grep '^export ' | sed 's/^export //;s/;$//' >> $GITHUB_ENV
|
|
echo "::endgroup::"
|