Skip to content

ci: hold llama.cpp builds at Rust 1.99; Cargo 1.100's build-dir layout breaks them - #482

Merged
bmachek merged 1 commit into
mainfrom
fix/ci-llamacpp-rust-1.99
Nov 13, 2026
Merged

bmachek merged 1 commit into
mainfrom
fix/ci-llamacpp-rust-1.99

Conversation

@bmachek

@bmachek bmachek commented Nov 13, 2026

Copy link
Copy Markdown
Member

What broke

The v3.7.0 release failed on every build that compiles llama.cpp as shared libraries: Windows x64, Docker vulkan x64 and Docker cuda x64 (run 43443281904). All three panic in the same place:

llama-cpp-sys-2-0.1.156/build.rs:1431:56:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, ... }

Why

Rust 1.100.0 (released 2026-11-12, picked up through stable / rust:1-trixie) stabilised Cargo's new build-dir layout: build-script output moved from build/<crate>-<hash>/out to build/<crate>/<hash>/out. llama-cpp-sys-2's get_cargo_target_dir() walks a fixed three levels up from OUT_DIR, so it now lands on target/release/build and panics hard-linking its shared libs into target/release/build/deps, which does not exist. Only dynamic-backends/shared-lib builds take that path, which is why vulkan aarch64 (statically linked) passed. v3.6.0 built on 1.99 with the same pinned 0.1.156.

  • Upgrading does not help: the latest llama-cpp-sys-2 (0.1.161) has the same code.
  • Cargo has no switch back to the old layout.
  • Our own packaging assumes the old layout too: the Dockerfile globs build/llama-cpp-sys-2-*/out/{lib,lib64,backends}, and release.yml takes llama.dll/ggml*.dll from target/release, where build.rs used to link them.

Change

Hold the toolchain at 1.99 for these builds, with the reason and the unpin checklist next to each pin:

  • server-rs/Dockerfile: ARG RUST_VERSION=1.99, used by the shared rust:${RUST_VERSION}-trixie stage.
  • release.yml: rust_toolchain per matrix leg ('1.99' for Windows, stable for macOS). Also names components: clippy, because the action installs with --profile minimal and a pinned version is a fresh install.
  • Dev-Build-Environment-Setup.md: Windows llamacpp builds use cargo +1.99, since local builds hit the same panic.
  • server-rs/README.md (and its generated wiki page): builder image named.

Trade-off: PR CI stays on stable, so code that needs Rust 1.100 would pass PR checks and only fail on the Windows release leg. The workspace builds on 1.99.1 today.

Testing

  • check-docs.py and the pre-commit hooks pass; release.yml parses with the intended matrix values.
  • This PR triggers docker-images.yml (Dockerfile changed), which builds the vulkan/cuda x64 images on 1.99.
  • The Windows leg only runs from release.yml; v3.7.1 will exercise it.

Docs-Reviewed: Help-Docker-GPU.md (still accurate; the toolchain is not a build arg users set)

🤖 Generated with Claude Code

https://claude.ai/code/session_01HaMMvthhWBNXkrgY4AzYiH

…t breaks them

Rust 1.100.0 stabilised Cargo's new build-dir layout, which puts build-script
output one directory deeper (build/<crate>/<hash>/out instead of
build/<crate>-<hash>/out). llama-cpp-sys-2's build.rs, up to the latest
0.1.161, finds the target dir by walking three levels up from OUT_DIR, so it
now lands on target/release/build and panics hard-linking its shared libs into
a deps/ directory that is not there (build.rs:1431, NotFound). Only builds
that produce shared libs take that path: the Windows release and the x64
vulkan/cuda Docker images (dynamic-backends), which is why v3.7.0 failed there
and vulkan aarch64 passed.

The packaging behind those builds assumes the old layout as well (the
Dockerfile globs build/llama-cpp-sys-2-*/out, release.yml takes the DLLs from
where build.rs used to link them), and Cargo has no switch back, so the
toolchain is held at 1.99 for these builds rather than patched around:

- Dockerfile: ARG RUST_VERSION=1.99 for the shared rust:<v>-trixie stage
- release.yml: rust_toolchain per matrix leg, 1.99 for Windows, stable for
  macOS; clippy named explicitly, since a pinned toolchain is a fresh
  --profile minimal install
- Dev-Build-Environment-Setup: Windows llamacpp builds use cargo +1.99

Docs-Reviewed: Help-Docker-GPU.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaMMvthhWBNXkrgY4AzYiH
@bmachek
bmachek merged commit 7d01e0f into main Nov 13, 2026
9 checks passed
@bmachek
bmachek deleted the fix/ci-llamacpp-rust-1.99 branch November 13, 2026 17:53
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