web: build the Lately macro plugin on linux (unbreak deploy-web) #31

Merged
founder merged 1 commit from lately-macro-plugin-linux into main 2026-08-16 05:42:12 +00:00
Owner

deploy-web has been red on every push since at least 08-02: lately-macro-plugin used stdenvNoCC and cannot build on linux. Five layered fixes (SDKROOT via a cc-bearing stdenv, CC=clang for swift-syntax C shims, explicit clang resource-dir, no fortify hardening, no strip) — each verified against the real failure on the forge; nix build .#web-container now produces the image.

🤖 Generated with Claude Code

`deploy-web` has been red on every push since at least 08-02: `lately-macro-plugin` used `stdenvNoCC` and cannot build on linux. Five layered fixes (SDKROOT via a cc-bearing stdenv, CC=clang for swift-syntax C shims, explicit clang resource-dir, no fortify hardening, no strip) — each verified against the real failure on the forge; `nix build .#web-container` now produces the image. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
web: build the Lately macro plugin on linux (unbreak deploy-web)
Some checks failed
deploy-web/web-eval-ok web-container drv evaluated
deploy-web/prev-detached paths: /nix/store/d9ni6r8b499437ikdvdd99h75wcmir5w-runtime-deps error: Build failed due to failed dependency
deploy-web/detached-started realization detached
Build: Apple / Check (SwiftLint) (pull_request) Successful in 20s
Build: SQLite SEE / Redacted SEE compile (push) Successful in 30s
Build: KaiOS / Build (KaiOS) (pull_request) Has started running
Build: Web / Build (Web) (pull_request) Has started running
Build: Apple / Build (iOS) (pull_request) Successful in 27s
Build: Apple / Build (visionOS) (pull_request) Successful in 30s
Release: Signing Preflight / Release (Signing Preflight) (push) Successful in 1m2s
Build: Apple / Check (SwiftLint) (push) Successful in 1m55s
Build: Apple / Build (macOS) (pull_request) Successful in 1m47s
Build: Apple / Build (iOS) (push) Successful in 43s
Build: Apple / Build (visionOS) (push) Successful in 24s
Deploy: API / Deploy (API) (push) Successful in 2m54s
Build: Apple / Build (macOS) (push) Successful in 1m46s
Build: Linux / Build (Linux x86_64) (pull_request) Failing after 1m7s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been skipped
deploy-web/detached-done m70vl20i6ia-runtime-deps.drv'... building '/nix/store/1sx09vag1say8h235cjmfz0inaja1jyq-docker-image-key-store-web.tar.gz.drv'...
deploy-web/web-built container built
deploy-web/pipeline-launched detached deploy pipeline started
deploy-web/pipe-start pipeline running detached
deploy-web/pipe-site site built: /nix/store/ifnam3bshvfk780rhk9zggprfliaf68f-key-store-web-site-7171d7a
deploy-web/pipe-smoke site smoke passed
Build: KaiOS / Build (KaiOS) (push) Successful in 32s
Build: Web / Build (Web) (push) Has started running
Build: Linux / Build (Linux x86_64) (push) Failing after 58s
Build: Linux / Build (keystore-forge x86_64) (push) Has been skipped
deploy-web/pipe-pushed image pushed registry.fly.io/key-store-web:7171d7ae0cc54168b3b28d7b3d562063648a4cb5
Deploy: Web / Deploy (Web) (push) Has been cancelled
7171d7ae0c
deploy-web has failed on every push since at least 2026-08-02: .#web-container
-> lately-web-core -> lately-macro-plugin, and the plugin derivation used
stdenvNoCC. On linux that leaves four things missing that the darwin build
gets from Xcode for free, surfacing one at a time:

  * "libc not found for x86_64-unknown-linux-gnu" / "missing required
    module 'SwiftGlibc'": the swift wrapper only synthesizes the glibc SDK
    root (SDKROOT) when NIX_CC is set, i.e. a stdenv with a C compiler.
    Use kaiosCoreStdenv, which already encodes that rule.
  * "gcc: unrecognized command-line option '-target' / '-fblocks'": SwiftPM
    hands swift-syntax's C shim target to $CC, which the gcc stdenv sets to
    gcc. Repoint CC/CXX at the toolchain's clang.
  * "'stddef.h' file not found": that clang is nixpkgs' wrapper, and the
    gcc stdenv has already set NIX_CC_WRAPPER_FLAGS_SET_*, so the wrapper
    skips its own cc-cflags -- including -resource-dir. Pass it explicitly,
    the same value devShells.linux exports as
    KEYSTORE_SWIFT_CLANG_RESOURCE_DIR.
  * "ambiguous use of 'read'": nixpkgs hardening injects -D_FORTIFY_SOURCE
    and glibc's fortified bits/unistd.h declares a second read the Swift
    clang importer cannot disambiguate. hardeningDisable fortify/fortify3.
  * nixpkgs' strip hook then trips over the Swift-linked binary
    ("strip.sh: exit_code: unbound variable"); dontStrip.

Verified end to end on the forge: nix build .#web-container now produces the
docker image.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/key.store!31
No description provided.