Skip to content

Commit a146b51

Browse files
committed
ci: hermetic e2e job — no host toolchain container
debian:stable-slim with NO compiler and NO host Scrt1.o: the only environment class that faithfully reproduces issue #195 (standard runners ship libc6-dev, so a sandbox toolchain leaking to the host CRT still links green there). Bootstraps xlings + released mcpp, builds the PR code with the sandbox gcc only, then runs the #195 manifest-llvm reproduction plus the hermetic e2e subset.
1 parent 34d3fc9 commit a146b51

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/ci-linux-e2e.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,76 @@ jobs:
117117
# Warm musl once so fresh-home e2e tests inherit the payload.
118118
"$MCPP" toolchain install gcc 15.1.0-musl
119119
bash tests/e2e/run_all.sh
120+
121+
# ──────────────────────────────────────────────────────────────────
122+
# Hermetic (no host toolchain): the ONLY environment class that
123+
# faithfully reproduces issue #195. Standard runners ship gcc +
124+
# libc6-dev, so a sandbox toolchain that leaks to the host's CRT
125+
# still links "green" there; this container has no compiler and no
126+
# host Scrt1.o, so any leak fails loudly. Builds PR code with the
127+
# bootstrap mcpp, then runs the llvm flow end-to-end.
128+
# ──────────────────────────────────────────────────────────────────
129+
hermetic:
130+
name: hermetic e2e (no host toolchain, container)
131+
runs-on: ubuntu-24.04
132+
container: debian:stable-slim
133+
timeout-minutes: 60
134+
env:
135+
XLINGS_NON_INTERACTIVE: '1'
136+
steps:
137+
- name: Install base utilities (NO compiler)
138+
run: |
139+
apt-get update -qq
140+
apt-get install -y -qq curl ca-certificates git xz-utils unzip
141+
# The whole point of this job: no host toolchain, no host CRT.
142+
! command -v gcc
143+
! command -v cc
144+
test ! -e /usr/lib/x86_64-linux-gnu/Scrt1.o
145+
test ! -e /usr/lib/gcc
146+
147+
- uses: actions/checkout@v4
148+
149+
# Payload cache (downloads only — the container still has no host
150+
# toolchain, which is the property under test).
151+
- name: Cache mcpp sandbox payloads
152+
uses: actions/cache@v4
153+
with:
154+
path: ~/.mcpp
155+
key: mcpp-hermetic-${{ hashFiles('mcpp.toml') }}
156+
restore-keys: |
157+
mcpp-hermetic-
158+
159+
- name: Bootstrap xlings + released mcpp
160+
run: |
161+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v0.4.62
162+
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
163+
xlings update
164+
xlings install mcpp -y -g
165+
MCPP_BOOT="$HOME/.xlings/subos/current/bin/mcpp"
166+
"$MCPP_BOOT" --version
167+
"$MCPP_BOOT" self config --mirror GLOBAL
168+
echo "MCPP_BOOT=$MCPP_BOOT" >> "$GITHUB_ENV"
169+
170+
- name: Build PR mcpp from source (sandbox gcc only)
171+
run: |
172+
"$MCPP_BOOT" build
173+
MCPP=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)")
174+
test -x "$MCPP"
175+
"$MCPP" --version
176+
echo "MCPP=$MCPP" >> "$GITHUB_ENV"
177+
178+
- name: "issue #195 reproduction: manifest llvm toolchain, fresh"
179+
run: |
180+
cd "$(mktemp -d)"
181+
"$MCPP" new hello195
182+
cd hello195
183+
printf '\n[toolchain]\nlinux = "llvm@22.1.8"\n' >> mcpp.toml
184+
printf 'import std;\nint main() { std::println("hello {}", 195); return 0; }\n' > src/main.cpp
185+
"$MCPP" run
186+
187+
- name: Hermetic llvm e2e subset
188+
run: |
189+
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
190+
export MCPP
191+
bash tests/e2e/86_llvm_hermetic_link.sh
192+
bash tests/e2e/37_llvm_import_std.sh

0 commit comments

Comments
 (0)