Skip to content

feat(build): vendor PDFium binaries for deterministic builds #281

Description

@yicheng47

Motivation

Quill already uses pdfium-render and a native PDFium library for PDF import metadata and first-page cover rendering. Today src-tauri/build.rs downloads the platform PDFium binary from bblanchon/pdfium-binaries during build. That keeps the repo smaller, but it makes builds depend on network availability and the continued availability of an external release asset.

If PDFium becomes load-bearing for the reader, the native binary should be treated as vendored runtime infrastructure rather than a best-effort build download.

Scope summary

  • Decide whether to commit the shipped PDFium binaries directly under src-tauri/binaries/ or move them to a controlled, checksum-verified artifact flow.
  • Pin and document the PDFium source/version, currently chromium/7857 from bblanchon/pdfium-binaries.
  • Replace download-on-build behavior with validation/copy/env setup that works offline.
  • Keep Tauri packaging paths stable for macOS and Windows, with Linux support preserved for CI/tests if needed.
  • Document update steps for refreshing PDFium.

Relevant code

  • src-tauri/build.rs downloads and publishes platform PDFium binaries.
  • src-tauri/src/pdfium.rs locates and lazily binds the runtime library.
  • src-tauri/Cargo.toml depends on pdfium-render.
  • src-tauri/tauri.*.conf.json references bundled binary/resource paths.

Implementation phases

  1. Inventory current target binaries and bundle paths.
  2. Add checksum/version documentation for each shipped binary.
  3. Change build.rs to validate existing binaries and set PDFIUM_DEV_LIB_PATH without network fetches.
  4. Confirm dev, test, and package flows work without network access.

Verification

  • cd src-tauri && cargo test commands::books::tests::extract_pdf_renders_cover_for_valid_pdf
  • cd src-tauri && cargo test --lib
  • pnpm run package on supported release targets
  • Manual offline build smoke test

Priority

P2. This is not a current release blocker, but it becomes important before PDFium is expanded from cover extraction to core PDF reading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2High-value features — differentiation & retentionfeatureNew feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions