Conversation
`nix build .#larql` fails on current main. Three independent causes,
each verified in isolation rather than fixed by pattern-matching.
1. cargoPatches no longer applies — and is no longer needed.
Every hunk of use-system-protoc.patch fails: upstream moved
protobuf-src to [target.'cfg(not(windows))'.build-dependencies] and
rewrote the build.rs files into a set_protoc() cfg split. But the
patch has nothing left to do either, because the new build.rs already
says so itself:
if std::env::var_os("PROTOC").is_none() {
std::env::set_var("PROTOC", protobuf_src::protoc());
}
package.nix already sets PROTOC, so the bundled protoc is skipped on
its own. Dropping cargoPatches entirely is the fix; regenerating the
patch would re-add a file to maintain for no behavioural difference.
(The patch file itself is left in place for now — nothing references
it, and deleting it is a separate call.)
2. Vendoring 403s from crates.io.
The pinned nixpkgs (2026-04-18) ships a fetch-cargo-vendor-util whose
`requests.Session()` sends no User-Agent, and crates.io now 403s the
default python-requests UA. Confirmed directly:
curl -A "python-requests/2.32.3" .../base64/0.13.1/download -> 403
curl -A "Mozilla/5.0" .../base64/0.13.1/download -> 200
Current nixpkgs sets one:
session.headers["User-Agent"] = "nixpkgs-fetchCargoVendor/2 (...)"
So this is a nixpkgs bug, not a larql bug, and the fix is the bump:
nixpkgs 2026-04-18 -> 2026-09-13. cargoHash refreshed for the vendor
tree that results from dropping the patch in (1).
Worth recording how this was nearly misdiagnosed: the failing crate
name changes between runs (base64, then ciborium-ll), which reads
like parallel-fetch rate limiting. It is not — `--cores 1 -j1` fails
identically. And a 2-crate control package vendored fine on this
machine, which looked like evidence against the UA theory, until the
control turned out to resolve a *different* fetcher store path (the
system's newer nixpkgs, which sets the UA). Same symptom, two
nixpkgs, opposite outcomes.
3. utoipa-swagger-ui downloads at build time.
Its build script curls the Swagger UI dist tarball, which cannot work
in the sandbox (no network, and no curl among the build inputs). Hand
it a pre-fetched zip through SWAGGER_UI_DOWNLOAD_URL, the env var the
crate documents, so it copies dist/ from a fixed-output derivation.
Result: all five binaries build (larql, larql-server, larql-router,
vindex, vindex3-demo). Verified `larql-server --version` and `larql
--version` run, and that the Swagger assets are embedded in the binary
(`strings` finds swagger-ui.css / swagger-ui-bundle.js / index.html),
i.e. the fix in (3) actually shipped the UI rather than just silencing
the build script.
|
Heads-up on the two red checks (
This PR's So any PR opened against |
|
Follow-up on the two red checks: I've opened #481, which bumps On that branch |
nix build .#larqlfails on currentmain. Three independent causes; each verified in isolation.1.
cargoPatchesno longer applies — and is no longer neededEvery hunk of
use-system-protoc.patchfails:protobuf-srcmoved to[target.'cfg(not(windows))'.build-dependencies]and thebuild.rsfiles were rewritten into aset_protoc()cfg split.But the patch also has nothing left to do, because the new
build.rsalready handles it:package.nixalready setsPROTOC, so the bundled protoc is skipped on its own. DroppingcargoPatchesis the fix — regenerating the patch would re-add a file to maintain for no behavioural difference. I left the patch file itself in place since nothing references it now; happy to delete it if you'd prefer.2. Vendoring 403s from crates.io
The pinned nixpkgs (2026-04-18) ships a
fetch-cargo-vendor-utilwhoserequests.Session()sends no User-Agent, and crates.io now 403s the defaultpython-requestsUA:Current nixpkgs sets one:
So this is a nixpkgs bug rather than a larql one, and the fix is the bump: nixpkgs 2026-04-18 → 2026-09-13.
cargoHashrefreshed for the vendor tree that results from (1).Worth flagging how this nearly got misdiagnosed, in case it resurfaces: the failing crate name changes between runs (
base64, thenciborium-ll), which reads like parallel-fetch rate limiting. It isn't —--cores 1 -j1fails identically. And a 2-crate control package vendored fine on my machine, which looked like evidence against the UA theory, until the control turned out to resolve a different fetcher store path (my system's newer nixpkgs, which does set the UA). Same symptom, two nixpkgs, opposite outcomes.3.
utoipa-swagger-uidownloads at build timeIts build script curls the Swagger UI dist tarball, which can't work in the sandbox (no network, and no
curlamong the build inputs). This hands it a pre-fetched zip viaSWAGGER_UI_DOWNLOAD_URL, the env var the crate documents, so it copiesdist/out of a fixed-output derivation.Verification
All five binaries build:
larql,larql-server,larql-router,vindex,vindex3-demo.larql-server --version/larql --versionrunstrings result/bin/larql-serverfindsswagger-ui.css,swagger-ui-bundle.js,index.html) — i.e. (3) shipped the UI rather than just silencing the build scriptOnly
nix/package.nixandflake.lockchange; no Rust code is touched.