Skip to content

Commit b4a0d0b

Browse files
committed
Fix bug where older Clang versions would use recent libc++
Address this issue with improved package masking. Also unwind the unnecessary separate stdlib_version parameter. Also bump GCC 12 version and fix heredocs.
1 parent 79ce9e9 commit b4a0d0b

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

.github/workflows/fromsource_ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ jobs:
7676
build-args: |
7777
compiler_kind=${{ matrix.compilers.kind }}
7878
compiler_version=${{ matrix.compilers.compiler-version }}
79-
${{ matrix.compilers.stdlib-version && format('stdlib_version={0}', matrix.compilers.stdlib-version) }}
8079
file: Dockerfile.fromsource
8180
push: true
8281
tags: ${{ steps.image_name.outputs.tags }}

.github/workflows/testing_ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
compiler-version: 13.4.0
4141
tags: [13.4.0, 13]
4242
- kind: gcc
43-
compiler-version: 12.4.0
44-
tags: [12.4.0, 12]
43+
compiler-version: 12.4.1_p20250704
44+
tags: [12.4.1, 12]
4545
- kind: gcc
4646
compiler-version: 11.5.0
4747
tags: [11.5.0, 11]
@@ -53,7 +53,6 @@ jobs:
5353
tags: [19.1.7, 19]
5454
- kind: clang
5555
compiler-version: 18.1.8-r6
56-
stdlib-version: 18.1.8
5756
tags: [18.1.6, 18]
5857
- kind: clang
5958
compiler-version: 17.0.6
@@ -93,7 +92,6 @@ jobs:
9392
build-args: |
9493
compiler_kind=${{ matrix.compilers.kind }}
9594
compiler_version=${{ matrix.compilers.compiler-version }}
96-
${{ matrix.compilers.stdlib-version && format('stdlib_version={0}', matrix.compilers.stdlib-version) }}
9795
file: Dockerfile.test
9896
push: true
9997
tags: ${{ steps.image_name.outputs.tags }}

Dockerfile.devcontainer

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04
44
ARG compiler_kind=gcc
55
ARG compiler_version=14
66

7-
RUN bash <<EOF
7+
RUN bash <<"EOF"
88
if ! id "vscode" &>/dev/null; then
99
apt-get update && apt-get install -y sudo adduser
1010
useradd -ms /bin/bash -p "" vscode && usermod -aG sudo vscode
@@ -15,15 +15,15 @@ RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/nul
1515
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
1616
RUN apt-get update && apt-get install -y cmake
1717

18-
RUN bash <<EOF
18+
RUN bash <<"EOF"
1919
if [[ "$compiler_kind" == gcc ]] ; then
2020
apt-get install -y gcc-${compiler_version}
2121
apt-get install -y g++-${compiler_version}
2222
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-"$compiler_version" 10
2323
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-"$compiler_version" 10
2424
elif [[ "$compiler_kind" == clang ]] ; then
2525
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/repository-key.gpg
26-
cat > /etc/apt/sources.list.d/llvm-toolchain-noble-${compiler_version}.sources <<EOF2
26+
cat > /etc/apt/sources.list.d/llvm-toolchain-noble-${compiler_version}.sources <<"EOF2"
2727
Types: deb
2828
URIs: http://apt.llvm.org/noble/
2929
Suites: llvm-toolchain-noble-${compiler_version}

Dockerfile.fromsource

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
FROM gentoo/stage3:amd64-nomultilib-openrc
44
ARG compiler_kind=clang-p2996
55
ARG compiler_version=21.0.0.9999
6-
ARG stdlib_version=${compiler_version}
7-
RUN /bin/bash <<-EOF
6+
RUN /bin/bash <<"EOF"
87
set -eux
98
echo 'BINPKG_FORMAT="gpkg"' >> /etc/portage/make.conf
109
echo 'FEATURES="getbinpkg"' >> /etc/portage/make.conf
@@ -14,14 +13,14 @@ RUN /bin/bash <<-EOF
1413
mkdir -p /etc/portage/repos.conf
1514

