Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/upgrade-llvm/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Download the artifact matching the development machine:

```bash
gh run view <RUN_ID>
gh run download <RUN_ID> -n x64-linux-gnu-releasedbg.tar.xz -D .llvm-download
gh run download <RUN_ID> -n x86_64-unknown-linux-gnu.releasedbg.tar.xz -D .llvm-download
mkdir -p .llvm
tar -xf .llvm-download/x64-linux-gnu-releasedbg.tar.xz -C .llvm
tar -xf .llvm-download/x86_64-unknown-linux-gnu.releasedbg.tar.xz -C .llvm
```

Configure clice to build against it:
Expand Down
42 changes: 16 additions & 26 deletions .github/workflows/build-llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
workflow_dispatch:
inputs:
llvm_version:
description: "LLVM version to build (e.g., 21.1.8)"
description: "LLVM version to build (e.g., 22.1.8)"
required: true
type: string
patch_ref:
description: "clice-llvm ref for patches (default: main). Set to a release tag (e.g., 21.1.8+r2) to reproduce a previous build."
description: "clice-llvm ref for patches (default: main). Set to a release tag (e.g., 22.1.8) to reproduce a previous build."
required: false
default: "main"
type: string
Expand Down Expand Up @@ -64,12 +64,12 @@ jobs:
- os: ubuntu-24.04
llvm_mode: RelWithDebInfo
lto: OFF
target_triple: aarch64-linux-gnu
target_triple: aarch64-unknown-linux-gnu
pixi_env: cross-linux-arm64
- os: ubuntu-24.04
llvm_mode: RelWithDebInfo
lto: ON
target_triple: aarch64-linux-gnu
target_triple: aarch64-unknown-linux-gnu
Comment thread
16bit-ykiko marked this conversation as resolved.
pixi_env: cross-linux-arm64

# Windows arm64 (from x64 windows-2022)
Expand Down Expand Up @@ -155,17 +155,18 @@ jobs:

- name: Clone llvm-project
shell: bash
env:
VERSION: ${{ inputs.llvm_version || '22.1.8' }}
run: |
VERSION="${{ inputs.llvm_version || '21.1.8' }}"
echo "Cloning LLVM ${VERSION}..."
git clone --branch "llvmorg-${VERSION}" --depth 1 https://github.com/llvm/llvm-project.git .llvm

- name: Apply patches
shell: bash
env:
VERSION: ${{ inputs.llvm_version || '22.1.8' }}
REF: ${{ inputs.patch_ref || 'main' }}
run: |
VERSION="${{ inputs.llvm_version || '21.1.8' }}"
REF="${{ inputs.patch_ref || 'main' }}"

if git clone --branch "$REF" --depth 1 https://github.com/clice-io/clice-llvm.git .clice-llvm 2>/dev/null; then
echo "Using patches from clice-llvm@$REF"
else
Expand Down Expand Up @@ -201,32 +202,21 @@ jobs:
- name: Package LLVM install directory
shell: bash
run: |
# Determine platform/arch from target triple or runner OS
if [[ -n "${{ matrix.target_triple }}" ]]; then
case "${{ matrix.target_triple }}" in
x86_64-apple-darwin) PLATFORM="macos"; ARCH="x64" ;;
aarch64-linux-gnu) PLATFORM="linux"; ARCH="arm64" ;;
aarch64-pc-windows-msvc) PLATFORM="windows"; ARCH="arm64" ;;
esac
TRIPLE="${{ matrix.target_triple }}"
else
PLATFORM="linux"; ARCH="x64"
if [[ "${{ matrix.os }}" == windows-* ]]; then
PLATFORM="windows"
elif [[ "${{ matrix.os }}" == macos-* ]]; then
PLATFORM="macos"; ARCH="arm64"
fi
case "${{ matrix.os }}" in
ubuntu-*) TRIPLE="x86_64-unknown-linux-gnu" ;;
macos-*) TRIPLE="aarch64-apple-darwin" ;;
windows-*) TRIPLE="x86_64-pc-windows-msvc" ;;
esac
fi

