Skip to content

Commit 2300236

Browse files
committed
fix: ci-fresh-install — correct asset names + MCPP_VENDORED_XLINGS
- macOS tarball: macos-aarch64 → macosx-arm64 (matches release assets) - Windows: use explicit extract dir name - All steps: export MCPP_VENDORED_XLINGS so freshly-built mcpp uses the installed xlings binary for package operations - Use MCPP_BOOTSTRAP for bootstrap mcpp, MCPP for freshly-built - Set MCPP_HOME explicitly for consistent sandbox location
1 parent 6e90843 commit 2300236

1 file changed

Lines changed: 60 additions & 41 deletions

File tree

.github/workflows/ci-fresh-install.yml

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ jobs:
2727
linux-fresh:
2828
name: Linux fresh install
2929
runs-on: ubuntu-24.04
30-
timeout-minutes: 30
30+
timeout-minutes: 45
31+
env:
32+
MCPP_HOME: /home/runner/.mcpp
3133
steps:
3234
- uses: actions/checkout@v4
3335

34-
- name: Install xlings (clean, no cache)
36+
- name: Install xlings + bootstrap mcpp (clean, no cache)
3537
env:
3638
XLINGS_NON_INTERACTIVE: '1'
3739
XLINGS_VERSION: '0.4.30'
@@ -44,20 +46,21 @@ jobs:
4446
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
4547
xlings --version
4648
xlings install mcpp -y
47-
echo "MCPP=$HOME/.xlings/subos/default/bin/mcpp" >> "$GITHUB_ENV"
49+
echo "MCPP_BOOTSTRAP=$HOME/.xlings/subos/default/bin/mcpp" >> "$GITHUB_ENV"
50+
echo "XLINGS_BIN=$HOME/.xlings/subos/default/bin/xlings" >> "$GITHUB_ENV"
4851
echo "PATH=$HOME/.xlings/subos/default/bin:$PATH" >> "$GITHUB_ENV"
4952
50-
- name: Build freshly-built mcpp from source (self-host)
53+
- name: Build mcpp from source (self-host with freshly-built binary)
5154
run: |
52-
# Use the xlings-installed mcpp to build from source, then
53-
# switch to the freshly-built binary for remaining tests.
54-
"$MCPP" self config --mirror GLOBAL
55-
"$MCPP" build
55+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
56+
"$MCPP_BOOTSTRAP" self config --mirror GLOBAL
57+
"$MCPP_BOOTSTRAP" build
5658
MCPP_FRESH=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)")
5759
echo "MCPP=$MCPP_FRESH" >> "$GITHUB_ENV"
5860
5961
- name: "Fresh user: mcpp new → build → run (default GCC)"
6062
run: |
63+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
6164
TMP=$(mktemp -d)
6265
cd "$TMP"
6366
"$MCPP" new hello_gcc
@@ -66,6 +69,7 @@ jobs:
6669
6770
- name: "Fresh user: install LLVM → new → build → run"
6871
run: |
72+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
6973
"$MCPP" toolchain install llvm 20.1.7
7074
"$MCPP" toolchain default llvm@20.1.7
7175
TMP=$(mktemp -d)
@@ -76,36 +80,38 @@ jobs:
7680
7781
- name: "Fresh user: import std (GCC)"
7882
run: |
83+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
7984
"$MCPP" toolchain default gcc
8085
TMP=$(mktemp -d)
8186
cd "$TMP"
8287
mkdir -p src
83-
cat > mcpp.toml <<'EOF'
88+
cat > mcpp.toml <<'TOML'
8489
[package]
8590
name = "std_test"
8691
version = "0.1.0"
87-
EOF
88-
cat > src/main.cpp <<'EOF'
92+
TOML
93+
cat > src/main.cpp <<'CPP'
8994
import std;
9095
int main() { std::println("import std works"); }
91-
EOF
96+
CPP
9297
"$MCPP" run 2>&1 | tee /dev/stderr | grep -q "import std works"
9398
9499
- name: "Fresh user: import std (LLVM)"
95100
run: |
101+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
96102
"$MCPP" toolchain default llvm@20.1.7
97103
TMP=$(mktemp -d)
98104
cd "$TMP"
99105
mkdir -p src
100-
cat > mcpp.toml <<'EOF'
106+
cat > mcpp.toml <<'TOML'
101107
[package]
102108
name = "std_test_llvm"
103109
version = "0.1.0"
104-
EOF
105-
cat > src/main.cpp <<'EOF'
110+
TOML
111+
cat > src/main.cpp <<'CPP'
106112
import std;
107113
int main() { std::println("llvm import std works"); }
108-
EOF
114+
CPP
109115
"$MCPP" run 2>&1 | tee /dev/stderr | grep -q "llvm import std works"
110116
111117
# ──────────────────────────────────────────────────────────────────
@@ -115,34 +121,39 @@ jobs:
115121
name: macOS fresh install
116122
runs-on: macos-15
117123
timeout-minutes: 30
124+
env:
125+
MCPP_HOME: /Users/runner/.mcpp
118126
steps:
119127
- uses: actions/checkout@v4
120128

