Skip to content

fix(ci): ship every Swift runtime library SwiftLint links in ci-base - #5538

Merged
shepherdjerred merged 1 commit into
mainfrom
fix-swiftlint-runtime-libs
Dec 3, 2026
Merged

shepherdjerred merged 1 commit into
mainfrom
fix-swiftlint-runtime-libs

Conversation

@shepherdjerred

Copy link
Copy Markdown
Owner

Why

Maintenance pipeline 20708 (the ci-images stream, blocked since 2026-11-29) fails building docker.io/shepherdjerred/ci-base. After #5389 refreshed the toolchain pins, swiftlint links libswiftObservation.so, which ci/scripts/swiftlint/runtime-libraries.txt does not ship, so the swiftlint-runtime stage's version/capability check exits 127. Nothing caught the gap before the minimal runtime image ran the binary.

What

  • Add libswiftObservation.so and lib_CompilerSwiftWarningControl.so (also linked by the shipped Swift compiler libraries) to runtime-libraries.txt.
  • Add verify-runtime-libraries.py, run in the builder stage right after the libraries are copied. It reads DT_NEEDED with readelf for the swiftlint binary and every shipped library, and fails (printing the exact lines to add) when any Swift toolchain library under /usr/lib/swift, transitively, is linked but not shipped. It sits after the compile layer, so the cached 10 minute compile is unaffected.
  • Add a fake-readelf boundary test (accepted, unshipped, transitive), wired into toolchain.test.sh, and register the new inputs in the ci-base fingerprint, bootstrap.sh and script-migrations.json.
  • The version and capability checks in the runtime stage are unchanged.

Demo

Before (CI pipeline 20708, step 5):

#38 0.399 /opt/swiftlint/bin/swiftlint: error while loading shared libraries: libswiftObservation.so: cannot open shared object file: No such file or directory
#38 ERROR: process "/bin/sh -c chmod 755 /opt/swiftlint/swiftlint ... verify-capabilities.sh ..." did not complete successfully: exit code: 127

The new check against the real swift:6.4.3-jammy builder with the old list (it now names the gap one stage earlier, including the transitive library):

SwiftLint links Swift toolchain libraries that runtime-libraries.txt does not ship. Add these lines to ci/scripts/swiftlint/runtime-libraries.txt:
/usr/lib/swift/host/compiler/lib_CompilerSwiftWarningControl.so
/usr/lib/swift/linux/libswiftObservation.so
exit=1

After (docker buildx build -f ci/ci-image/Dockerfile --target swiftlint-runtime, OrbStack, exit 0):

#22 [swiftlint-builder 10/11] RUN python3 /swiftlint-input/verify-runtime-libraries.py /swiftlint-output/opt/swiftlint /usr/lib/swift
#22 0.256 Every Swift toolchain library linked by SwiftLint is shipped in its runtime.
#29 [swiftlint-runtime 8/9] RUN chmod 755 ... verify-capabilities.sh ...
#29 0.624 SwiftLint 0.65.1: configured rules, SourceKit and unknown-rule rejection verified
$ docker run --rm <local tag> swiftlint --version
0.65.1

Verification

  • Local swiftlint-runtime target build passes (above); the local image tags were deleted afterwards.
  • bash ci/scripts/toolchain.test.sh (includes the new three-case test), bun test ci/scripts/images/build-ci-image.test.ts scripts/renovate-mirrored-pins.test.ts (20 pass), bunx turbo run jscpd quality-ratchet knip --filter=// pass; full lefthook pre-commit passed.
  • Extended tier: no affected workspace has extended steps.
  • Not run: the full ci-base build and push in Woodpecker; the maintenance retry follows the merge.

🤖 Generated with Claude Code

@shepherdjerred

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@greptile-apps

greptile-apps Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@shepherdjerred
shepherdjerred force-pushed the fix-swiftlint-runtime-libs branch from f7216e1 to 92780f3 Compare December 3, 2026 03:25
@shepherdjerred
shepherdjerred marked this pull request as ready for review December 3, 2026 03:26
Why: Maintenance pipeline 20708 (ci-images stream, blocked since 2026-11-29)
failed building docker.io/shepherdjerred/ci-base. After #5389 refreshed the
toolchain pins, the swiftlint-runtime stage exited 127:
`/opt/swiftlint/bin/swiftlint: error while loading shared libraries:
libswiftObservation.so: cannot open shared object file`. The explicit
runtime-libraries.txt list had no entry for it, and nothing caught the gap
until the minimal runtime image ran the binary.

What:
- Add libswiftObservation.so and lib_CompilerSwiftWarningControl.so (also
  linked by the shipped Swift compiler libraries) to
  runtime-libraries.txt.
- Add verify-runtime-libraries.py, run in the builder stage right after the
  libraries are copied. It reads DT_NEEDED with readelf for the swiftlint
  binary and every shipped library and fails, printing the exact lines to add,
  when any Swift toolchain library under /usr/lib/swift (transitively) is
  linked but not shipped. It runs after the compile layer, so the registry
  cache for the 10 minute compile is unaffected.
