Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/configure-cmake/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ runs:
run: |
# Source the container entrypoint script
. /entrypoint.sh

# Load Spack-installed GCC if necessary
# FIXME: The entrypoint.sh script should include the adjustment of PATH
# such that $(which g++) refers to the Spack-installed GCC.
if [ "$CPP_COMPILER" == "g++" ]; then
spack load gcc@15.2
CPP_COMPILER=$(which g++)
fi

cd "$GITHUB_WORKSPACE/$BUILD_PATH"
SOURCE_DIR="$GITHUB_WORKSPACE/$SOURCE_PATH"
echo "Configuring with CMake preset: $PRESET"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:

- name: Configure CMake
id: configure
uses: Framework-R-D/phlex/.github/actions/configure-cmake@main
uses: knoepfel/phlex/.github/actions/configure-cmake@cpp23-for-containers
with:
source-path: ${{ env.local_checkout_path }}
build-path: ${{ env.local_build_path }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
- name: Verify compile_commands.json (C++ only)
if: matrix.language == 'cpp'
run: |
set -euo pipefail
if [ ! -f "$CODEQL_EXTRACTOR_CPP_COMPILATION_DATABASE" ]; then
echo "Expected compile_commands.json at $CODEQL_EXTRACTOR_CPP_COMPILATION_DATABASE" >&2
exit 1
Expand Down Expand Up @@ -159,7 +158,6 @@ jobs:
- name: Check CodeQL SARIF for new or resolved alerts
id: check_codeql
run: |
set -euo pipefail
ARGS=(
--sarif "$GITHUB_WORKSPACE/sarif"
--min-level "${CODEQL_MIN_LEVEL}"
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hidden": false,
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_CXX_STANDARD": "20",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": "YES",
"CMAKE_CXX_EXTENSIONS": "NO",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "CetProvideDependency"
Expand Down
49 changes: 47 additions & 2 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

ARG parallelism=18

FROM gcc:15.2.0 AS base
FROM ubuntu:24.04 AS base
ARG parallelism

ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -27,6 +27,33 @@ ENV PHLEX_SPACK_ENV=/opt/spack-environments/phlex-ci

SHELL ["/bin/bash", "-c"]

########################################################################
# Install essential build tools, git, and Python

RUN <<'INSTALL_ESSENTIALS'
set -euo pipefail

apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
file \
git \
gnupg2 \
libcurl4-openssl-dev \
locales-all \
python3 \
python3-dev \
python3-pip \
unzip
apt-get clean
rm -rf /var/lib/apt/lists/*

# Make python3 available as 'python'
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
INSTALL_ESSENTIALS

########################################################################
# Install locale support required by tooling and Spack

Expand Down Expand Up @@ -117,13 +144,31 @@ set -euo pipefail
# Register binary caches for Spack installs and optional local cache volume
. /spack/share/spack/setup-env.sh

spack mirror add --type binary phlex-ci-scisoft https://scisoft.fnal.gov/scisoft/phlex-dev-build-cache
spack mirror add --type binary phlex-ci-scisoft https://scisoft.fnal.gov/scisoft/spack-packages/phlex-dev

if [ -d "/build-cache" ]; then
spack --timestamp mirror add --type binary phlex-ci-local /build-cache
fi
CONFIGURE_SPACK_MIRRORS

########################################################################
# Install GCC 15.2

RUN <<'INSTALL_GCC'
set -euo pipefail

# Install GCC in its own layer to improve cache reuse
. /spack/share/spack/setup-env.sh

spack --timestamp install --fail-fast -j $parallelism -p 1 \
--no-check-signature gcc@15.2 target=x86_64_v3

# Make GCC external to simplify concretization
spack compiler find $(spack location -i gcc@15.2)

spack clean -dfs
INSTALL_GCC

########################################################################
# Create, activate, and concretize the phlex-ci Spack environment

Expand Down
13 changes: 8 additions & 5 deletions ci/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ spack:
- cmake
- lcov
- ninja
- python
- py-gcovr
- py-numpy
- py-pip # Needed temporarily for ruff installation
- |
llvm@21.1.4: +zstd +llvm_dylib +link_llvm_dylib targets=x86
llvm@21.1.4: +zstd +llvm_dylib +link_llvm_dylib ~lldb targets=x86

view: true

concretizer:
unify: true

Expand All @@ -29,7 +28,7 @@ spack:
phlex:
require:
- "+form"
- "cxxstd=20"
- "cxxstd=23"
- "%gcc@15"


Expand All @@ -49,4 +48,8 @@ spack:
root:
require:
- "~x" # No graphics libraries required
- "cxxstd=20"
# FIXME: davix requires openssl headers which are not currently
# available in the container. They are also not needed
# for Phlex development. This should be rectified.
- "~davix"
- "cxxstd=23"
Loading