From 3f1d27022f019f0a62a43131b9ccce2c34c0acae Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:26:46 +0100 Subject: [PATCH 01/17] Try compiling the CLI on Windows again --- .github/workflows/cli-wheels-windows.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 52655c73f..5db21b65d 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -3,6 +3,7 @@ name: Generate CLI wheels for Windows # this workflow doesn't do (yet) what it promises; we keep this file to not lose the progress on: + push: workflow_dispatch: jobs: @@ -26,12 +27,12 @@ jobs: gcc make autoconf - python3 + mingw-w64-ucrt-x86_64-python curl tar mingw-w64-ucrt-x86_64-pkg-config - mingw-w64-rust - mingw-w64-python-maturin + mingw-w64-ucrt-x86_64-rust + mingw-w64-ucrt-x86_64-python-maturin - uses: actions/setup-python@v5 with: # WARNING: be careful with the ordering - the last version is the @@ -50,8 +51,9 @@ jobs: 3.10 - name: Install LHAPDF run: | - curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.5.4.tar.gz" | tar xzf - - cd LHAPDF-6.5.4 + export LHAPDF_V=6.5.4 + curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" | tar xzf - + cd LHAPDF-${LHAPDF_V} # compiling with Python gives errors, but we also don't need Python ./configure --disable-python --disable-shared make -j From 0e26026cc0b8689fd20a7471ada68a8cdbcea417 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:33:37 +0100 Subject: [PATCH 02/17] Remove Python and use `wget` instead of `curl` --- .github/workflows/cli-wheels-windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 5db21b65d..954b388e2 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -27,7 +27,6 @@ jobs: gcc make autoconf - mingw-w64-ucrt-x86_64-python curl tar mingw-w64-ucrt-x86_64-pkg-config @@ -52,7 +51,7 @@ jobs: - name: Install LHAPDF run: | export LHAPDF_V=6.5.4 - curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" | tar xzf - + wget "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" -O- | tar xzf - cd LHAPDF-${LHAPDF_V} # compiling with Python gives errors, but we also don't need Python ./configure --disable-python --disable-shared From 185671cfdd30cdb6e4e5290ac2a6a2e08003a233 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:35:38 +0100 Subject: [PATCH 03/17] Temporarily disable unimportant workflows --- .github/workflows/capi.yaml | 1 + .github/workflows/msrv.yml | 1 + .github/workflows/python.yml | 1 + .github/workflows/rust.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/capi.yaml b/.github/workflows/capi.yaml index 65f35070c..a487b27e7 100644 --- a/.github/workflows/capi.yaml +++ b/.github/workflows/capi.yaml @@ -5,6 +5,7 @@ on: branches-ignore: - pycli - bump-pyo3-version + - windows-cli-wheels jobs: capi: diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index cc8d68158..b5354a69b 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -5,6 +5,7 @@ on: branches-ignore: - pycli - bump-pyo3-version + - windows-cli-wheels env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 84c6d9b05..7080514bf 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -4,6 +4,7 @@ on: push: branches-ignore: - pycli + - windows-cli-wheels jobs: test: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ddec0b83..8fe9202af 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,6 +5,7 @@ on: branches-ignore: - pycli - bump-pyo3-version + - windows-cli-wheels defaults: run: From 24a7bdfc1b172e62f9381463d3143f480476eb62 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:47:37 +0100 Subject: [PATCH 04/17] Add missing header file to LHAPDF --- .github/workflows/cli-wheels-windows.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 954b388e2..2b47b9dca 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -53,6 +53,19 @@ jobs: export LHAPDF_V=6.5.4 wget "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" -O- | tar xzf - cd LHAPDF-${LHAPDF_V} + # add missing header + patch -l -p0 < + +#include + + #ifdef HAVE_MPI + #include + EOF # compiling with Python gives errors, but we also don't need Python ./configure --disable-python --disable-shared make -j From 3db2cb7c9c32465db9d6543b4633e04b33982f57 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:52:23 +0100 Subject: [PATCH 05/17] Install `patch` --- .github/workflows/cli-wheels-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 2b47b9dca..81d30e601 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -29,6 +29,7 @@ jobs: autoconf curl tar + patch mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-rust mingw-w64-ucrt-x86_64-python-maturin From d73fa2743487af650443939f1d31925f5c2097c8 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:52:35 +0100 Subject: [PATCH 06/17] Shift printing paths a bit --- .github/workflows/cli-wheels-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 81d30e601..c5c444853 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -71,10 +71,10 @@ jobs: ./configure --disable-python --disable-shared make -j make install - # print the path of `pkgconf` - command -v pkg-config - name: Set pkg-config paths run: | + # print the path of `pkgconf` + command -v pkg-config # for some reason `pkg-config` isn't properly found by Rust echo "PKG_CONFIG=$(command -v pkg-config)" >> ${GITHUB_ENV} echo "PKG_CONFIG_PATH=/ucrt64/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ${GITHUB_ENV} From e2fc37873849ebd356fc386052fefd8eafb24623 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 14 Mar 2025 19:58:19 +0100 Subject: [PATCH 07/17] Fix patch --- .github/workflows/cli-wheels-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index c5c444853..819530181 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -56,16 +56,16 @@ jobs: cd LHAPDF-${LHAPDF_V} # add missing header patch -l -p0 < +#include + using namespace std; #ifdef HAVE_MPI - #include EOF # compiling with Python gives errors, but we also don't need Python ./configure --disable-python --disable-shared From 758953a331cfee1b96a2b134b973f5637bf1bbfd Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Wed, 19 Mar 2025 19:30:46 +0100 Subject: [PATCH 08/17] Try new patch --- .github/workflows/cli-wheels-windows.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 819530181..4654e06a3 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -56,16 +56,18 @@ jobs: cd LHAPDF-${LHAPDF_V} # add missing header patch -l -p0 < - +#include - using namespace std; + --- src/Paths.cc 2023-03-10 18:35:19.000000000 +0100 + +++ src/Paths.cc.new 2025-03-19 19:29:14.832384033 +0100 + @@ -35,7 +35,9 @@ + + + void setPaths(const string& pathstr) { + - setenv("LHAPDF_DATA_PATH", pathstr.c_str(), 1); + + string arg = "LHAPDF_DATA_PATH=" + pathstr; + + putenv(arg.data()); + } + - #ifdef HAVE_MPI EOF # compiling with Python gives errors, but we also don't need Python ./configure --disable-python --disable-shared From f35b197d92cf352ba33f2e83e6cf05025193d1ba Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Wed, 19 Mar 2025 19:42:38 +0100 Subject: [PATCH 09/17] Fix patch again --- .github/workflows/cli-wheels-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 4654e06a3..228522fee 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -56,9 +56,9 @@ jobs: cd LHAPDF-${LHAPDF_V} # add missing header patch -l -p0 < Date: Sat, 22 Mar 2025 06:51:45 +0100 Subject: [PATCH 10/17] Remove target specification --- .github/workflows/cli-wheels-windows.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 228522fee..b297f76e1 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -9,9 +9,6 @@ on: jobs: cli-wheels-windows: runs-on: windows-latest - strategy: - matrix: - target: [x64] defaults: run: shell: msys2 {0} @@ -83,9 +80,9 @@ jobs: echo "${PKG_CONFIG_PATH}" - name: Build wheels run: - maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --target ${{ matrix.target }} + maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: ${{ github.job }}-${{ matrix.target }} + name: ${{ github.job }} path: dist From da2fbe30279807302c743b4fffbab71ef8193a15 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 07:26:54 +0100 Subject: [PATCH 11/17] Limit features and use maturin-action --- .github/workflows/cli-wheels-windows.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index b297f76e1..26467e90f 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -78,9 +78,14 @@ jobs: echo "PKG_CONFIG=$(command -v pkg-config)" >> ${GITHUB_ENV} echo "PKG_CONFIG_PATH=/ucrt64/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ${GITHUB_ENV} echo "${PKG_CONFIG_PATH}" + #- name: Build wheels + # run: + # maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static - name: Build wheels - run: - maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml + uses: PyO3/maturin-action@v1 + with: + # `--find-interpreter` is needed to generate wheels for *all* Python versions + args: --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static - name: Upload wheels uses: actions/upload-artifact@v4 with: From 9ee818dfc60669932ce150e38cb8810352b6f021 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 08:00:29 +0100 Subject: [PATCH 12/17] More fixes --- .github/workflows/cli-wheels-windows.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 26467e90f..5168cf3b6 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -70,22 +70,20 @@ jobs: ./configure --disable-python --disable-shared make -j make install - - name: Set pkg-config paths + - name: Test pkg-config run: | # print the path of `pkgconf` command -v pkg-config - # for some reason `pkg-config` isn't properly found by Rust - echo "PKG_CONFIG=$(command -v pkg-config)" >> ${GITHUB_ENV} - echo "PKG_CONFIG_PATH=/ucrt64/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ${GITHUB_ENV} - echo "${PKG_CONFIG_PATH}" - #- name: Build wheels - # run: - # maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static + # show LHAPDF's .pc file + pkg-config lhapdf --path + cat $(pkg-config lhapdf --path) + - name: Patch pineappl_cli/pyproject.toml + run: | + # on Windows we can't build with all features (yet) + sed -i '/all-features/d' pineappl_cli/pyproject.toml - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - # `--find-interpreter` is needed to generate wheels for *all* Python versions - args: --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static + run: + maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static - name: Upload wheels uses: actions/upload-artifact@v4 with: From a843b6e8500d833836cfdf97e95eda574e691924 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 08:18:50 +0100 Subject: [PATCH 13/17] Try different pkg-config program --- .github/workflows/cli-wheels-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 5168cf3b6..734a8dd88 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -27,7 +27,7 @@ jobs: curl tar patch - mingw-w64-ucrt-x86_64-pkg-config + pkgconf mingw-w64-ucrt-x86_64-rust mingw-w64-ucrt-x86_64-python-maturin - uses: actions/setup-python@v5 From 7753e41c01d36b1f8d60fa1f8acd167146d2d6d9 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 08:27:03 +0100 Subject: [PATCH 14/17] Install LHAPDF into `/ucrt64/` --- .github/workflows/cli-wheels-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 734a8dd88..904cd91fb 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -67,7 +67,7 @@ jobs: EOF # compiling with Python gives errors, but we also don't need Python - ./configure --disable-python --disable-shared + ./configure --disable-python --disable-shared --prefix=/ucrt64/ make -j make install - name: Test pkg-config From aae22b577a9288d72c7845bb3ab40dcd3f291bf9 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 08:39:15 +0100 Subject: [PATCH 15/17] Print and adjust PKG_CONFIG_PATH --- .github/workflows/cli-wheels-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 904cd91fb..7def086fb 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -77,6 +77,8 @@ jobs: # show LHAPDF's .pc file pkg-config lhapdf --path cat $(pkg-config lhapdf --path) + echo ${PKG_CONFIG_PATH} + echo "PKG_CONFIG_PATH=/ucrt64/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ${GITHUB_ENV} - name: Patch pineappl_cli/pyproject.toml run: | # on Windows we can't build with all features (yet) From e5a542dd06a0f0015dcd924d4c4759d85b6f0d36 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 09:52:20 +0100 Subject: [PATCH 16/17] Try `pkgconf` instead of `pkg-config` --- .github/workflows/cli-wheels-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index 7def086fb..c0f9b5589 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -27,7 +27,7 @@ jobs: curl tar patch - pkgconf + mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-rust mingw-w64-ucrt-x86_64-python-maturin - uses: actions/setup-python@v5 @@ -74,6 +74,7 @@ jobs: run: | # print the path of `pkgconf` command -v pkg-config + command -v pkgconf # show LHAPDF's .pc file pkg-config lhapdf --path cat $(pkg-config lhapdf --path) From 9b981ab63a012eb0c0afade0b4785731ecb70494 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Sat, 22 Mar 2025 10:38:31 +0100 Subject: [PATCH 17/17] Link statically --- .github/workflows/cli-wheels-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-wheels-windows.yml b/.github/workflows/cli-wheels-windows.yml index c0f9b5589..e0d76e755 100644 --- a/.github/workflows/cli-wheels-windows.yml +++ b/.github/workflows/cli-wheels-windows.yml @@ -86,7 +86,7 @@ jobs: sed -i '/all-features/d' pineappl_cli/pyproject.toml - name: Build wheels run: - maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static + maturin build --release --out dist --find-interpreter --manifest-path pineappl_cli/Cargo.toml --features=static -- -Ctarget-feature=+crt-static - name: Upload wheels uses: actions/upload-artifact@v4 with: