-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathaction.yml
More file actions
114 lines (100 loc) · 4.59 KB
/
Copy pathaction.yml
File metadata and controls
114 lines (100 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: setup-macos-llvm
description: >
macOS ARM64 setup shared by ci-macos.yml and ci-macos-e2e.yml: xlings +
the xlings-managed LLVM + a dev mcpp sandbox wired to that exact LLVM.
Exports LLVM_ROOT, CXX, MCPP_LLVM_VER, MCPP, XLINGS_BIN.
Kept separate from bootstrap-mcpp: macOS does not reuse the ~/.mcpp cache
lineage — it builds its sandbox from the freshly resolved LLVM package on
every run, which is exactly the property the macOS job exists to prove.
inputs:
xlings-version:
description: xlings release to bootstrap from
required: false
# Floor imposed by the index, not a routine bump — see
# .github/actions/bootstrap-mcpp/action.yml for why 0.4.69 is required
# (two packages named `lua` in one repo need openxlings/xlings#381).
default: '2026.8.30.2'
runs:
using: composite
steps:
- name: Cache xlings
uses: actions/cache@v4
with:
path: ~/.xlings
key: xlings-macos15-arm64-v3-xl${{ inputs.xlings-version }}-${{ hashFiles('.xlings.json') }}
restore-keys: |
xlings-macos15-arm64-v3-xl${{ inputs.xlings-version }}-
- name: Bootstrap xlings
shell: bash
env:
XLINGS_NON_INTERACTIVE: '1'
XLINGS_VERSION: ${{ inputs.xlings-version }}
run: |
WORK=$(mktemp -d)
tarball="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
# Retried and verified — .github/tools/fetch_release.sh. A bare curl
# here is the `curl: (52) Empty reply from server` flake.
bash "$GITHUB_WORKSPACE/.github/tools/fetch_release.sh" \
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}" \
"${WORK}/${tarball}"
tar -xzf "${WORK}/${tarball}" -C "${WORK}"
XLINGS_DIR="${WORK}/xlings-${XLINGS_VERSION}-macosx-arm64"
"$XLINGS_DIR/subos/default/bin/xlings" self install
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
xlings --version
echo "PATH=$HOME/.xlings/subos/default/bin:$PATH" >> "$GITHUB_ENV"
- name: Install LLVM via xlings
shell: bash
run: |
# latest-first: test binaries now link the toolchain's own libc++
# (A1 root fix in flags.cppm), so new llvm releases are
# self-consistent — the macOS job is the proof for each new default.
xlings install llvm -y || xlings install llvm@20.1.7 -y
LLVM_ROOT=$(find "$HOME/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang++" | head -1 | xargs dirname | xargs dirname)
ls "$LLVM_ROOT/bin/clang++"
"$LLVM_ROOT/bin/clang++" --version
echo "LLVM_ROOT=$LLVM_ROOT" >> "$GITHUB_ENV"
echo "CXX=$LLVM_ROOT/bin/clang++" >> "$GITHUB_ENV"
- name: Bootstrap mcpp via xlings
shell: bash
run: |
# Pinned to .xlings.json, shared implementation. A bare
# `xlings install mcpp` resolved 0.0.105 here on a cold cache — below
# the index floor, which makes every descriptor read return nothing.
MCPP=$(bash "$GITHUB_WORKSPACE/.github/tools/install_pinned_mcpp.sh" "$GITHUB_WORKSPACE")
echo "MCPP=$MCPP" >> "$GITHUB_ENV"
echo "XLINGS_BIN=$HOME/.xlings/subos/default/bin/xlings" >> "$GITHUB_ENV"
- name: Configure dev mcpp sandbox to reuse xlings LLVM
shell: bash
run: |
# Use EXACTLY the LLVM the install step resolved (env LLVM_ROOT) — a
# version-glob pick chose a stale cached 20.1.7 next to the freshly
# installed 22.1.8 and silently tested the wrong toolchain.
LLVM_PKG="$LLVM_ROOT"
test -d "$LLVM_PKG"
LLVM_VER=$(basename "$LLVM_PKG")
echo "MCPP_LLVM_VER=$LLVM_VER" >> "$GITHUB_ENV"
MCPP_LLVM_LINK="$HOME/.mcpp/registry/data/xpkgs/xim-x-llvm/$LLVM_VER"
printf '1\n' > "$LLVM_PKG/.mcpp_ok"
mkdir -p "$HOME/.mcpp/registry/data/xpkgs/xim-x-llvm"
rm -rf "$MCPP_LLVM_LINK"
ln -s "$LLVM_PKG" "$MCPP_LLVM_LINK"
mkdir -p "$HOME/.mcpp"
cat > "$HOME/.mcpp/config.toml" <<EOF
# mcpp global config for CI. Dev binaries under target/.../bin/mcpp
# fall back to ~/.mcpp; keep its registry isolated while reusing
# the LLVM package already installed by \`xlings install llvm\`.
[xlings]
binary = "$HOME/.xlings/subos/default/bin/xlings"
[index]
default = "mcpplibs"
[index.repos."mcpplibs"]
url = "https://github.com/mcpp-community/mcpp-index.git"
[cache]
search_ttl_seconds = 3600
[build]
default_jobs = 0
default_backend = "ninja"
EOF
cat "$HOME/.mcpp/config.toml"
ls "$MCPP_LLVM_LINK/bin/clang++"