Skip to content

Commit 072c25a

Browse files
committed
release: v0.0.17 — macOS self-host via xlings mcpp@0.0.16
- Bump version to 0.0.17 - .xlings.json: mcpp 0.0.16 (macOS-capable bootstrap) - flags.cppm: explicitly link libc++ on macOS for Clang toolchain - ci-macos.yml: use `xlings install mcpp` + `mcpp build` (self-host) - release.yml: macOS job uses xlings mcpp to self-host build
1 parent a6cd836 commit 072c25a

5 files changed

Lines changed: 30 additions & 36 deletions

File tree

.github/workflows/ci-macos.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,23 +268,15 @@ jobs:
268268
*) echo "FAIL: unexpected platform"; exit 1 ;;
269269
esac
270270
271-
- name: Install xmake (for bootstrap)
271+
- name: Install mcpp@0.0.16 via xlings
272272
run: |
273-
brew install xmake
274-
xmake --version
275-
276-
- name: Bootstrap mcpp from source (xmake)
277-
run: |
278-
export LLVM_ROOT="$LLVM_ROOT"
279-
bash scripts/bootstrap-macos.sh "$LLVM_ROOT"
280-
./target/bootstrap/bin/mcpp --version
273+
xlings install mcpp -y
274+
mcpp --version
281275
282276
- name: Self-host (mcpp builds mcpp)
283277
run: |
284-
# Put bootstrapped mcpp on PATH so build.ninja can find it for dyndep
285-
export PATH="$PWD/target/bootstrap/bin:$PATH"
286278
mcpp build
287-
SELFHOST=$(find target -path "*/bin/mcpp" -not -path "*/bootstrap/*" -not -path "*/build/*" | head -1)
279+
SELFHOST=$(find target -path "*/bin/mcpp" | head -1)
288280
test -x "$SELFHOST"
289281
"$SELFHOST" --version
290282
echo ":: Self-host successful!"

.github/workflows/release.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -315,22 +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: Install xmake (for bootstrap)
319-
run: brew install xmake
320-
321-
- name: Bootstrap-compile mcpp (xmake + LLVM)
318+
- name: Install mcpp@0.0.16 via xlings
322319
run: |
323-
export LLVM_ROOT="$LLVM_ROOT"
324-
bash scripts/bootstrap-macos.sh "$LLVM_ROOT"
325-
./target/bootstrap/bin/mcpp --version
320+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
321+
xlings install mcpp -y
322+
mcpp --version
326323
327-
- name: Self-host rebuild (mcpp builds mcpp)
324+
- name: Build mcpp (self-host)
328325
run: |
329-
# Put bootstrapped mcpp on PATH so build.ninja can find it for dyndep
330-
export PATH="$PWD/target/bootstrap/bin:$PATH"
326+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
331327
mcpp build
332-
# Find the self-hosted binary
333-
SELFHOST=$(find target -path "*/bin/mcpp" -not -path "*/bootstrap/*" -not -path "*/build/*" | head -1)
328+
SELFHOST=$(find target -path "*/bin/mcpp" | head -1)
334329
test -x "$SELFHOST"
335330
"$SELFHOST" --version
336331
echo "SELFHOST=$SELFHOST" >> "$GITHUB_ENV"
@@ -339,8 +334,8 @@ jobs:
339334
id: stage
340335
run: |
341336
VERSION="${{ steps.resolve.outputs.version }}"
342-
TARBALL_NAME="mcpp-${VERSION}-darwin-arm64.tar.gz"
343-
WRAPPER="mcpp-${VERSION}-darwin-arm64"
337+
TARBALL_NAME="mcpp-${VERSION}-macosx-arm64.tar.gz"
338+
WRAPPER="mcpp-${VERSION}-macosx-arm64"
344339
345340
# Create release layout
346341
STAGING=$(mktemp -d)
@@ -371,10 +366,10 @@ jobs:
371366
mkdir -p dist
372367
(cd "$STAGING" && tar -czf "$GITHUB_WORKSPACE/dist/${TARBALL_NAME}" "$WRAPPER")
373368
# Versionless alias
374-
cp "dist/${TARBALL_NAME}" "dist/mcpp-darwin-arm64.tar.gz"
369+
cp "dist/${TARBALL_NAME}" "dist/mcpp-macosx-arm64.tar.gz"
375370
# SHA256
376371
(cd dist && shasum -a 256 "${TARBALL_NAME}" > "${TARBALL_NAME}.sha256")
377-
(cd dist && shasum -a 256 "mcpp-darwin-arm64.tar.gz" > "mcpp-darwin-arm64.tar.gz.sha256")
372+
(cd dist && shasum -a 256 "mcpp-macosx-arm64.tar.gz" > "mcpp-macosx-arm64.tar.gz.sha256")
378373
379374
echo "tarball=${TARBALL_NAME}" >> "$GITHUB_OUTPUT"
380375
ls -la dist/
@@ -394,7 +389,7 @@ jobs:
394389
with:
395390
tag_name: ${{ steps.resolve.outputs.tag }}
396391
files: |
397-
dist/mcpp-${{ steps.resolve.outputs.version }}-darwin-arm64.tar.gz
398-
dist/mcpp-${{ steps.resolve.outputs.version }}-darwin-arm64.tar.gz.sha256
399-
dist/mcpp-darwin-arm64.tar.gz
400-
dist/mcpp-darwin-arm64.tar.gz.sha256
392+
dist/mcpp-${{ steps.resolve.outputs.version }}-macosx-arm64.tar.gz
393+
dist/mcpp-${{ steps.resolve.outputs.version }}-macosx-arm64.tar.gz.sha256
394+
dist/mcpp-macosx-arm64.tar.gz
395+
dist/mcpp-macosx-arm64.tar.gz.sha256

.xlings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"workspace": {
3-
"mcpp": "0.0.9",
3+
"mcpp": "0.0.16",
44
"xmake": "3.0.7"
55
}
66
}

mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mcpp"
3-
version = "0.0.16"
3+
version = "0.0.17"
44
description = "Modern C++ build & package management tool"
55
license = "Apache-2.0"
66
authors = ["mcpp-community"]

src/build/flags.cppm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,15 @@ CompileFlags compute_flags(const BuildPlan& plan) {
161161
runtime_dirs += " -L" + escape_path(dir);
162162
runtime_dirs += " -Wl,-rpath," + escape_path(dir);
163163
}
164-
f.ld = std::format("{}{}{}{}{}", full_static, static_stdlib, sysroot_flag, b_flag,
165-
runtime_dirs);
164+
#if defined(__APPLE__)
165+
// macOS: explicitly link libc++ when using Clang with xlings LLVM.
166+
// The cfg's -nostdinc++ suppresses the implicit -lc++ that clang++ normally adds.
167+
std::string stdlib_link = isClang ? " -lc++" : "";
168+
#else
169+
std::string stdlib_link;
170+
#endif
171+
f.ld = std::format("{}{}{}{}{}{}", full_static, static_stdlib, sysroot_flag, b_flag,
172+
runtime_dirs, stdlib_link);
166173

167174
return f;
168175
}

0 commit comments

Comments
 (0)