Skip to content

build: wire rustls QUIC cdylib into the mojo env and Docker image - #35

Merged
johnnyhuy merged 1 commit into
mainfrom
feat/rustls-cdylib-build
Aug 8, 2026
Merged

build: wire rustls QUIC cdylib into the mojo env and Docker image#35
johnnyhuy merged 1 commit into
mainfrom
feat/rustls-cdylib-build

Conversation

@johnnyhuy

Copy link
Copy Markdown
Contributor

Summary

ADR-003 follow-up #6 needs flare's libflare_rustls_quic.so for HTTP/3. flare's own pixi activation hook would build it, but our conda-packaged flare omits that hook on the second install (it lives on flare's source tree), so we build it explicitly.

  • pixi.toml: add rust = ">=1.83,<2" to the mojo feature, plus a pixi run -e mojo rustls-build task that runs flare's build_rustls.sh.
  • Dockerfile: stage 1 invokes pixi run -e mojo rustls-build after the mojo env is installed (~20s first time, ~1s on cache hit). Stage 2 copies both libflare_tls.so and libflare_rustls_quic.so into /usr/local/lib.

Consequences

Testing

  • pixi run -e mojo rustls-build builds and installs the cdylib at the canonical path .pixi/envs/mojo/lib/libflare_rustls_quic.so (~1.05 MB).
  • uv run pytest — 42 passed, ruff + mypy clean.

ADR-003 follow-up #6 needs flare's rustls QUIC cdylib for HTTP/3.
flare's pixi activation hook runs the cargo build, but our conda-
packaged flare omits that hook on the second install (it lives on
flare's source tree), so we build it explicitly.

pixi.toml:
- Add `rust = ">=1.83,<2"` to the mojo feature so cargo is on PATH
  for the rustls cdylib build (and for any future Rust ffi work).
- Add `pixi run -e mojo rustls-build` task that runs flare's
  build_rustls.sh. Idempotent — cargo's incremental build and the
  script's atomic install copy mean repeat runs are cheap.

Dockerfile:
- Stage 1 invokes `pixi run -e mojo rustls-build` after the mojo
  env is installed, before the main.mojo compile. ~20s the first
  time, ~1s on cache hit.
- Stage 2 copies both libflare_tls.so and libflare_rustls_quic.so
  into /usr/local/lib (already on the loader path). Best-effort —
  fall back to a warning if a build path doesn't exist on a future
  flare layout change. Lets a future HTTP/3 deploy bind h3 without
  rebuilding the image.

Co-authored-by: opencode-agent <noreply@opencode.ai>
@johnnyhuy
johnnyhuy merged commit 691753b into main Aug 8, 2026
6 of 12 checks passed
@johnnyhuy
johnnyhuy deleted the feat/rustls-cdylib-build branch August 8, 2026 06:32
johnnyhuy added a commit that referenced this pull request Aug 9, 2026
ADR-003 follow-up #6 needs flare's rustls QUIC cdylib for HTTP/3.
flare's pixi activation hook runs the cargo build, but our conda-
packaged flare omits that hook on the second install (it lives on
flare's source tree), so we build it explicitly.

pixi.toml:
- Add `rust = ">=1.83,<2"` to the mojo feature so cargo is on PATH
  for the rustls cdylib build (and for any future Rust ffi work).
- Add `pixi run -e mojo rustls-build` task that runs flare's
  build_rustls.sh. Idempotent — cargo's incremental build and the
  script's atomic install copy mean repeat runs are cheap.

Dockerfile:
- Stage 1 invokes `pixi run -e mojo rustls-build` after the mojo
  env is installed, before the main.mojo compile. ~20s the first
  time, ~1s on cache hit.
- Stage 2 copies both libflare_tls.so and libflare_rustls_quic.so
  into /usr/local/lib (already on the loader path). Best-effort —
  fall back to a warning if a build path doesn't exist on a future
  flare layout change. Lets a future HTTP/3 deploy bind h3 without
  rebuilding the image.

Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
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