Repository navigation
fix(ci): update LLGo to v1.0.7 - #55
MeteorsLiu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Review summary
Clean, well-scoped CI change. Replacing the ~30-line manual LLGo source checkout + build with the official xgo-dev/setup-llgo@v0.2.0 action is a clear maintainability and CI-time win, and the removal of LLGO_ROOT plus the $RUNNER_TEMP/llgo invocations is complete — no dangling references to the old .llgo path remain. Two small points on the new macOS linker step and the action pin are worth a look; both are minor and non-blocking (see inline comments).
Optional, pre-existing (not introduced by this PR)
LLGO_BUILD_CACHE: 'off'(lines 52-56 and 61-66): now that the from-source LLGo build is gone,llgo testcompilation is the dominant cost of this job, and disabling the build cache forces a full recompile on every run across both matrix OSes. If a cold cache is not strictly required for correctness, consider enabling it; if it is intentional (avoiding stale-artifact flakiness), a one-line comment documenting the tradeoff would help future readers.- Comment at lines 58-60: the "exposes libc++'s C++ ABI … Linux LLVM packages use libstdc++" rationale for the macOS-only
cpp/llvmdemangle test is questionable — the demangle functions actually exercised take/return C strings and do not cross a C++ ABI boundary, and the Unix link config (!windows) is shared by Linux and macOS. Since this PR removed the sibling explanatory comments, it may be worth correcting or trimming this surviving one.
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| - name: Set up LLGo | ||
| uses: xgo-dev/setup-llgo@v0.2.0 |
There was a problem hiding this comment.
Supply-chain: setup-llgo is pinned to a mutable tag, not a commit SHA.
xgo-dev/setup-llgo@v0.2.0 runs in CI with access to the workflow token; a tag can be force-moved upstream to point at different code. This is a mild regression from the step it replaces, which pinned the LLGo checkout to a full commit SHA (ref: 6fc2ef1…). Consider pinning to the commit SHA with a version comment:
uses: xgo-dev/setup-llgo@<commit-sha> # v0.2.0
The toolchain inputs (llgo-version, go-version, llvm-version) stay pinned and the action SHA-256-verifies its own downloads, so residual risk is limited to the action wrapper. Non-blocking.
| go mod edit -require=github.com/xgo-dev/llvm@v0.9.8 | ||
| go mod download github.com/xgo-dev/llvm@v0.9.8 | ||
| go build -tags=dev,byollvm -o "$RUNNER_TEMP/llgo" ./cmd/llgo | ||
| brew install --skip-link lld@23 |
There was a problem hiding this comment.
The lld@23 linker choice here is undocumented, and the version is hardcoded.
setup-llgo@v0.2.0 already installs, force-links, PATH-exposes, and version-verifies lld@<llvm-version> (i.e. lld@22). This step deliberately installs a different major — lld@23 — with --skip-link and points LDFLAGS --ld-path at its ld64.lld, so it is an intentional override of the action's lld@22, not a duplicate. Two suggestions:
- Add a short comment explaining why
lld@23specifically is needed on macOS arm64 over thelld@22the action provides. The surrounding workflow otherwise documents its non-obvious decisions. lld@23is hardcoded and decoupled fromllvm-version: '22'; if LLVM is bumped later, this will not move with it. A co-located note that the two are intentionally independent would help.
Minor: if brew install partially fails, $(brew --prefix lld@23) could resolve without bin/ld64.lld present, and LDFLAGS would silently point at a missing linker, failing later with a less obvious error. A test -x guard on the resolved path would fail fast.
Update native-binding CI to LLGo v1.0.7 through the official
setup-llgoaction so C callback aliases are checked with the compiler fixes included in the release.The implementation includes:
xgo-dev/setup-llgo@v0.2.0with LLGov1.0.7, Go1.27.0and LLVM22.PATHandLLGO_ROOT.--ld-path, while keeping LLVM 22 as the compiler toolchain.X__ComparFnT/size; the GitHub Actions run also passes all four jobs: Ubuntu and macOS LLGo tests, the Go build and the Windows LLVM demangle bridge.Closes #54.
This keeps the CI toolchain update separate from the libc binding PRs and addresses the old compiler's incorrect C callback alias size calculation.