121-
- name: Install xlings (clean, no cache)
129+
- name: Install xlings + bootstrap mcpp (clean, no cache)
122130
env:
123131
XLINGS_NON_INTERACTIVE: '1'
124132
XLINGS_VERSION: '0.4.30'
125133
run: |
126-
tarball="xlings-${XLINGS_VERSION}-macos-aarch64.tar.gz"
134+
tarball="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
127135
curl -fsSL -o "/tmp/${tarball}" \
128136
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
129137
tar -xzf "/tmp/${tarball}" -C /tmp
130-
"/tmp/xlings-${XLINGS_VERSION}-macos-aarch64/subos/default/bin/xlings" self install
138+
"/tmp/xlings-${XLINGS_VERSION}-macosx-arm64/subos/default/bin/xlings" self install
131139
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
132140
xlings --version
133141
xlings install mcpp -y
134-
echo "MCPP=$HOME/.xlings/subos/default/bin/mcpp" >> "$GITHUB_ENV"
142+
echo "MCPP_BOOTSTRAP=$HOME/.xlings/subos/default/bin/mcpp" >> "$GITHUB_ENV"
143+
echo "XLINGS_BIN=$HOME/.xlings/subos/default/bin/xlings" >> "$GITHUB_ENV"
135144
echo "PATH=$HOME/.xlings/subos/default/bin:$PATH" >> "$GITHUB_ENV"
136145
137-
- name: Build freshly-built mcpp from source
146+
- name: Build mcpp from source
138147
run: |
139-
"$MCPP" self config --mirror GLOBAL
140-
"$MCPP" build
141-
MCPP_FRESH=$(realpath "$(find target -type f -name mcpp | head -1)")
142-
echo "MCPP=$MCPP_FRESH" >> "$GITHUB_ENV"
148+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
149+
"$MCPP_BOOTSTRAP" self config --mirror GLOBAL
150+
"$MCPP_BOOTSTRAP" build
151+
MCPP_FRESH=$(find target -type f -name mcpp ! -name '*.o' | head -1)
152+
echo "MCPP=$(cd "$(dirname "$MCPP_FRESH")" && pwd)/$(basename "$MCPP_FRESH")" >> "$GITHUB_ENV"
143153
144154
- name: "Fresh user: mcpp new → build → run (LLVM)"
145155
run: |
156+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
146157
TMP=$(mktemp -d)
147158
cd "$TMP"
148159
"$MCPP" new hello_mac
@@ -151,18 +162,19 @@ jobs:
151162
152163
- name: "Fresh user: import std (LLVM)"
153164
run: |
165+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
154166
TMP=$(mktemp -d)
155167
cd "$TMP"
156168
mkdir -p src
157-
cat > mcpp.toml <<'EOF'
169+
cat > mcpp.toml <<'TOML'
158170
[package]
159171
name = "std_test_mac"
160172
version = "0.1.0"
161-
EOF
162-
cat > src/main.cpp <<'EOF'
173+
TOML
174+
cat > src/main.cpp <<'CPP'
163175
import std;
164176
int main() { std::println("macos import std works"); }
165-
EOF
177+
CPP
166178
"$MCPP" run 2>&1 | tee /dev/stderr | grep -q "macos import std works"
167179
168180
# ──────────────────────────────────────────────────────────────────
@@ -172,40 +184,46 @@ jobs:
172184
name: Windows fresh install
173185
runs-on: windows-latest
174186
timeout-minutes: 30
187+
env:
188+
MCPP_HOME: C:\Users\runneradmin\.mcpp
175189
steps:
176190
- uses: actions/checkout@v4
177191

