Skip to content

Commit 3edf160

Browse files
committed
refactor: use xlings install mcpp@0.0.16 for macOS self-host builds
Now that mcpp@0.0.16 is in xlings-res with the libc++ fix, CI and release workflows can simply: xlings install mcpp → mcpp build No xmake needed — mcpp self-hosts on macOS via xlings ecosystem.
1 parent 57104b7 commit 3edf160

2 files changed

Lines changed: 21 additions & 57 deletions

File tree

.github/workflows/ci-macos.yml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -268,35 +268,15 @@ jobs:
268268
*) echo "FAIL: unexpected platform"; exit 1 ;;
269269
esac
270270
271-
- name: Build mcpp from source (xmake)
271+
- name: Install mcpp@0.0.16 via xlings
272272
run: |
273-
brew install xmake
274-
# Temporary xmake.lua — not committed to repo
275-
cat > /tmp/xmake_bootstrap.lua << 'EOF'
276-
add_rules("mode.release")
277-
set_languages("c++23")
278-
package("cmdline")
279-
set_homepage("https://github.com/mcpplibs/cmdline")
280-
add_urls("https://github.com/mcpplibs/cmdline/archive/refs/tags/$(version).tar.gz")
281-
add_versions("0.0.1", "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0")
282-
on_install(function (package)
283-
import("package.tools.xmake").install(package)
284-
end)
285-
package_end()
286-
add_requires("cmdline 0.0.1")
287-
target("mcpp")
288-
set_kind("binary")
289-
add_files("src/main.cpp")
290-
add_files("src/**.cppm")
291-
add_packages("cmdline")
292-
add_includedirs("src/libs/json")
293-
set_policy("build.c++.modules", true)
294-
EOF
295-
cp /tmp/xmake_bootstrap.lua xmake.lua
296-
xmake f -y -m release --toolchain=llvm --sdk="$LLVM_ROOT"
297-
xmake build -y mcpp
298-
rm -f xmake.lua
299-
MCPP=$(find build -name mcpp -type f -perm +111 | head -1)
300-
test -x "$MCPP"
301-
"$MCPP" --version
302-
echo ":: Build successful!"
273+
xlings install mcpp -y
274+
mcpp --version
275+
276+
- name: Self-host (mcpp builds mcpp)
277+
run: |
278+
mcpp build
279+
SELFHOST=$(find target -path "*/bin/mcpp" | head -1)
280+
test -x "$SELFHOST"
281+
"$SELFHOST" --version
282+
echo ":: Self-host successful!"

.github/workflows/release.yml

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -315,33 +315,17 @@ jobs:
315315
LLVM_ROOT=$(find "$HOME/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang++" | head -1 | xargs dirname | xargs dirname)
316316
echo "LLVM_ROOT=$LLVM_ROOT" >> "$GITHUB_ENV"
317317
318-
- name: Build mcpp (xmake + LLVM)
318+
- name: Install mcpp@0.0.16 via xlings
319319
run: |
320-
brew install xmake
321-
cat > xmake.lua << 'EOF'
322-
add_rules("mode.release")
323-
set_languages("c++23")
324-
package("cmdline")
325-
set_homepage("https://github.com/mcpplibs/cmdline")
326-
add_urls("https://github.com/mcpplibs/cmdline/archive/refs/tags/$(version).tar.gz")
327-
add_versions("0.0.1", "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0")
328-
on_install(function (package)
329-
import("package.tools.xmake").install(package)
330-
end)
331-
package_end()
332-
add_requires("cmdline 0.0.1")
333-
target("mcpp")
334-
set_kind("binary")
335-
add_files("src/main.cpp")
336-
add_files("src/**.cppm")
337-
add_packages("cmdline")
338-
add_includedirs("src/libs/json")
339-
set_policy("build.c++.modules", true)
340-
EOF
341-
xmake f -y -m release --toolchain=llvm --sdk="$LLVM_ROOT"
342-
xmake build -y mcpp
343-
rm -f xmake.lua
344-
MCPP_BIN=$(find build -name mcpp -type f -perm +111 | head -1)
320+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
321+
xlings install mcpp -y
322+
mcpp --version
323+
324+
- name: Build mcpp (self-host)
325+
run: |
326+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
327+
mcpp build
328+
MCPP_BIN=$(find target -path "*/bin/mcpp" | head -1)
345329
test -x "$MCPP_BIN"
346330
file "$MCPP_BIN"
347331
otool -L "$MCPP_BIN"

0 commit comments

Comments
 (0)