Skip to content

SDK: arm64e.x1 backport, darwin SDK republish, SDK canary (#1826) - #1880

Merged
ehartford merged 6 commits into
fix-runnerfrom
fix-sdk
Sep 29, 2026
Merged

ehartford merged 6 commits into
fix-runnerfrom
fix-sdk

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Eric's ruling (2026-09-28): option (a) for #1826.

  • build/sdk.w's source step backports llvm/llvm-project b8007a8e (ARCHINFO arm64e_x1 + CPU_SUBTYPE_ARM64E_X1 = 12), anchored, pinned to LLVM 22.1.6.
  • SDK subprocesses run with the shell's LDFLAGS/CPPFLAGS/*_PATH empty (a package-manager LLVM's libc++ was linked into ninja).
  • with build :sdk-host-link-check + sdk-canary.yml: the pre-stage SDK probe against the newest Xcode SDK, nightly and on request.
  • nightly-release.yml darwin pins bumped to the republished SDK (commit follows).

Draft until the battery is green.

Eric Hartford added 6 commits September 29, 2026 14:40
….1.6 source step (#1826)

Xcode 27's SDK lists the arm64e.x1 slice (CPU_SUBTYPE_ARM64E_X1 = 12) in
every .tbd stub, and TextAPI rejects a stub with a target it cannot
parse, so ld64.lld 22.1.6 could not read libSystem, libc++ or libm. The
upstream fix, "[ld64.lld, llvm-otool] Minimal arm64e.x1 support"
(b8007a8e, main 2026-09-11), is in no release: 22.1.8 and 23.1.2 lack
it and the 23.x backport (llvm/llvm-project#224185) is still open.

The sdk-llvm-source step now inserts the two lines lld needs — the
ARCHINFO(arm64e_x1, arm64e.x1, …) entry in TextAPI/Architecture.def and
CPU_SUBTYPE_ARM64E_X1 = 12 in BinaryFormat/MachO.h — after their exact
anchor lines, on a fresh extraction and on a tree extracted before the
patch existed. A missing or duplicated anchor fails the step; a line
already present is left alone. The patch is pinned to 22.1.6: any other
COMPILER_LLVM_VERSION fails the step until the patch is deleted (an LLVM
that carries b8007a8e) or re-anchored, so it cannot outlive its version.
Refs #1826.
…les empty

CMake folds LDFLAGS, CPPFLAGS, CFLAGS, CXXFLAGS and the *_PATH search
variables from the environment into every compile and link line. On a
shell carrying a package manager's LLVM (LDFLAGS=-L/opt/llvm-22.1.6/lib),
the SDK's ninja linked that LLVM's libc++ ahead of the sysroot's and died
with undefined std::length_error symbols (2026-09-28, while rebuilding
the darwin SDK for #1826). The SDK is built by the tools the graph names
and nothing else: sdk_run_capture now runs every subprocess through a
ProcessSpec that sets those variables empty.
…e SDK, nightly and on request (#1826)

`with build :sdk-host-link-check` runs the probe every compiler build
runs before its stage links (#1840's comp_require_linkable_host_sdk) on
its own, and sdk-canary.yml runs it on macos-latest and on GitHub's
xcode-27 preview image with SDKROOT at the newest MacOSX<ver>.sdk under
/Applications/Xcode*.app (or an SDK given at dispatch). A slice this
LLVM's TextAPI cannot parse fails the lane naming the SDK, the linker
and the rejected stub target, before that SDK is every developer's
default SDKROOT. A canary, not a merge signal (D56).
…20260928-3ae5c9ec0b31 (#1826)

with-llvm-sdk-22.1.6-darwin-aarch64.tar.gz built from source at 3ae5c9e
with the arm64e.x1 backport; its ld64.lld links against Xcode 27's SDK.
sha256 dd824534e89fe9570558036a69fcddfecb6075b0fcad1bfa7f502c67272de7a4.
…he action's input

Under the pinned seed a standalone action in a built tree evaluates at
comptime, where print (generic over Display) does not resolve, so the
check and the source-step backport no longer print; the check writes
"<lld> (LLVM <ver>) reads <sdk>" to its output and the canary lane cats
it. LLVM_PREFIX is now the action's env_input: the check is about one
linker, and pointing at another SDK re-runs it instead of a cache hit
(verified: the pre-backport lld against Xcode 27 fails naming
arm64e.x1-macos; the republished lld passes).
…2fa54a7197df)

The canary workflow this layer adds was written before the seed moved;
seed-driver refused its stale pin in the stack battery.
@ehartford
ehartford marked this pull request as ready for review September 29, 2026 18:57
@ehartford
ehartford merged commit c5c5469 into main Sep 29, 2026
@ehartford
ehartford deleted the fix-sdk branch September 29, 2026 19:03
ehartford added a commit that referenced this pull request Sep 30, 2026
…efuses any other .deps SDK, seed-driver holds the workflow pins to it (#1826) (#1913)

The arm64e.x1 backport (#1880) shipped in a republished darwin SDK, but
nothing told a checkout to use it: `with build :deps` kept whatever SDK a
tree once fetched (it returned early whenever libclang.a existed), and no
file named the SDK the tree is verified with. This host still linked a May
SDK whose ld64.lld cannot read Xcode 27's .tbd stubs.

- sdk.lock: `<asset>.version=` release, `<asset>=` archive sha256, plus the
  sidecar/manifest digests the nightly pins, for every SDK a workflow reads.
- :deps installs the host's pin, checks the download against the lock as
  well as the release sidecar, and stamps .deps/<sdk>/.with-sdk-pin; a lock
  bump refetches, an unchanged pin is a no-op. It prints with print_str:
  the pinned seed's comptime evaluator does not resolve the generic print.
- The link-metadata actions refuse a default .deps SDK whose stamp is not
  the pin, naming both and `with build :deps` (LLVM_PREFIX, which CI sets
  after checking the workflow pin, is taken as named).
- seed-driver refuses while any workflow SDK pin disagrees with sdk.lock.
- lock_value is the one key=value reader for seed.lock and sdk.lock,
  written without trim/index_of so the seed evaluates it at comptime.

The lock caught a second break: the linux-x86_64 SDK asset was replaced in
place on 2026-09-27 and the nightly's pin (c7747403) failed every
linux-x86_64 leg since; the nightly now pins the current asset, which
selfhost-linux builds the compiler with.

Verified: `src/main build` with SDKROOT=…/MacOSX27.0.sdk links stage and
release (-syslibroot MacOSX27.0.sdk) with the pinned SDK (415 s); the stale
.deps SDK is refused with the message above; seed-driver passes, and names
selfhost-linux.yml:41 when that pin is edited.

Co-authored-by: Eric Hartford <[email protected]>
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