1615
if [[ ${compiler_kind} == clang-p2996 ]] ; then
17-
cat > /etc/portage/repos.conf/gentoo.conf <<- REPO_CONF
16+
cat > /etc/portage/repos.conf/gentoo.conf <<"EOF2"
1817
[gentoo]
1918
location = /var/db/repos/gentoo
2019
sync-type = git
2120
sync-uri = https://github.com/bemanproject/container-infra-clang-p2996-gentoo.git
2221
auto-sync = yes
2322
sync-openpgp-key-refresh = no
24-
REPO_CONF
23+
EOF2
2524
rm -rf /var/db/repos/gentoo
2625
emerge --sync
2726
fi
@@ -31,12 +30,9 @@ REPO_CONF
3130
emerge dev-build/ninja
3231
emerge dev-util/gcovr
3332
if [[ ${compiler_kind} == clang* ]] ; then
34-
emerge =llvm-core/clang-${compiler_version} --autounmask --autounmask-write || true
33+
USE="libcxx" emerge =llvm-core/clang-${compiler_version} --autounmask --autounmask-write || true
3534
etc-update --automode -5
36-
USE="libcxx" emerge =llvm-core/clang-runtime-${stdlib_version} --autounmask --autounmask-write || true
37-
etc-update --automode -5
38-
emerge =llvm-core/clang-${compiler_version}
39-
USE="libcxx" emerge =llvm-core/clang-runtime-${stdlib_version}
35+
USE="libcxx" emerge =llvm-core/clang-${compiler_version}
4036
ln -sv /usr/lib/llvm/${compiler_version%%.*}/bin/* /usr/local/bin/
4137
elif [[ ${compiler_kind} == gcc ]] ; then
4238
emerge =sys-devel/gcc-${compiler_version} --autounmask --autounmask-write || true

Dockerfile.test

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
FROM gentoo/stage3:amd64-nomultilib-openrc
44
ARG compiler_kind=clang
55
ARG compiler_version=20.1.7
6-
ARG stdlib_version=${compiler_version}
7-
RUN /bin/bash <<-EOF
6+
RUN /bin/bash <<"EOF"
87
set -eux
98
echo 'BINPKG_FORMAT="gpkg"' >> /etc/portage/make.conf
109
echo 'FEATURES="getbinpkg"' >> /etc/portage/make.conf
@@ -17,8 +16,22 @@ RUN /bin/bash <<-EOF
1716
emerge dev-vcs/git
1817
emerge dev-util/gcovr
1918
if [[ ${compiler_kind} == clang ]] ; then
20-
emerge --getbinpkgonly =llvm-core/clang-${compiler_version}
21-
USE="libcxx" emerge =llvm-core/clang-runtime-${stdlib_version}
19+
use_params=''
20+
case ${compiler_version%%.*} in
21+
17)
22+
emerge =dev-lang/python-3.12.11
23+
use_params=python_single_target_python3_12 ;;
24+
esac
25+
echo ">llvm-runtimes/openmp-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
26+
echo ">llvm-core/llvm-common-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
27+
echo ">llvm-runtimes/compiler-rt-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
28+
echo ">llvm-runtimes/compiler-rt-sanitizers-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
29+
echo ">llvm-core/llvm-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
30+
echo ">llvm-core/llvmgold-${compiler_version%%\.*}-r9999" >> /etc/portage/package.mask/llvm
31+
echo ">llvm-core/llvm-toolchain-symlinks-${compiler_version%%\.*}-r9999" >> /etc/portage/package.mask/llvm
32+
echo ">llvm-core/clang-common-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
33+
echo ">llvm-core/clang-runtime-${compiler_version%%-r*}-r9999" >> /etc/portage/package.mask/llvm
34+
USE="libcxx $use_params" emerge =llvm-core/clang-${compiler_version}
2235
ln -s /usr/lib/llvm/${compiler_version%%.*}/bin/* /usr/local/bin/
2336
elif [[ ${compiler_kind} == gcc ]] ; then
2437
emerge --getbinpkgonly =sys-devel/gcc-${compiler_version}

0 commit comments

Comments
 (0)