Skip to content

ci(release-rust): use clang/lld 21 from apt.llvm.org for xwin cross-build - #99

Merged
emmanuelm41 merged 1 commit into
mainfrom
fix/xwin-clang-bump
Jun 10, 2026
Merged

ci(release-rust): use clang/lld 21 from apt.llvm.org for xwin cross-build#99
emmanuelm41 merged 1 commit into
mainfrom
fix/xwin-clang-bump

Conversation

@emmanuelm41

Copy link
Copy Markdown
Member

Problem

The -pc-windows-msvc release targets built via cargo-xwin have never linked — the release job only runs on tag pushes, so PR CI never exercised them. Both fail in bundled C deps because Ubuntu's default clang-18 mis-compiles them when cross-targeting Windows-msvc:

  • x86_64: zstd-sys's SSE2 intrinsics (_mm_loadu_si128, _mm_cmpeq_epi8, _mm_movemask_epi8, …) are left as undefined symbols → lld-link: undefined symbol.
  • aarch64: the MSVC <intrin.h> is rejected with conflicting types for '__prefetch' (pulled in by zstd-sys and libsqlite3-sys / rusqlite bundled).

Fix

Install clang/lld 21 from apt.llvm.org instead of the distro's clang-18, and repoint the unversioned tool names that cargo-xwin and the ring .S shim resolve via PATH.

Verification

Reproduced locally with a faithful cargo-xwin + xwin-SDK + ring-.S-shim replica of CI, varying only the clang version:

Target clang-18 (CI) clang-22 (local)
x86_64-pc-windows-msvc undefined _mm_* at link ✅ PE32+ x86-64 binary
aarch64-pc-windows-msvc __prefetch conflicting types ✅ PE32+ Aarch64 binary

Scoped to the if: matrix.use_xwin step — only affects Windows-msvc cross-builds.

…uild

Ubuntu's default clang-18 mis-compiles two bundled C deps when
cross-targeting *-pc-windows-msvc via cargo-xwin:

  - x86_64: zstd-sys's SSE2 intrinsics (_mm_loadu_si128, _mm_cmpeq_epi8,
    _mm_movemask_epi8, ...) are left as undefined symbols -> lld-link fails.
  - aarch64: the MSVC <intrin.h> is rejected with 'conflicting types for
    __prefetch' (included by zstd-sys and libsqlite3-sys/rusqlite bundled).

Both Windows release targets have never linked because of this; the
release job only runs on tag pushes so PR CI never exercised it.

Verified locally with a faithful cargo-xwin + xwin-SDK + ring-shim replica:
clang-22 builds BOTH targets to working PE32+ binaries, clang-18 fails both.
Pull a modern clang/lld from apt.llvm.org and repoint the unversioned tool
names cargo-xwin + the ring .S shim resolve via PATH.
@emmanuelm41
emmanuelm41 merged commit 076ee56 into main Jun 10, 2026
1 check passed
@emmanuelm41
emmanuelm41 deleted the fix/xwin-clang-bump branch June 10, 2026 20:53
emmanuelm41 added a commit to kunobi-ninja/kache that referenced this pull request Jun 10, 2026
Cuts rc.3 to re-run the release pipeline against the fixed Windows-msvc
cross toolchain (Zondax/_workflows#99 — clang/lld 21 from apt.llvm.org).
rc.2's Windows builds never linked under the stale distro clang-18.
emmanuelm41 added a commit that referenced this pull request Jun 10, 2026
…#100)

The xwin cross job's build scripts and proc-macros link with `cc` (gcc)
on the Linux runner, separate from the Windows cross compiler. The distro
`clang` install previously pulled gcc in transitively; sourcing clang from
apt.llvm.org (#99) no longer does, and the self-hosted runner ships no gcc,
so host build scripts failed with `linker 'cc' not found` (proc-macro2,
quote). Install build-essential explicitly alongside the cross toolchain.
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