case "$PLATFORM" in
linux) TOOLCHAIN="gnu" ;;
macos) TOOLCHAIN="clang" ;;
windows) TOOLCHAIN="msvc" ;;
esac
if [[ "${{ matrix.llvm_mode }}" == "Debug" ]]; then MODE_TAG="debug"; else MODE_TAG="releasedbg"; fi
SUFFIX=""
if [[ "${{ matrix.lto }}" == "ON" ]]; then SUFFIX+="-lto"; fi
if [[ "${{ matrix.llvm_mode }}" == "Debug" && "${{ matrix.os }}" != windows-* ]]; then SUFFIX+="-asan"; fi
ARCHIVE="${ARCH}-${PLATFORM}-${TOOLCHAIN}-${MODE_TAG}${SUFFIX}.tar.xz"
ARCHIVE="${TRIPLE}.${MODE_TAG}${SUFFIX}.tar.xz"
Comment thread
16bit-ykiko marked this conversation as resolved.

set -eo pipefail
tar -C .llvm/build-install -cf - . | xz -T0 -9 -c > "${ARCHIVE}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cross-pair.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
target_triple:
required: true
type: string
# Unified arch-os-abi name (e.g. arm64-linux-gnu) used for artifact
# naming; the triple above keeps the compiler's spelling.
# Standard triple (e.g. aarch64-unknown-linux-gnu) used for artifact
# naming; matches the compiler triple.
target_name:
required: true
type: string
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/cross-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@ name: cross-test
on:
workflow_call:

permissions:
contents: read

jobs:
macos-x64:
uses: ./.github/workflows/cross-pair.yml
with:
build_os: macos-15
test_os: macos-15-intel
target_triple: x86_64-apple-darwin
target_name: x64-macos-darwin
asset_name: clice-x64-macos-darwin.tar.gz
target_name: x86_64-apple-darwin
asset_name: clice.x86_64-apple-darwin.tar.gz

linux-arm64:
uses: ./.github/workflows/cross-pair.yml
with:
build_os: ubuntu-24.04
test_os: ubuntu-24.04-arm
target_triple: aarch64-linux-gnu
target_name: arm64-linux-gnu
target_triple: aarch64-unknown-linux-gnu
target_name: aarch64-unknown-linux-gnu
pixi_env: cross-linux-arm64
asset_name: clice-arm64-linux-gnu.tar.gz
asset_name: clice.aarch64-unknown-linux-gnu.tar.gz
Comment thread
16bit-ykiko marked this conversation as resolved.

