Skip to content

fix(native): fall back to prebuilt wheels when a dependency fails to build - #81

Merged
RockChinQ merged 2 commits into
mainfrom
fix/native-wheel-fallback
Dec 3, 2026
Merged

RockChinQ merged 2 commits into
mainfrom
fix/native-wheel-fallback

Conversation

@RockChinQ

@RockChinQ RockChinQ commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Problem

Native installs run uv pip install langbot==X and resolve every dependency fresh. When a dependency's newest release drops the wheel for the user's platform, uv falls back to the sdist and the build fails without Rust or a C compiler. Telemetry from LANG-836 (2026-12-03, v0.6.8) shows two cases:

  • Intel macOS: bcrypt 5.1.0, released 2026-12-01, ships arm64-only macOS wheels. cryptography ≥49 and cbor2 ≥6.1.2 have no x86_64 macOS wheels at all.
  • Ubuntu 18.04 (glibc 2.27): tiktoken 0.14.0, asyncpg 0.32, litellm 1.112 and cbor2 6.x only ship manylinux_2_28 wheels.

Change

  • When uv reports a failed source build, lbctl retries on the same index with that package restricted to wheels (--only-binary <pkg>), so uv picks an older release in Core's allowed range. This is capped at 8 packages.
  • Long build logs push uv's Failed to build header out of the 2 KiB output tail lbctl keeps. In that case lbctl falls back to the closing help: `pkg` (vX) was included because line, and only when the tail also shows a build-backend or build-environment failure.
  • If no release of a package has a usable wheel, lbctl reports the last build failure plus a hint: install the build tools, or use --driver docker. Before, the user got uv's resolver error, and the same doomed build was retried on fallback indexes. This hint only appears when the final failure is itself a build or wheel gap. Any other failure (for example a mirror 502) still falls back to the next index, keeping the wheel restriction.

Verification

  • New unit tests cover the build-failure parser, a multi-package fallback that succeeds, and the unbuildable case (error text, no other indexes tried), and the unrelated-failure case, which still falls back to the next index. The two PrepareNative tests fail without the fix. go test ./... passes. The internal/config thread test is a known flake (LANG-551) and passed on rerun.
  • Real installs in an ubuntu:18.04 container, run with --region global --pypi-index https://pypi.org/simple:
    • Core v4.10.11: v0.6.8 fails at install_package on tiktoken 0.14.0. This branch falls back four times (tiktoken, asyncpg, pyqwest, litellm), installs 241 packages, passes the health check and exits 0.
    • Core v4.11.9: this install still can't succeed, because cbor2 ≥6.1.2 (required by webauthn ≥3) has no glibc 2.27 wheel. It now ends with cbor2 has no prebuilt wheel for this system … use --driver docker.

🤖 Generated with Claude Code

RockChinQ and others added 2 commits December 3, 2026 19:05
…build

Native installs resolve LangBot's dependencies fresh, so a dependency
release that drops the wheel for a platform turns into a source build that
needs Rust or a C compiler: bcrypt 5.1.0 (2026-12-01) and cryptography >=49
have no Intel macOS wheels, tiktoken 0.14 / cbor2 6.x need glibc 2.28.

When uv reports a failed source build, retry with that package restricted
to wheels (--only-binary) so uv picks an older compatible release. If no
release has a wheel either, report the build failure with guidance (install
build tools or use --driver docker) instead of the resolver error, and do
not repeat the build on fallback indexes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
…r wheel gap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
@RockChinQ
RockChinQ merged commit 7dcaf3b into main Dec 3, 2026
11 checks 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