Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ac09151
chore: use umbrella targets for LLVM distribution components
16bit-ykiko Jun 6, 2026
9475574
fix: reduce LLVM_TARGETS_TO_BUILD to X86;AArch64;ARM;RISCV
16bit-ykiko Jun 6, 2026
28e959b
fix: free disk space on macOS runners before LLVM build
16bit-ykiko Jun 6, 2026
23f06bd
ci: add temporary workflow to test macOS disk cleanup
16bit-ykiko Jun 6, 2026
7d866c5
ci(temp): test macOS disk cleanup only
16bit-ykiko Jun 6, 2026
b8a7728
ci: restore full build matrix and remove test workflow
16bit-ykiko Jun 6, 2026
dfdd568
chore: adapt codebase to LLVM 22.1.4 API changes
16bit-ykiko Jun 6, 2026
d62c97f
ci: add prune-llvm workflow for discovering unused LLVM libraries
16bit-ykiko Jun 6, 2026
34d14b7
fix(prune): record file sizes during discover and fix skip-pattern
16bit-ykiko Jun 6, 2026
7a11590
refactor(cmake): switch to find_package(LLVM/Clang) for dependency re…
16bit-ykiko Jun 6, 2026
1c15285
fix(prune): nullify shared libs and force relink during discovery
16bit-ykiko Jun 6, 2026
ada86a6
fix(prune): replace pruned libs with empty archives and track shared …
16bit-ykiko Jun 6, 2026
5192582
ci: add release-llvm workflow and rewrite cmake download
16bit-ykiko Jun 6, 2026
3045ecd
ci: add push trigger for release-llvm on feature branch
16bit-ykiko Jun 6, 2026
7db6205
refactor: rename prune script to release-llvm and add parallel repackage
16bit-ykiko Jun 6, 2026
b3336a6
ci: split repackage into parallel matrix jobs with direct release upload
16bit-ykiko Jun 6, 2026
e2aa166
fix(release): use xz -6 compression to keep assets under 2GB limit
16bit-ykiko Jun 6, 2026
0b5ca40
fix(release): use xz -6 compression to keep assets under 2GB limit
16bit-ykiko Jun 6, 2026
f914f01
fix(release): retry with xz -9 when artifact exceeds 2GB limit
16bit-ykiko Jun 6, 2026
4d5d495
refactor(release): use xz -9 compression and key-based manifest format
16bit-ykiko Jun 7, 2026
baef44d
refactor(release): use xz -9e extreme compression for maximum ratio
16bit-ykiko Jun 7, 2026
134ae3f
chore: update llvm-manifest.json to 22.1.4
16bit-ykiko Jun 7, 2026
703abf3
chore: remove unused setup-llvm.py
16bit-ykiko Jun 8, 2026
c2e63ed
fix: address review findings for LLVM 22 upgrade
16bit-ykiko Jun 9, 2026
a82b737
fix: address second round of review findings
16bit-ykiko Jun 9, 2026
24b1027
chore: strip build-llvm.yml to LLVM-only build
16bit-ykiko Jun 9, 2026
ce81958
fix: add clangOptions to link deps and apply formatting
16bit-ykiko Jun 9, 2026
7a2c122
chore: remove dead upload-llvm workflow and scripts
16bit-ykiko Jun 9, 2026
f795e23
fix: complete LLVM 22 API adaptation after rebase
16bit-ykiko Jun 29, 2026
e189369
fix: update llvm-manifest.json with correct LLVM 22.1.4 hashes
16bit-ykiko Jun 29, 2026
a1cad55
fix: remove heuristic resolver call on dependent TSTs in find_target
16bit-ykiko Jun 29, 2026
c56f358
fix: preserve project VFS when no remapped files are configured
16bit-ykiko Jun 29, 2026
5e181aa
test(usr): verify InjectedClassNameType USR consistency
16bit-ykiko Jun 30, 2026
8c0ccc9
fix(hover): avoid double struct/class prefix in type display
16bit-ykiko Jun 30, 2026
28532fc
docs: add LLVM 21→22 API changelog with commit references
16bit-ykiko Jun 30, 2026
a3e4f27
docs: reorganize LLVM upgrade workflow and changelog
16bit-ykiko Jun 30, 2026
3222201
docs: consolidate LLVM changelog and make upgrade workflow a skill
16bit-ykiko Jun 30, 2026
3ce678e
docs: remove merge step from upgrade-llvm skill
16bit-ykiko Jun 30, 2026
055dcbc
docs: add user confirmation step to upgrade-llvm workflow
16bit-ykiko Jun 30, 2026
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
137 changes: 137 additions & 0 deletions .claude/commands/upgrade-llvm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
Upgrade LLVM to a new version. Accepts the target version as argument (e.g., `22.1.4`).

This is the complete workflow for upgrading the LLVM prebuilt packages that clice depends on. Follow each step in order. Steps that involve CI should use polling (check every ~5 minutes) to wait for completion.

## Step 1: Trigger LLVM Build

Trigger the `build-llvm` workflow on GitHub Actions:

```bash
gh workflow run build-llvm.yml \
--field llvm_version="<VERSION>" \
--field skip_clice_build=true
```

- `skip_clice_build=true`: new LLVM APIs likely have breaking changes, skip clice compilation
- Poll until all 14 matrix builds complete (~2-3 hours), note the workflow run ID

## Step 2: Download Local Platform Artifact

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
mkdir -p .llvm
tar -xf .llvm-download/x64-linux-gnu-releasedbg.tar.xz -C .llvm
```

Configure clice to build against it:

```bash
pixi run cmake-config RelWithDebInfo ON -- "-DLLVM_INSTALL_PATH=.llvm/build-install"
pixi run cmake-build RelWithDebInfo
```

Compilation will likely fail — that's what Step 3 addresses.

## Step 3: Adapt API Changes

Fix LLVM API breaking changes based on compilation errors. Common categories:

- **Header path changes**: e.g., `clang/Driver/Options.h` → `clang/Options/Options.h`
- **Namespace migrations**: e.g., `clang::driver::options` → `clang::options`
- **Type system changes**: e.g., ElaboratedType removal, NestedNameSpecifier pointer→value
- **Function signature changes**: e.g., `createDiagnostics` parameter changes
- **Type merges/splits**: e.g., DependentTemplateSpecializationType → TemplateSpecializationType

Strategy:

1. Fix header/namespace changes first (mechanical)
2. Fix type system and signature changes (requires understanding semantics)
3. Update test expectations (AST structure changes affect test output)
4. Ensure `pixi run unit-test RelWithDebInfo` passes

When a fix is not obvious, read the LLVM source code to understand the new API. If `../llvm-project` exists locally, use it. Otherwise, look up the upstream commit/PR on GitHub.

## Step 4: Create PR

```bash
git checkout -b chore/upgrade-llvm-XX
git add -A
git commit -m "chore: upgrade LLVM to XX.Y.Z"
git push -u origin chore/upgrade-llvm-XX
gh pr create --title "chore: upgrade LLVM to XX.Y.Z" --body "..."
```

CI will fail at this point (manifest hashes are stale) — this is expected.

## Step 5: Run Release LLVM Workflow

Trigger `release-llvm` to build pruned packages:

```bash
gh workflow run release-llvm.yml \
--field source_run_id="<STEP1_RUN_ID>" \
--field llvm_version="<VERSION>"
```

This will: discover unused libs → create clice-llvm release → repackage with pruning → upload manifest. Poll until complete.

## Step 6: Update Manifest

```bash
gh run list --workflow release-llvm.yml --limit 1
gh run download <RELEASE_RUN_ID> -n llvm-manifest-final -D .
python3 scripts/update-llvm-version.py \
--version "<VERSION>" \
--manifest-src llvm-manifest.json \
--manifest-dest config/llvm-manifest.json \
--package-cmake cmake/package.cmake
git add config/llvm-manifest.json cmake/package.cmake
git commit -m "chore: update llvm-manifest.json to <VERSION>"
git push
```

Poll CI until all platforms pass.

## Step 7: Write LLVM Changelog (REQUIRED)

**Every LLVM upgrade MUST append to `docs/en/changelog/llvm-changelog.md`.**

Add a new H1 section (e.g., `# LLVM 22 → 23`) documenting all breaking changes encountered. For each API change, record:

- Change description
- Upstream commit hash
- PR number (link to `https://github.com/llvm/llvm-project/pull/<NUM>`)
- Impact on clice

To find upstream commits, search the LLVM git history between version tags:

```bash
# If ../llvm-project exists locally:
cd ../llvm-project
git log --oneline llvmorg-<OLD>..llvmorg-<NEW> -- clang/include/clang/AST/
```

If the LLVM source is not available locally, look up changes on GitHub by searching the LLVM repository commit history.

Group changes by category (Type System, NNS, Driver/Frontend, Other) with a table per category. See the existing `LLVM 21 → 22` section as a template.

## Step 8: Report to User

Present a summary to the user and **wait for confirmation** before considering the upgrade complete. The summary should include:

- All API changes that were adapted and how they were resolved
- All test expectation changes (snapshot updates, assertion value changes) and why
- Any unavoidable behavior changes from upstream LLVM (e.g., TypePrinter output differences, type sugar changes) that affect user-visible features like hover
- The LLVM changelog that was written

The user decides whether all changes are acceptable or if adjustments are needed. Do NOT push final changes or mark the work as done until the user confirms.

## Notes

- **Artifact size limit**: GitHub Release max 2GB per file. macOS LTO artifacts are largest, currently ~1.7GB with xz -9e.
- **Pruning safety**: discover phase validates by deleting .a files one by one and rebuilding clice. clang-tidy modules can't be deleted due to force-link.
- **Version cache**: cmake download logic writes `.llvm/.llvm-version` stamp, auto-cleans on version change.
- **Private headers**: clice depends on private Clang Sema headers (TreeTransform.h etc.), copied from source during `build-llvm.py`. Users must use our packaged LLVM.
Loading