- Add a fake-readelf boundary test (accepted, unshipped, transitive) wired into
  toolchain.test.sh, and register the new inputs in the ci-base fingerprint,
  bootstrap.sh and script-migrations.json. The version and capability checks
  in the runtime stage are unchanged.

Verification:
- Real swift:6.4.3-jammy builder on OrbStack: the new check on the old list
  fails naming both missing libraries; with the fix it passes.
- `docker buildx build --target swiftlint-runtime` succeeds, including the
  verify-capabilities RUN step, and `swiftlint --version` prints 0.65.1. The
  local tags were deleted afterwards.
- bash ci/scripts/toolchain.test.sh, bun test build-ci-image.test.ts and
  renovate-mirrored-pins.test.ts pass; turbo jscpd quality-ratchet knip
  --filter=// pass.
- Not run: the full ci-base build in Woodpecker (maintenance retry follows the
  merge) and the extended tier (no affected workspace has extended steps).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shepherdjerred
shepherdjerred force-pushed the fix-swiftlint-runtime-libs branch from 92780f3 to b1eeb0c Compare December 3, 2026 05:07
@shepherdjerred

Copy link
Copy Markdown
Owner Author

@codex review

Automated re-review request for b1eeb0c from the CI review gate.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T05:10:14.498551Z b1eeb0c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: b1eeb0cd5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shepherdjerred
shepherdjerred merged commit e8471e9 into main Dec 3, 2026
6 of 8 checks passed
@shepherdjerred
shepherdjerred deleted the fix-swiftlint-runtime-libs branch December 3, 2026 06:12
shepherdjerred added a commit that referenced this pull request Dec 3, 2026
Why
Woodpecker starts a manual pipeline at main's tip, and the config extension
checks out the request's declared verified source (`CI_MAINTENANCE_SOURCE`,
`CI_EXTENDED_SOURCE`) in its place. Every command still saw Woodpecker's
`CI_COMMIT_SHA`, the tip. Maintenance pipeline #21090 cloned 133b052 (the
coordinator's verified source, #5545) while its bootstrap diagnostic,
`toolkit ci maintenance` and any image pin reported e8471e9 (#5538). The
current ci-base and ci-playwright pins record sourceCommit f69a23f although
#19963 built e192613. Push and pull-request pipelines never differed.

What
- Every emitted command container sets `CI_COMMIT_SHA` to the commit its
  workflow checks out. Step environment overrides Woodpecker's metadata, so
  builds, pins and diagnostics name the built commit. Push and PR values are
  unchanged because their checkout commit is Woodpecker's.
- The source-cache clone keeps Woodpecker's value and fails unless its commit
  is that `CI_COMMIT_SHA` or a declared request source.
- `toolkit ci maintenance` reports the declared source a run built as
  `source`, and Woodpecker's tip as `woodpeckerCommit`.

Verification
- New tests: the clone check (`test/checkout/declared.test.ts`), a #21090
  replay through the signed HTTP app, every emitted command's
  `CI_COMMIT_SHA`, and the toolkit's reported source. The extension tests fail
  without the environment change.
- `bunx turbo run typecheck lint test` for the extension and toolkit, root
  `jscpd quality-ratchet knip`, and `bunx lefthook run pre-commit` pass.
- Not run: a live maintenance pipeline on the new extension image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shepherdjerred added a commit that referenced this pull request Dec 3, 2026
Why
Woodpecker starts a manual pipeline at main's tip, and the config extension
checks out the request's declared verified source (`CI_MAINTENANCE_SOURCE`,
`CI_EXTENDED_SOURCE`) in its place. Every command still saw Woodpecker's
`CI_COMMIT_SHA`, the tip. Maintenance pipeline #21090 cloned 133b052 (the
coordinator's verified source, #5545) while its bootstrap diagnostic,
`toolkit ci maintenance` and any image pin reported e8471e9 (#5538). The
current ci-base and ci-playwright pins record sourceCommit f69a23f although
#19963 built e192613. Push and pull-request pipelines never differed.

What
- Every emitted command container sets `CI_COMMIT_SHA` to the commit its
  workflow checks out. Step environment overrides Woodpecker's metadata, so
  builds, pins and diagnostics name the built commit. Push and PR values are
  unchanged because their checkout commit is Woodpecker's.
- The source-cache clone keeps Woodpecker's value and fails unless its commit
  is that `CI_COMMIT_SHA` or a declared request source.
- `toolkit ci maintenance` reports the declared source a run built as
  `source`, and Woodpecker's tip as `woodpeckerCommit`.

Verification
- New tests: the clone check (`test/checkout/declared.test.ts`), a #21090
  replay through the signed HTTP app, every emitted command's
  `CI_COMMIT_SHA`, and the toolkit's reported source. The extension tests fail
  without the environment change.
- `bunx turbo run typecheck lint test` for the extension and toolkit, root
  `jscpd quality-ratchet knip`, and `bunx lefthook run pre-commit` pass.
- Not run: a live maintenance pipeline on the new extension image.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant