@@ -19,6 +19,31 @@ RUN apt-get update && apt-get install -y \
1919 curl \
2020 meson
2121
22+ # Provide test runner in base so all targets inherit it
23+ RUN echo '#!/bin/bash' > /test-compiler.sh && \
24+ echo 'set -e' >> /test-compiler.sh && \
25+ echo 'echo "🔫 Testing $CC..."' >> /test-compiler.sh && \
26+ echo 'echo "Compiler: $CC"' >> /test-compiler.sh && \
27+ echo 'echo "C++ Compiler: $CXX"' >> /test-compiler.sh && \
28+ echo '' >> /test-compiler.sh && \
29+ echo '# Clean previous build' >> /test-compiler.sh && \
30+ echo 'rm -rf build' >> /test-compiler.sh && \
31+ echo '' >> /test-compiler.sh && \
32+ echo '# Setup build with current compiler' >> /test-compiler.sh && \
33+ echo 'if meson setup build --warnlevel=3; then' >> /test-compiler.sh && \
34+ echo ' echo "✅ Meson setup successful"' >> /test-compiler.sh && \
35+ echo ' if ninja -C build; then' >> /test-compiler.sh && \
36+ echo ' echo "✅ Build successful"' >> /test-compiler.sh && \
37+ echo ' if ninja -C build test; then' >> /test-compiler.sh && \
38+ echo ' echo "✅ Tests passed"' >> /test-compiler.sh && \
39+ echo ' echo "PASS"' >> /test-compiler.sh && \
40+ echo ' else echo "❌ Tests failed"; echo "FAIL_TEST"; fi' >> /test-compiler.sh && \
41+ echo ' else echo "❌ Build failed"; echo "FAIL_BUILD"; fi' >> /test-compiler.sh && \
42+ echo 'else echo "❌ Meson setup failed"; echo "FAIL_SETUP"; fi' >> /test-compiler.sh && \
43+ chmod +x /test-compiler.sh
44+ WORKDIR /workspace
45+ CMD ["/test-compiler.sh"]
46+
2247# GCC 12 (THE DEVIL) - Pre-C23 image
2348FROM base as gcc-12
2449RUN apt-get update && apt-get install -y \
@@ -79,44 +104,40 @@ RUN apt-get update && apt-get install -y \
79104ENV CC=clang-20
80105ENV CXX=clang++-20
81106
82- # Default to clang-20 for standalone usage
83- FROM clang-20
84-
85- # Simple test script that works with any compiler
107+ # Ubuntu 24.04 base (for gcc-14)
108+ FROM ubuntu:24.04 as base-noble
109+ ENV DEBIAN_FRONTEND=noninteractive
110+ ENV TZ=UTC
111+ RUN apt-get update && apt-get install -y \
112+ build-essential \
113+ ninja-build \
114+ python3 \
115+ python3-pip \
116+ pkg-config \
117+ libsodium-dev \
118+ libgit2-dev \
119+ libroaring-dev \
120+ git \
121+ curl \
122+ meson
123+ # Provide test runner in base-noble too
86124RUN echo '#!/bin/bash' > /test-compiler.sh && \
87125 echo 'set -e' >> /test-compiler.sh && \
88126 echo 'echo "🔫 Testing $CC..."' >> /test-compiler.sh && \
89127 echo 'echo "Compiler: $CC"' >> /test-compiler.sh && \
90128 echo 'echo "C++ Compiler: $CXX"' >> /test-compiler.sh && \
91- echo '' >> /test-compiler.sh && \
92- echo '# Clean previous build' >> /test-compiler.sh && \
93129 echo 'rm -rf build' >> /test-compiler.sh && \
94- echo '' >> /test-compiler.sh && \
95- echo '# Setup build with current compiler' >> /test-compiler.sh && \
96130 echo 'if meson setup build --warnlevel=3; then' >> /test-compiler.sh && \
97- echo ' echo "✅ Meson setup successful"' >> /test-compiler.sh && \
98- echo ' ' >> /test-compiler.sh && \
99- echo ' # Build' >> /test-compiler.sh && \
100- echo ' if ninja -C build; then' >> /test-compiler.sh && \
101- echo ' echo "✅ Build successful"' >> /test-compiler.sh && \
102- echo ' ' >> /test-compiler.sh && \
103- echo ' # Run tests' >> /test-compiler.sh && \
104- echo ' if ninja -C build test; then' >> /test-compiler.sh && \
105- echo ' echo "✅ Tests passed"' >> /test-compiler.sh && \
106- echo ' echo "PASS"' >> /test-compiler.sh && \
107- echo ' else' >> /test-compiler.sh && \
108- echo ' echo "❌ Tests failed"' >> /test-compiler.sh && \
109- echo ' echo "FAIL_TEST"' >> /test-compiler.sh && \
110- echo ' fi' >> /test-compiler.sh && \
111- echo ' else' >> /test-compiler.sh && \
112- echo ' echo "❌ Build failed"' >> /test-compiler.sh && \
113- echo ' echo "FAIL_BUILD"' >> /test-compiler.sh && \
114- echo ' fi' >> /test-compiler.sh && \
115- echo 'else' >> /test-compiler.sh && \
116- echo ' echo "❌ Meson setup failed"' >> /test-compiler.sh && \
117- echo ' echo "FAIL_SETUP"' >> /test-compiler.sh && \
118- echo 'fi' >> /test-compiler.sh && \
131+ echo ' if ninja -C build; then' >> /test-compiler.sh && \
132+ echo ' if ninja -C build test; then echo "PASS"; else echo "FAIL_TEST"; fi' >> /test-compiler.sh && \
133+ echo ' else echo "FAIL_BUILD"; fi' >> /test-compiler.sh && \
134+ echo 'else echo "FAIL_SETUP"; fi' >> /test-compiler.sh && \
119135 chmod +x /test-compiler.sh
120-
121136WORKDIR /workspace
122137CMD ["/test-compiler.sh"]
138+
139+ # GCC 14 target (gating)
140+ FROM base-noble as gcc-14
141+ RUN apt-get update && apt-get install -y gcc-14 g++-14
142+ ENV CC=gcc-14
143+ ENV CXX=g++-14
0 commit comments