Skip to content

Commit c120be9

Browse files
committed
build: commit PDFium binaries directly instead of fetching in CI
The fetch-pdfium.sh + gitignore approach caused a silent file-loss between the fetch step and tauri-action's cargo build on CI: the fetch step logged `installed to .../src-tauri/pdfium:` with the file present, but tauri-build.rs then reported "resource path doesn't exist" / "Library not found". Locally reproduced by removing the dylib — same error — confirming the file really is missing at build.rs time on CI. Root cause never nailed down; suspected interaction between .gitignore rules and something in the CI pipeline cleaning gitignored files. Pragmatic fix: just ship the three platform binaries in the repo (~21 MB total). Pros: - Eliminates the entire fetch/placement failure mode. - CI builds don't depend on upstream release availability. - Works the same way locally and in CI. Cons (acknowledged): - Repo size grows by ~21 MB. - PDFium updates now require manual re-download + commit. PDFium is licensed Apache 2.0 / BSD, redistribution is fine. Removes: - scripts/fetch-pdfium.sh - "Fetch PDFium dynamic library" step in build.yml - pdfium_platform matrix var - .gitignore entries for *.dylib/*.dll/*.so under src-tauri/pdfium/ - src-tauri/pdfium/.gitkeep (no longer needed, dir has real content)
1 parent a5c12e6 commit c120be9

7 files changed

Lines changed: 0 additions & 114 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ jobs:
1818
- platform: macos-latest
1919
args: '--target aarch64-apple-darwin'
2020
rust_target: aarch64-apple-darwin
21-
pdfium_platform: mac-arm64
2221
- platform: ubuntu-22.04
2322
args: ''
2423
rust_target: ''
25-
pdfium_platform: linux-x64
2624
- platform: windows-latest
2725
args: ''
2826
rust_target: ''
29-
pdfium_platform: win-x64
3027

3128
runs-on: ${{ matrix.platform }}
3229

@@ -61,10 +58,6 @@ jobs:
6158
- name: Install frontend dependencies
6259
run: npm install
6360

64-
- name: Fetch PDFium dynamic library (${{ matrix.pdfium_platform }})
65-
shell: bash
66-
run: ./scripts/fetch-pdfium.sh ${{ matrix.pdfium_platform }}
67-
6861
- name: Build Tauri app
6962
uses: tauri-apps/tauri-action@v0
7063
env:

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ src-tauri/target/
1111
# Tauri generated files
1212
src-tauri/gen/
1313

14-
# Bundled PDFium binaries — downloaded per-platform by scripts/fetch-pdfium.sh
15-
# (invoked by CI). Too large to track in git.
16-
src-tauri/pdfium/*.dylib
17-
src-tauri/pdfium/*.dll
18-
src-tauri/pdfium/*.so
19-
2014
# Environment files
2115
.env
2216
.env.local

scripts/fetch-pdfium.sh

Lines changed: 0 additions & 101 deletions
This file was deleted.

src-tauri/pdfium/.gitkeep

Whitespace-only changes.

src-tauri/pdfium/libpdfium.dylib

6.72 MB
Binary file not shown.

src-tauri/pdfium/libpdfium.so

7.23 MB
Binary file not shown.

src-tauri/pdfium/pdfium.dll

6.82 MB
Binary file not shown.

0 commit comments

Comments
 (0)