Skip to content

Commit 80227ae

Browse files
Use separate scripts for better caching
1 parent bfd7e9c commit 80227ae

File tree

4 files changed

+62
-47
lines changed

4 files changed

+62
-47
lines changed

.github/workflows/ci-emscripten.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,76 +48,34 @@ jobs:
4848
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
4949
with:
5050
path: ${{ github.workspace }}/wasm-library-dir
51-
key: wasm-library-dir-${{ hashFiles('.github/workflows/ci-emscripten.yml') }}
51+
key: wasm-library-dir-${{ hashFiles('bin/pyodide_build_libgmp.sh', 'bin/pyodide_build_libmpfr.sh', 'bin/pyodide_build_flint.sh', '.github/patches/**') }}
5252

5353
- name: Build libgmp
5454
if: steps.cache-wasm-library-dir.outputs.cache-hit != 'true'
5555
env:
5656
CFLAGS: "-fPIC"
5757
WASM_LIBRARY_DIR: ${{ github.workspace }}/wasm-library-dir
58-
run: |
59-
curl -L https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz -o gmp-6.3.0.tar.xz
60-
tar -xf gmp-6.3.0.tar.xz
61-
62-
cd gmp-6.3.0
63-
64-
emconfigure ./configure \
65-
--disable-dependency-tracking \
66-
--host none \
67-
--disable-shared \
68-
--enable-static \
69-
--enable-cxx \
70-
--prefix=${{ env.WASM_LIBRARY_DIR }}
71-
emmake make -j $(nproc)
72-
emmake make install
58+
run: bin/pyodide_build_libgmp.sh
7359

7460
- name: Build libmpfr
7561
if: steps.cache-wasm-library-dir.outputs.cache-hit != 'true'
7662
env:
7763
CFLAGS: "-fPIC"
7864
WASM_LIBRARY_DIR: ${{ github.workspace }}/wasm-library-dir
79-
run: |
80-
curl -L https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz -o mpfr-4.2.1.tar.xz
81-
tar -xf mpfr-4.2.1.tar.xz
82-
83-
cd mpfr-4.2.1
84-
85-
emconfigure ./configure \
86-
--disable-dependency-tracking \
87-
--disable-shared \
88-
--with-gmp="${{ env.WASM_LIBRARY_DIR }}" \
89-
--prefix=${{ env.WASM_LIBRARY_DIR }}
90-
emmake make -j $(nproc)
91-
emmake make install
65+
run: bin/pyodide_build_libmpfr.sh
9266

9367
- name: Build flint
9468
if: steps.cache-wasm-library-dir.outputs.cache-hit != 'true'
9569
env:
9670
CFLAGS: "-fPIC"
9771
WASM_LIBRARY_DIR: ${{ github.workspace }}/wasm-library-dir
98-
run: |
99-
curl -L https://github.com/flintlib/flint/releases/download/v3.2.2/flint-3.2.2.tar.xz -o flint-3.2.2.tar.xz
100-
tar -xf flint-3.2.2.tar.xz
101-
102-
cd flint-3.2.2
103-
104-
emconfigure ./configure \
105-
--disable-dependency-tracking \
106-
--disable-shared \
107-
--prefix=${{ env.WASM_LIBRARY_DIR }} \
108-
--with-gmp=${{ env.WASM_LIBRARY_DIR }} \
109-
--with-mpfr=${{ env.WASM_LIBRARY_DIR }} \
110-
--host=wasm32-unknown-emscripten \
111-
--disable-assembly \
112-
--disable-pthread
113-
emmake make -j $(nproc)
114-
emmake make install
72+
run: bin/pyodide_build_flint.sh
11573

11674
- name: Persist WASM library directory to cache
11775
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
11876
with:
11977
path: ${{ github.workspace }}/wasm-library-dir
120-
key: wasm-library-dir-${{ hashFiles('.github/workflows/ci-emscripten.yml') }}
78+
key: wasm-library-dir-${{ hashFiles('bin/pyodide_build_libgmp.sh', 'bin/pyodide_build_libmpfr.sh', 'bin/pyodide_build_flint.sh', '.github/patches/**') }}
12179

12280
- name: Restore python-flint build directory from cache
12381
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2

bin/pyodide_build_flint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!usr/bin/env bash
2+
3+
set -e
4+
5+
curl -L https://github.com/flintlib/flint/releases/download/v3.2.2/flint-3.2.2.tar.xz -o flint-3.2.2.tar.xz
6+
tar -xf flint-3.2.2.tar.xz
7+
8+
cd flint-3.2.2
9+
10+
emconfigure ./configure \
11+
--disable-dependency-tracking \
12+
--disable-shared \
13+
--prefix=$WASM_LIBRARY_DIR \
14+
--with-gmp=$WASM_LIBRARY_DIR \
15+
--with-mpfr=$WASM_LIBRARY_DIR \
16+
--host=wasm32-unknown-emscripten \
17+
--disable-assembly \
18+
--disable-pthread
19+
20+
emmake make -j $(nproc)
21+
emmake make install

bin/pyodide_build_libgmp.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!usr/bin/env bash
2+
3+
set -e
4+
5+
curl -L https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz -o gmp-6.3.0.tar.xz
6+
tar -xf gmp-6.3.0.tar.xz
7+
8+
cd gmp-6.3.0
9+
10+
emconfigure ./configure \
11+
--disable-dependency-tracking \
12+
--host none \
13+
--disable-shared \
14+
--enable-static \
15+
--enable-cxx \
16+
--prefix=$WASM_LIBRARY_DIR
17+
18+
emmake make -j $(nproc)
19+
emmake make install

bin/pyodide_build_libmpfr.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!usr/bin/env bash
2+
3+
set -e
4+
5+
curl -L https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz -o mpfr-4.2.1.tar.xz
6+
tar -xf mpfr-4.2.1.tar.xz
7+
8+
cd mpfr-4.2.1
9+
10+
emconfigure ./configure \
11+
--disable-dependency-tracking \
12+
--disable-shared \
13+
--with-gmp=$WASM_LIBRARY_DIR \
14+
--prefix=$WASM_LIBRARY_DIR
15+
16+
emmake make -j $(nproc)
17+
emmake make install

0 commit comments

Comments
 (0)