Skip to content

Commit 4aabaae

Browse files
authored
ci: name the build tool in one place, and remove a pin that resolved to 2026-05 (#13)
* ci: name the build tool in one place, and remove a pin that resolved to 2026-05 `mcpp build` ended at `package 'xim:glibc@>=2.39' not found` on every pull request opened after 2026-07-11, before compiling a line. The change under review was not involved. `.xlings.json` declared `workspace.mcpp = 0.0.13`. That file is read from the current directory, and `actions/checkout` places it there before any step runs, so every `mcpp` invocation in this repository resolved to a build tool from 2026-05 rather than to the one the job installed. The index no longer serves the toolchain packages a tool of that age asks for. Reproduced outside CI: in a checkout of this repository, `mcpp --version` reports [warn] mcpp@0.0.13 is the version this project asks for, and it is not installed yet from ./.xlings.json -> workspace.mcpp and reports 2026.8.28.2 once the file is removed. The version is now an environment variable, so the install and the cache key cannot drift apart; the cache path named 0.0.13 while the job installed something else, so that cache had never once been hit. A weekly schedule is added. The breakage occurred between 2026-07-11 and 2026-08-29 and nothing reported it, because master received no pushes in that window: the first run to meet it was a contributor's, who had no way to distinguish a broken environment from a broken change. Measured locally against mcpp 2026.8.28.2: `mcpp build` resolves and completes, `mcpp test` reports 9 tests from 3 suites passed. * ci: retry transport failures when fetching the installer `--retry` covers a transient HTTP status and a timeout and does not cover a failure of the transport. `curl: (35) Recv failure: Connection reset by peer` is what this ecosystem's runners actually meet, and it produces a red job that names no defect.
1 parent 965d805 commit 4aabaae

4 files changed

Lines changed: 62 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,84 @@
11
name: CI
22

3+
# THE BUILD TOOL IS NAMED HERE AND NOWHERE ELSE.
4+
#
5+
# This workflow used to install it through `.xlings.json', a workspace pin that
6+
# `actions/checkout' places in the working directory before anything else runs.
7+
# Two consequences followed and neither was visible in a passing log:
8+
#
9+
# * every `mcpp' invocation in this repository resolved to the pinned version
10+
# rather than to the one the job had installed, because that pin is read
11+
# from the current directory;
12+
# * the pin named 0.0.13, from 2026-05. The index no longer serves the
13+
# toolchain packages a build tool of that age asks for, so `mcpp build'
14+
# ended at `package 'xim:glibc@>=2.39' not found' before compiling a line.
15+
#
16+
# The pin file is removed. The version is an environment variable, so the two
17+
# places that need it, the install and the cache, cannot drift apart again.
18+
319
on:
420
push:
521
branches: [master]
622
pull_request:
23+
# A CANARY, BECAUSE THIS ROTTED WHERE NOTHING WOULD LOOK.
24+
#
25+
# The breakage above occurred between 2026-07-11 and 2026-08-29 and nothing
26+
# reported it: master received no pushes in that window, so the first run to
27+
# meet it was a contributor's pull request, whose author had no way to
28+
# distinguish a broken environment from a broken change.
29+
schedule:
30+
- cron: '0 6 * * 1'
31+
workflow_dispatch:
32+
33+
env:
34+
MCPP_VERSION: 2026.8.29.1
35+
XLINGS_VERSION: v2026.8.17.2
36+
XLINGS_NON_INTERACTIVE: '1'
737

838
jobs:
939
build:
1040
name: build + test (linux x86_64, mcpp)
1141
runs-on: ubuntu-latest
42+
timeout-minutes: 45
1243
steps:
1344
- uses: actions/checkout@v4
1445

1546
- name: Install xlings
16-
env:
17-
XLINGS_VERSION: 0.4.31
1847
run: |
19-
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
20-
curl -fsSL -o "/tmp/${tarball}" \
21-
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
22-
tar -xzf "/tmp/${tarball}" -C /tmp
23-
"/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install
48+
# --retry-all-errors and not --retry alone: the first covers a
49+
# transient HTTP status and a timeout, and what this step actually
50+
# meets is a failure of the transport. Observed in this ecosystem as
51+
# `curl: (35) Recv failure: Connection reset by peer', thirteen
52+
# seconds into a job, before anything was built.
53+
curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 \
54+
https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \
55+
| bash -s "$XLINGS_VERSION"
2456
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
2557
26-
- name: Refresh package index
27-
run: xlings update
28-
29-
- name: Install workspace tools (.xlings.json → mcpp 0.0.13)
30-
run: xlings install -y
58+
- name: Install mcpp
59+
run: |
60+
xlings update
61+
xlings install "mcpp@$MCPP_VERSION" -y -g
62+
# The version this job runs is the version it prints. A pin that is
63+
# not read is the failure this file exists to stop repeating.
64+
mcpp --version
65+
# A runner outside China reaches the mirrors this names. The CN set is
66+
# for a developer's machine and is slower or unreachable from here.
67+
mcpp self config --mirror GLOBAL
3168
69+
# The toolchain mcpp bootstraps is decided by the version pinned above, so
70+
# that version is the whole of the key.
3271
- name: Cache mcpp sandbox
3372
uses: actions/cache@v4
3473
with:
35-
path: ~/.xlings/data/xpkgs/xim-x-mcpp/0.0.13/registry
36-
key: mcpp-sandbox-${{ runner.os }}-mcpp0.0.13
74+
path: ~/.xlings/data/xpkgs/xim-x-mcpp/${{ env.MCPP_VERSION }}/registry
75+
key: mcpp-sandbox-${{ runner.os }}-mcpp${{ env.MCPP_VERSION }}
3776

3877
- name: Build with mcpp
3978
run: mcpp build
4079

80+
# Six of these reach httpbin.org. They were here before this change and
81+
# are left as they were. A network failure among them is distinguishable
82+
# in the log by the endpoint it names.
4183
- name: Run tests
4284
run: mcpp test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ build/
22
.xmake/
33
# mcpp build artefacts
44
target/
5+
# mcpp writes this beside the manifest on every build
6+
compile_commands.json

.xlings.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

mcpp.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Auto-generated by mcpp. Do not edit by hand.
2+
# Records what this build resolved. It does not yet pin future builds:
3+
# index dependencies are re-resolved from their constraints each time.
4+
# dev-dependencies are excluded: only `mcpp test` resolves them, and this
5+
# file must not change depending on which command ran last.
26
version = 2
37

48
[package."compat.mbedtls"]

0 commit comments

Comments
 (0)