Skip to content

Commit 93df9ae

Browse files
authored
feat: release v0.1.5 — upgrade deps, macOS 14 support, build fully via mcpp (#26)
Upgrade to latest xlings/mcpp (mcpp 0.0.52, xlings 0.4.51, llmapi 0.2.6, tinyhttps 0.2.3); bump to 0.1.5. Build d2x via mcpp on all platforms (linux/macos-14/macos-15/windows) for local/CI/release and remove xmake.lua. Add macOS 14 support (#19). Add checker-smoke CI for #24; generalize book i18n (#8).
1 parent c3c9d05 commit 93df9ae

10 files changed

Lines changed: 193 additions & 111 deletions

File tree

.github/workflows/ci.yml

Lines changed: 114 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: [main]
66
pull_request:
77

8+
env:
9+
XLINGS_VERSION: 0.4.51
10+
MCPP_VERSION: 0.0.52
11+
812
jobs:
913
build-linux-mcpp:
1014
name: build (linux x86_64, mcpp)
@@ -13,8 +17,6 @@ jobs:
1317
- uses: actions/checkout@v4
1418

1519
- name: Install xlings
16-
env:
17-
XLINGS_VERSION: 0.4.31
1820
run: |
1921
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
2022
curl -fsSL -o "/tmp/${tarball}" \
@@ -26,14 +28,14 @@ jobs:
2628
- name: Refresh package index
2729
run: xlings update
2830

29-
- name: Install workspace tools (.xlings.json mcpp 0.0.13)
31+
- name: Install workspace tools (.xlings.json -> mcpp ${{ env.MCPP_VERSION }})
3032
run: xlings install -y
3133

3234
- name: Cache mcpp sandbox
3335
uses: actions/cache@v4
3436
with:
35-
path: ~/.xlings/data/xpkgs/xim-x-mcpp/0.0.13/registry
36-
key: mcpp-sandbox-${{ runner.os }}-mcpp0.0.13
37+
path: ~/.xlings/data/xpkgs/xim-x-mcpp/${{ env.MCPP_VERSION }}/registry
38+
key: mcpp-sandbox-${{ runner.os }}-mcpp${{ env.MCPP_VERSION }}
3739

3840
- name: Build with mcpp
3941
run: mcpp build
@@ -46,15 +48,18 @@ jobs:
4648
"$binary" --version
4749
4850
build-macos:
49-
runs-on: macos-15
51+
name: build (${{ matrix.os }}, mcpp)
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
os: [macos-14, macos-15]
5057
steps:
51-
- name: Checkout code
52-
uses: actions/checkout@v4
58+
- uses: actions/checkout@v4
5359

54-
- name: Install Xlings
60+
- name: Install xlings
5561
env:
5662
XLINGS_NON_INTERACTIVE: 1
57-
XLINGS_VERSION: 0.4.31
5863
run: |
5964
TARBALL="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
6065
curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${TARBALL}"
@@ -63,44 +68,117 @@ jobs:
6368
xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true
6469
chmod +x "$EXTRACT_DIR/bin/xlings"
6570
"$EXTRACT_DIR/bin/xlings" self install
66-
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
71+
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
6772
68-
- name: Install Project Dependencies via Xlings
69-
run: |
70-
xlings install
71-
clang --version
73+
- name: Refresh package index
74+
run: xlings update
7275

73-
- name: Configure xmake
74-
run: |
75-
LLVM_ROOT="$HOME/.xlings/data/xpkgs/xim-x-llvm"
76-
LLVM_SDK=$(find "$LLVM_ROOT" -mindepth 1 -maxdepth 1 -type d | sort -V | tail -1)
77-
test -d "$LLVM_SDK"
78-
"$LLVM_SDK/bin/clang++" --version
79-
xmake f -m release --toolchain=llvm --sdk="$LLVM_SDK" -y -vvD
76+
- name: Install workspace tools (.xlings.json -> mcpp ${{ env.MCPP_VERSION }})
77+
run: xlings install -y
8078

81-
- name: Build with xmake
82-
run: xmake -a -j"$(sysctl -n hw.logicalcpu)"
79+
- name: Build with mcpp
80+
run: mcpp build
8381

8482
- name: Verify d2x
8583
run: |
86-
./build/macosx/arm64/release/d2x --version
84+
BIN=$(find target -name d2x -type f | head -1)
85+
test -n "$BIN" || { echo "d2x binary not found"; find target -type f | head -20; exit 1; }
86+
chmod +x "$BIN"
87+
"$BIN" --version
8788
8889
build-windows:
90+
name: build (windows x86_64, mcpp)
8991
runs-on: windows-latest
92+
defaults:
93+
run:
94+
shell: bash
95+
env:
96+
XLINGS_NON_INTERACTIVE: 1
9097
steps:
91-
- name: Checkout code
92-
uses: actions/checkout@v4
98+
- uses: actions/checkout@v4
9399

94-
- name: Setup xmake
95-
uses: xmake-io/github-action-setup-xmake@v1
96-
with:
97-
xmake-version: latest
100+
# Everything in one bash step so the in-process PATH is used directly
101+
# (avoids cross-step PATH translation issues for the msys/Windows mix).
102+
- name: Install xlings and build with mcpp
103+
run: |
104+
set -e
105+
ZIP="xlings-${XLINGS_VERSION}-windows-x86_64.zip"
106+
curl -fSL -o "$RUNNER_TEMP/$ZIP" "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${ZIP}"
107+
unzip -q "$RUNNER_TEMP/$ZIP" -d "$RUNNER_TEMP/xl"
108+
XL=$(find "$RUNNER_TEMP/xl" -name 'xlings.exe' | head -1)
109+
echo "xlings: $XL"
110+
"$XL" self install
111+
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
112+
xlings update
113+
xlings install -y
114+
mcpp build
115+
D2X=$(find target -name 'd2x.exe' -type f | head -1)
116+
test -n "$D2X" || { echo "d2x.exe not found"; find target -type f | head -20; exit 1; }
117+
"$D2X" --version
118+
119+
# Smoke test: a real `d2x checker` run against the d2mcpp course must reach
120+
# and report the FIRST exercise's build error within a bounded window, rather
121+
# than hanging on the init log (issue #24). The checker waits for file edits
122+
# forever, so a timeout kill is the expected, healthy outcome.
123+
checker-smoke:
124+
name: checker smoke (linux)
125+
runs-on: ubuntu-latest
126+
steps:
127+
- uses: actions/checkout@v4
98128

99-
- name: Build with xmake
129+
- name: Install xlings
100130
run: |
101-
xmake f -m release -y
102-
xmake -j$env:NUMBER_OF_PROCESSORS
131+
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
132+
curl -fsSL -o "/tmp/${tarball}" \
133+
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
134+
tar -xzf "/tmp/${tarball}" -C /tmp
135+
"/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install
136+
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
103137
104-
- name: Verify d2x
138+
- name: Refresh package index
139+
run: xlings update
140+
141+
- name: Build d2x with mcpp
142+
run: |
143+
xlings install -y
144+
mcpp build
145+
146+
# Use a real xmake (not the xlings `xmake` shim): d2mcpp's .xlings.json
147+
# pins xmake 3.0.7, which is gone from the registry, so the shim would
148+
# fail to resolve. A standalone xmake ignores .xlings.json. Put it ahead
149+
# of the xlings bin on PATH.
150+
- name: Install xmake
151+
run: |
152+
curl -fsSL https://xmake.io/shget.text | bash
153+
source ~/.xmake/profile 2>/dev/null || true
154+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
155+
"$HOME/.local/bin/xmake" --version
156+
157+
- name: Checkout d2mcpp course
158+
uses: actions/checkout@v4
159+
with:
160+
repository: mcpp-community/d2mcpp
161+
path: d2mcpp
162+
163+
- name: Run d2x checker (must reach first exercise, not hang on load)
105164
run: |
106-
build\windows\x64\release\d2x.exe --version
165+
D2X="$PWD/$(find target -name d2x -type f | head -1)"
166+
test -x "$D2X" || chmod +x "$D2X"
167+
cd d2mcpp
168+
# Force the print UI so output is plain text in a non-TTY runner.
169+
sed -i 's/"ui_backend": *"tui"/"ui_backend": "print"/' .d2x.json || true
170+
xmake f -y
171+
set +e
172+
timeout 120 "$D2X" checker --ui print --lang en > checker.out 2>&1
173+
code=$?
174+
set -e
175+
echo "checker exit=$code (124 = killed by timeout while waiting for edits = expected)"
176+
echo "------------------ checker output (tail) ------------------"
177+
tail -n 40 checker.out || true
178+
echo "-----------------------------------------------------------"
179+
if grep -q "hello-mcpp" checker.out && grep -qiE "error" checker.out; then
180+
echo "OK: checker reached and reported the first exercise (not stuck on the loading log)"
181+
else
182+
echo "FAIL: checker produced no exercise build output within the window (stuck on load?)"
183+
exit 1
184+
fi

.github/workflows/release.yml

Lines changed: 63 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
type: string
1010

1111
env:
12-
XLINGS_VERSION: v0.4.0
12+
XLINGS_VERSION: v0.4.51
1313

1414
jobs:
1515
build-linux:
@@ -36,19 +36,29 @@ jobs:
3636
"$EXTRACT_DIR/bin/xlings" self install
3737
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
3838
39-
- name: Install Project Dependencies via Xlings
40-
run: |
41-
xlings install
39+
- name: Refresh package index
40+
run: xlings update
41+
42+
- name: Install workspace tools (.xlings.json -> mcpp)
43+
run: xlings install -y
44+
45+
- name: Build with mcpp (static)
46+
run: mcpp build --static
4247

43-
- name: Build with xmake
48+
- name: Locate & verify binary
4449
run: |
45-
xmake f -m release -y
46-
xmake -j$(nproc)
50+
BIN=$(find target -name d2x -type f | head -1)
51+
test -n "$BIN" || { echo "d2x binary not found"; find target -type f | head; exit 1; }
52+
chmod +x "$BIN"
53+
ver=$("$BIN" --version)
54+
echo "built d2x version: $ver (release input: ${{ inputs.version }})"
55+
test "$ver" = "${{ inputs.version }}" || { echo "ERROR: binary version ($ver) != release version (${{ inputs.version }})"; exit 1; }
56+
echo "BIN=$BIN" >> "$GITHUB_ENV"
4757
4858
- name: Create release package
4959
run: |
5060
mkdir -p d2x-${{ inputs.version }}-linux-x86_64
51-
cp build/linux/x86_64/release/d2x d2x-${{ inputs.version }}-linux-x86_64/
61+
cp "$BIN" d2x-${{ inputs.version }}-linux-x86_64/
5262
tar -czf d2x-${{ inputs.version }}-linux-x86_64.tar.gz d2x-${{ inputs.version }}-linux-x86_64
5363
5464
- name: Upload artifact
@@ -58,7 +68,9 @@ jobs:
5868
path: d2x-${{ inputs.version }}-linux-x86_64.tar.gz
5969

6070
build-macos:
61-
runs-on: macos-15
71+
# Built on the oldest supported macOS so the artifact also runs on newer
72+
# releases. mcpp manages its own toolchain, so no SDK pinning is needed.
73+
runs-on: macos-14
6274
steps:
6375
- name: Checkout code
6476
uses: actions/checkout@v4
@@ -77,31 +89,29 @@ jobs:
7789
"$EXTRACT_DIR/bin/xlings" self install
7890
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
7991
80-
- name: Install Project Dependencies via Xlings
81-
run: |
82-
xlings install
83-
clang --version
92+
- name: Refresh package index
93+
run: xlings update
8494

85-
- name: Build with xmake
86-
run: |
87-
export LLVM_PREFIX=$HOME/.xlings/data/xpkgs/xim-x-llvm/20.1.7
88-
xmake f -m release --toolchain=llvm --sdk=$LLVM_PREFIX -vv -y
89-
xmake -j$(nproc)
95+
- name: Install workspace tools (.xlings.json -> mcpp)
96+
run: xlings install -y
97+
98+
- name: Build with mcpp
99+
run: mcpp build
90100

91-
- name: Verify no LLVM runtime dependency
101+
- name: Locate & verify binary
92102
run: |
93-
BIN=build/macosx/arm64/release/d2x
94-
if otool -L "$BIN" | grep -q "llvm"; then
95-
otool -L "$BIN"
96-
echo "FAIL: binary links against LLVM dylib"
97-
exit 1
98-
fi
99-
echo "OK: binary has no LLVM runtime dependency"
103+
BIN=$(find target -name d2x -type f | head -1)
104+
test -n "$BIN" || { echo "d2x binary not found"; find target -type f | head; exit 1; }
105+
chmod +x "$BIN"
106+
ver=$("$BIN" --version)
107+
echo "built d2x version: $ver (release input: ${{ inputs.version }})"
108+
test "$ver" = "${{ inputs.version }}" || { echo "ERROR: binary version ($ver) != release version (${{ inputs.version }})"; exit 1; }
109+
echo "BIN=$BIN" >> "$GITHUB_ENV"
100110
101111
- name: Create release package
102112
run: |
103113
mkdir -p d2x-${{ inputs.version }}-macosx-arm64
104-
cp build/macosx/arm64/release/d2x d2x-${{ inputs.version }}-macosx-arm64/
114+
cp "$BIN" d2x-${{ inputs.version }}-macosx-arm64/
105115
tar -czf d2x-${{ inputs.version }}-macosx-arm64.tar.gz d2x-${{ inputs.version }}-macosx-arm64
106116
107117
- name: Upload artifact
@@ -112,25 +122,39 @@ jobs:
112122

113123
build-windows:
114124
runs-on: windows-latest
125+
defaults:
126+
run:
127+
shell: bash
128+
env:
129+
XLINGS_NON_INTERACTIVE: 1
115130
steps:
116131
- name: Checkout code
117132
uses: actions/checkout@v4
118133

119-
- name: Setup xmake
120-
uses: xmake-io/github-action-setup-xmake@v1
121-
with:
122-
xmake-version: latest
123-
124-
- name: Build with xmake
134+
- name: Install xlings and build with mcpp
125135
run: |
126-
xmake f -m release -y
127-
xmake -j$env:NUMBER_OF_PROCESSORS
128-
129-
- name: Create release package
136+
set -e
137+
VERSION_NUM="${XLINGS_VERSION#v}"
138+
ZIP="xlings-${VERSION_NUM}-windows-x86_64.zip"
139+
curl -fSL -o "$RUNNER_TEMP/$ZIP" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${ZIP}"
140+
unzip -q "$RUNNER_TEMP/$ZIP" -d "$RUNNER_TEMP/xl"
141+
XL=$(find "$RUNNER_TEMP/xl" -name 'xlings.exe' | head -1)
142+
"$XL" self install
143+
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
144+
xlings update
145+
xlings install -y
146+
mcpp build
147+
D2X=$(find target -name 'd2x.exe' -type f | head -1)
148+
test -n "$D2X" || { echo "d2x.exe not found"; find target -type f | head; exit 1; }
149+
ver=$("$D2X" --version)
150+
echo "built d2x version: $ver (release input: ${{ inputs.version }})"
151+
test "$ver" = "${{ inputs.version }}" || { echo "ERROR: binary version ($ver) != release version (${{ inputs.version }})"; exit 1; }
152+
mkdir -p "d2x-${{ inputs.version }}-windows-x86_64"
153+
cp "$D2X" "d2x-${{ inputs.version }}-windows-x86_64/"
154+
155+
- name: Zip release package
130156
shell: pwsh
131157
run: |
132-
New-Item -ItemType Directory -Path "d2x-${{ inputs.version }}-windows-x86_64" -Force
133-
Copy-Item "build\windows\x64\release\d2x.exe" -Destination "d2x-${{ inputs.version }}-windows-x86_64\"
134158
Compress-Archive -Path "d2x-${{ inputs.version }}-windows-x86_64" -DestinationPath "d2x-${{ inputs.version }}-windows-x86_64.zip"
135159
136160
- name: Upload artifact

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
build
44
target
55
d2x.zip
6+
mcpp.lock
7+
compile_commands.json

.xlings.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"workspace": {
3-
"mcpp": { "linux": "0.0.13" },
4-
"xmake": "3.0.7",
5-
"gcc": { "linux": "15.1.0" },
6-
"llvm": { "macosx": "20" }
3+
"mcpp": { "linux": "0.0.52", "macosx": "0.0.52", "windows": "0.0.52" }
74
}
85
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
| --- |
1111

1212
```cpp
13-
d2x version: 0.1.4
13+
d2x version: 0.1.5
1414

1515
Usage: $ d2x [command] [target] [options]
1616

mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "d2x"
3-
version = "0.1.2"
3+
version = "0.1.5"
44
description = "AI-powered development assistant for C++ projects"
55
license = "Apache-2.0"
66
repo = "https://github.com/d2learn/d2x"

0 commit comments

Comments
 (0)