178-
- name: Install xlings (clean, no cache)
192+
- name: Install xlings + bootstrap mcpp (clean, no cache)
179193
env:
180194
XLINGS_NON_INTERACTIVE: '1'
181195
XLINGS_VERSION: '0.4.30'
182196
shell: bash
183197
run: |
184198
curl -fsSL -o /tmp/xlings.zip \
185199
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/xlings-${XLINGS_VERSION}-windows-x86_64.zip"
200+
mkdir -p /tmp/xlings-extract
186201
unzip -o /tmp/xlings.zip -d /tmp/xlings-extract
187-
XLINGS_DIR=$(find /tmp/xlings-extract -maxdepth 1 -type d -name 'xlings-*' | head -1)
202+
XLINGS_DIR="/tmp/xlings-extract/xlings-${XLINGS_VERSION}-windows-x86_64"
188203
"$XLINGS_DIR/subos/default/bin/xlings.exe" self install
189204
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
190205
xlings --version
191206
xlings install mcpp -y
192-
MCPP="$USERPROFILE/.xlings/subos/default/bin/mcpp.exe"
193-
test -f "$MCPP"
194-
echo "MCPP=$MCPP" >> "$GITHUB_ENV"
207+
MCPP_BOOTSTRAP="$USERPROFILE/.xlings/subos/default/bin/mcpp.exe"
208+
test -f "$MCPP_BOOTSTRAP"
209+
echo "MCPP_BOOTSTRAP=$MCPP_BOOTSTRAP" >> "$GITHUB_ENV"
210+
echo "XLINGS_BIN=$USERPROFILE/.xlings/subos/default/bin/xlings.exe" >> "$GITHUB_ENV"
195211
196-
- name: Build freshly-built mcpp from source
212+
- name: Build mcpp from source
197213
shell: bash
198214
run: |
199215
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
200-
"$MCPP" self config --mirror GLOBAL
201-
"$MCPP" build
216+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
217+
"$MCPP_BOOTSTRAP" self config --mirror GLOBAL
218+
"$MCPP_BOOTSTRAP" build
202219
MCPP_FRESH=$(find target -type f -name 'mcpp.exe' | head -1)
203220
echo "MCPP=$(realpath "$MCPP_FRESH")" >> "$GITHUB_ENV"
204221
205222
- name: "Fresh user: mcpp new → build → run"
206223
shell: bash
207224
run: |
208225
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
226+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
209227
TMP=$(mktemp -d)
210228
cd "$TMP"
211229
"$MCPP" new hello_win
@@ -216,16 +234,17 @@ jobs:
216234
shell: bash
217235
run: |
218236
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
237+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
219238
TMP=$(mktemp -d)
220239
cd "$TMP"
221240
mkdir -p src
222-
cat > mcpp.toml <<'EOF'
241+
cat > mcpp.toml <<'TOML'
223242
[package]
224243
name = "std_test_win"
225244
version = "0.1.0"
226-
EOF
227-
cat > src/main.cpp <<'EOF'
245+
TOML
246+
cat > src/main.cpp <<'CPP'
228247
import std;
229248
int main() { std::println("windows import std works"); }
230-
EOF
249+
CPP
231250
"$MCPP" run 2>&1 | tee /dev/stderr | grep -q "windows import std works"

0 commit comments

Comments
 (0)