windows-arm64:
uses: ./.github/workflows/cross-pair.yml
with:
build_os: windows-2025
test_os: windows-11-arm
target_triple: aarch64-pc-windows-msvc
target_name: arm64-windows-msvc
asset_name: clice-arm64-windows-msvc.zip
target_name: aarch64-pc-windows-msvc
asset_name: clice.aarch64-pc-windows-msvc.zip
pixi_env: cross-windows-arm64
12 changes: 6 additions & 6 deletions .github/workflows/native-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
# release artifacts once their test suites pass.
- os: windows-2025
build_type: RelWithDebInfo
asset_name: clice-x64-windows-msvc.zip
target_name: x64-windows-msvc
asset_name: clice.x86_64-pc-windows-msvc.zip
target_name: x86_64-pc-windows-msvc
- os: ubuntu-24.04
build_type: Debug
- os: ubuntu-24.04
build_type: RelWithDebInfo
asset_name: clice-x64-linux-gnu.tar.gz
target_name: x64-linux-gnu
asset_name: clice.x86_64-unknown-linux-gnu.tar.gz
target_name: x86_64-unknown-linux-gnu
- os: macos-15
build_type: Debug
- os: macos-15
build_type: RelWithDebInfo
asset_name: clice-arm64-macos-darwin.tar.gz
target_name: arm64-macos-darwin
asset_name: clice.aarch64-apple-darwin.tar.gz
target_name: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
for RUN in $(gh run list --repo "$GITHUB_REPOSITORY" --workflow main \
--branch main --event push --status success --limit 100 \
--json databaseId -q '.[].databaseId'); do
LIVE=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN/artifacts?name=package-clice-x64-linux-gnu.tar.gz" \
LIVE=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN/artifacts?name=package-clice.x86_64-unknown-linux-gnu.tar.gz" \
--jq '[.artifacts[] | select(.expired | not)] | length')
if [ "$LIVE" -gt 0 ]; then
COMMIT=$(gh run view "$RUN" --repo "$GITHUB_REPOSITORY" \
Expand Down Expand Up @@ -130,17 +130,17 @@ jobs:
echo "| Platform | Server | VS Code extension | Symbols |"
echo "| --- | --- | --- | --- |"
row() {
PKG="clice-$2.$3"
SYM="clice-$2.symbols.$4"
VSIX="clice-$5-$V.vsix"
PKG="clice-$V.$2.$3"
SYM="clice-$V.$2.symbols.$4"
VSIX="clice-$V.$2.vsix"
echo "| $1 | [$PKG]($URL/$PKG) | [$VSIX]($URL/$VSIX) | [$SYM]($URL/$SYM) |"
}
row "Linux x64" x64-linux-gnu tar.gz tar.xz linux-x64
row "Linux arm64" arm64-linux-gnu tar.gz tar.xz linux-arm64
row "macOS arm64" arm64-macos-darwin tar.gz tar.xz darwin-arm64
row "macOS x64" x64-macos-darwin tar.gz tar.xz darwin-x64
row "Windows x64" x64-windows-msvc zip zip win32-x64
row "Windows arm64" arm64-windows-msvc zip zip win32-arm64
row "Linux x64" x86_64-unknown-linux-gnu tar.gz tar.xz
row "Linux arm64" aarch64-unknown-linux-gnu tar.gz tar.xz
row "macOS arm64" aarch64-apple-darwin tar.gz tar.xz
row "macOS x64" x86_64-apple-darwin tar.gz tar.xz
row "Windows x64" x86_64-pc-windows-msvc zip zip
row "Windows arm64" aarch64-pc-windows-msvc zip zip
echo
echo "Symbol packages hold GSYM data for crash log symbolization"
echo "via \`scripts/symbolize.py\`. VS Code users on the Marketplace"
Expand Down
81 changes: 52 additions & 29 deletions .github/workflows/publish-clice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,24 @@ jobs:
fi
# A green run may still have nothing to promote: path-filtered
# runs (e.g. docs-only commits) skip the build jobs, and package
# artifacts expire after 30 days. Fail here with one clear message
# instead of in six download jobs.
LIVE=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/artifacts?name=package-clice-x64-linux-gnu.tar.gz" \
--jq '[.artifacts[] | select(.expired | not)] | length')
if [ "$LIVE" -eq 0 ]; then
echo "::error::run $RUN_ID for $TAG has no live package artifacts (path-filtered build, or expired after 30 days) — rerun that commit's main workflow first"
# artifacts expire after 30 days. Check every package here so a
# partial run fails with one clear message before any asset is
# uploaded, instead of promoting an incomplete release.
MISSING=""
for NAME in package-clice.x86_64-unknown-linux-gnu.tar.gz \
package-clice.aarch64-unknown-linux-gnu.tar.gz \
package-clice.aarch64-apple-darwin.tar.gz \
package-clice.x86_64-apple-darwin.tar.gz \
package-clice.x86_64-pc-windows-msvc.zip \
package-clice.aarch64-pc-windows-msvc.zip; do
LIVE=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/artifacts?name=$NAME" \
--jq '[.artifacts[] | select(.expired | not)] | length')
if [ "$LIVE" -eq 0 ]; then
MISSING="$MISSING $NAME"
fi
done
if [ -n "$MISSING" ]; then
echo "::error::run $RUN_ID for $TAG is missing live package artifacts:$MISSING (path-filtered build, or expired after 30 days) — rerun that commit's main workflow first"
exit 1
fi
echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT"
Expand All @@ -70,18 +82,24 @@ jobs:
fail-fast: false
matrix:
include:
- asset_name: clice-x64-linux-gnu.tar.gz
symbol_asset_name: clice-x64-linux-gnu.symbols.tar.xz
- asset_name: clice-arm64-linux-gnu.tar.gz
symbol_asset_name: clice-arm64-linux-gnu.symbols.tar.xz
- asset_name: clice-arm64-macos-darwin.tar.gz
symbol_asset_name: clice-arm64-macos-darwin.symbols.tar.xz
- asset_name: clice-x64-macos-darwin.tar.gz
symbol_asset_name: clice-x64-macos-darwin.symbols.tar.xz
- asset_name: clice-x64-windows-msvc.zip
symbol_asset_name: clice-x64-windows-msvc.symbols.zip
- asset_name: clice-arm64-windows-msvc.zip
symbol_asset_name: clice-arm64-windows-msvc.symbols.zip
- triple: x86_64-unknown-linux-gnu
ext: tar.gz
symbol_ext: tar.xz
- triple: aarch64-unknown-linux-gnu
ext: tar.gz
symbol_ext: tar.xz
- triple: aarch64-apple-darwin
ext: tar.gz
symbol_ext: tar.xz
- triple: x86_64-apple-darwin
ext: tar.gz
symbol_ext: tar.xz
- triple: x86_64-pc-windows-msvc
ext: zip
symbol_ext: zip
- triple: aarch64-pc-windows-msvc
ext: zip
symbol_ext: zip
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -92,35 +110,40 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run download "${{ needs.locate.outputs.run_id }}" \
--repo "$GITHUB_REPOSITORY" -n "package-${{ matrix.asset_name }}" -D pkg
--repo "$GITHUB_REPOSITORY" -n "package-clice.${{ matrix.triple }}.${{ matrix.ext }}" -D pkg

- name: Upload assets to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
VERSION="${RELEASE_TAG#v}"
ASSET="clice-${VERSION}.${{ matrix.triple }}.${{ matrix.ext }}"
SYMBOL_ASSET="clice-${VERSION}.${{ matrix.triple }}.symbols.${{ matrix.symbol_ext }}"
cd pkg
mv clice.tar.gz "${{ matrix.asset_name }}" 2>/dev/null || mv clice.zip "${{ matrix.asset_name }}"
mv clice-symbol.tar.xz "${{ matrix.symbol_asset_name }}" 2>/dev/null \
|| mv clice-symbol.zip "${{ matrix.symbol_asset_name }}"
mv clice.tar.gz "$ASSET" 2>/dev/null || mv clice.zip "$ASSET"
mv clice-symbol.tar.xz "$SYMBOL_ASSET" 2>/dev/null \
|| mv clice-symbol.zip "$SYMBOL_ASSET"
gh release upload "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
--clobber "${{ matrix.asset_name }}" "${{ matrix.symbol_asset_name }}"
--clobber "$ASSET" "$SYMBOL_ASSET"

# Bridge for publish-vscode.yml: make the package available as an
# artifact of the current run, with the original inner file names the
# Bridge for publish-vscode.yml: restore the inner file names the
# staging step expects.
- name: Restore inner file names
env:
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
VERSION="${RELEASE_TAG#v}"
cd pkg
case "${{ matrix.asset_name }}" in
*.zip) mv "${{ matrix.asset_name }}" clice.zip ;;
*) mv "${{ matrix.asset_name }}" clice.tar.gz ;;
case "${{ matrix.ext }}" in
zip) mv "clice-${VERSION}.${{ matrix.triple }}.zip" clice.zip ;;
*) mv "clice-${VERSION}.${{ matrix.triple }}.tar.gz" clice.tar.gz ;;
esac

- name: Re-upload package artifact
uses: actions/upload-artifact@v7
with:
name: package-${{ matrix.asset_name }}
name: package-clice.${{ matrix.triple }}.${{ matrix.ext }}
path: |
pkg/clice.tar.gz
pkg/clice.zip
Expand Down
Loading
Loading