Skip to content

feat(build): mirror biber for all platforms + prefer musl (fixes libnsl crash)#3

Merged
frederikbeimgraben merged 1 commit into
mainfrom
feat/biber-mirror-multiarch
Jun 3, 2026
Merged

feat(build): mirror biber for all platforms + prefer musl (fixes libnsl crash)#3
frederikbeimgraben merged 1 commit into
mainfrom
feat/biber-mirror-multiarch

Conversation

@frederikbeimgraben
Copy link
Copy Markdown
Owner

Problem

The biber-binaries mirror only held glibc Linux x86_64 builds. That binary dynamically links libnsl.so.1, missing on many minimal/modern systems → builds crashed with biber: error while loading shared libraries: libnsl.so.1.

Change

Mirror (release biber-binaries) — uploaded for biber 2.11–2.19 (where upstream published them) and pinned SHA256 for each:

  • linux_x86_64-musl (static, no shared-lib deps)
  • linux_aarch64 (2.19)
  • darwin_x86_64, darwin_universal (arm64-native, 2.17+)
  • MSWIN64.zip
  • SHA256SUMS regenerated (39 entries).

Downloader (tectonic.py):

  • _biber_sf_path/_mirror_asset_biber_candidates(version): ordered (sf_dir, sf_file, mirror_asset). Linux x86_64 prefers musl then glibc; macOS prefers universal then x86_64. Versions that never shipped a given arch 404 and fall through.
  • _biber_sources flattens candidates to mirror-then-SourceForge, each with its pinned checksum.
  • Extraction handles .zip (Windows biber.exe) as well as .tar.gz; picks the largest biber* member so odd musl names (biber-linux_x86_64-musl) and AppleDouble ._biber sidecars resolve. Caches as biber.exe on Windows.

Verification

  • Extraction tested against every downloaded archive — ELF / Mach-O / PE binaries all resolve correctly.
  • New unit tests: candidate ordering (musl-first), source flattening (mirror before SF, all checksummed), archive extraction (tar/zip/missing).
  • Full suite 700 passed; ruff + ruff format clean; mypy --strict clean on tectonic.py.

🤖 Generated with Claude Code

The biber-binaries mirror release only held the glibc Linux x86_64 builds.
The glibc binary dynamically links libnsl.so.1 (and friends), which are
absent on many minimal/modern systems, so the build crashed with
"error while loading shared libraries: libnsl.so.1".

Mirror the remaining upstream architectures for biber 2.11-2.19 and make
the downloader pick the right one:

- Upload to the biber-binaries release (and pin SHA256 for each): Linux
  x86_64 musl (static, no shared-lib deps), Linux aarch64, macOS x86_64
  and universal (arm64-native), Windows x86_64. SHA256SUMS regenerated.
- Replace _biber_sf_path/_mirror_asset with _biber_candidates(version),
  returning ordered (sf_dir, sf_file, mirror_asset) tuples. On Linux
  x86_64 the static musl build is preferred, with glibc as a fallback;
  on macOS the universal build is preferred, then x86_64. Candidates a
  given version never shipped simply 404 and the loop moves on.
- _biber_sources flattens candidates to mirror-then-SourceForge URLs,
  each carrying its pinned checksum.
- Extract from .zip as well as .tar.gz (Windows ships biber.exe in a
  zip); pick the largest biber* member so musl tarballs that name the
  binary after the archive (biber-linux_x86_64-musl) and AppleDouble
  ._biber sidecars are handled. Cache as biber.exe on Windows.

Tested extraction against every downloaded archive (ELF/Mach-O/PE all
resolve). New unit tests for candidate ordering, source flattening, and
archive extraction. ruff + mypy --strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@frederikbeimgraben frederikbeimgraben merged commit 768eaba into main Jun 3, 2026
1 check passed
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