From 9b7ef0a05a8c98c50167c2f51db756fccbbbc347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 08:54:30 +0200 Subject: [PATCH 01/21] Add GitHub action for windows --- .github/scripts/build_and_test.sh | 2 +- .github/workflows/actions.yml | 40 ++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build_and_test.sh b/.github/scripts/build_and_test.sh index 1486b2b..62668da 100755 --- a/.github/scripts/build_and_test.sh +++ b/.github/scripts/build_and_test.sh @@ -2,7 +2,7 @@ cpanm -vn Net::SSLeay cpanm -n Alien::Build -cpanm -vn Math::GSL::Alien@1.03 +cpanm -vn Math::GSL::Alien@1.05 cpanm -n Module::Build mkdir -p xs perl Build.PL diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index d5dcc76..c74bb33 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -224,8 +224,46 @@ jobs: DISTDIR=$(perl -pe 's/\.tar.gz$//' <<<"$DISTNAME") echo "DISTDIR=$DISTDIR" >> $GITHUB_ENV - name: install perl modules and build and test - # NOTE: This should first download and install libgsl using the Alien::GSL module + # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | BASEDIR=$PWD cd $DISTDIR $BASEDIR/.github/scripts/build_and_test.sh + install-dist-windows: + runs-on: windows-latest + needs: [build-dist] + strategy: + fail-fast: false + matrix: + perl: [40, 38, 36] + #gsl: [2.7, 2.6] + # NOTE: on windows we will not build against a pre-installed gsl, this will cause + # Build.PL to download the latest gsl version from the internet instead + steps: + - uses: actions/checkout@v4 + - name: Set up perl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: ${{ matrix.perl }} + distribution: strawberry + - name: Download dist + uses: actions/download-artifact@v3 + with: + name: math_gsl_dist + - name: Download dist name + uses: actions/download-artifact@v3 + with: + name: math_gsl_dist_name + - name: extract dist + run: | + DISTNAME=$(> $GITHUB_ENV + - name: install perl modules and build and test + # NOTE: This should first download and install libgsl using the Math::GSL::Alien module + run: | + BASEDIR=$PWD + cd $DISTDIR + $BASEDIR/.github/scripts/build_and_test.sh + \ No newline at end of file From e048f9b33b1ace8cb3de103cea81dc7062b7f652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 09:02:33 +0200 Subject: [PATCH 02/21] Use full perl version strings --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c74bb33..bbf2a78 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -235,7 +235,7 @@ jobs: strategy: fail-fast: false matrix: - perl: [40, 38, 36] + perl: ["5.40", "5.38", "5.36"] #gsl: [2.7, 2.6] # NOTE: on windows we will not build against a pre-installed gsl, this will cause # Build.PL to download the latest gsl version from the internet instead From 2313c1f190d84af62b5bd535f7590c7b273b2fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 09:27:59 +0200 Subject: [PATCH 03/21] Try use bash from "Git for Windows" --- .github/workflows/actions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index bbf2a78..21f4cd0 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -255,12 +255,14 @@ jobs: with: name: math_gsl_dist_name - name: extract dist + shell: bash run: | DISTNAME=$(> $GITHUB_ENV - name: install perl modules and build and test + shell: bash # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | BASEDIR=$PWD From 0d4a047c783247e8a1293bcb8b94f4068fc7857f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 09:52:47 +0200 Subject: [PATCH 04/21] Try use powershell instead --- .github/workflows/actions.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 21f4cd0..3da0715 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -235,7 +235,7 @@ jobs: strategy: fail-fast: false matrix: - perl: ["5.40", "5.38", "5.36"] + perl: ["5.38", "5.36", "5.32"] #gsl: [2.7, 2.6] # NOTE: on windows we will not build against a pre-installed gsl, this will cause # Build.PL to download the latest gsl version from the internet instead @@ -255,17 +255,24 @@ jobs: with: name: math_gsl_dist_name - name: extract dist - shell: bash + shell: pwsh run: | - DISTNAME=$(> $GITHUB_ENV + $DISTNAME = Get-Content -Path math-gsl-dist-name.txt + tar -zxvf $DISTNAME + $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' + echo "DISTDIR=$DISTDIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: install perl modules and build and test - shell: bash + shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | - BASEDIR=$PWD - cd $DISTDIR - $BASEDIR/.github/scripts/build_and_test.sh - \ No newline at end of file + $BASEDIR = $PWD + cd $env:DISTDIR + &cpanm -vn Net::SSLeay + &cpanm -n Alien::Build + &cpanm -vn Math::GSL::Alien@1.05 + &cpanm -n Module::Build + New-Item -ItemType Directory -Force -Path xs + perl Build.PL + perl .\Build installdeps --cpan_client cpanm + perl .\Build + perl .\Build test From e7496ae0be8f31c306d23e62ae1c1fdf0622c6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 17:15:44 +0200 Subject: [PATCH 05/21] Check if long paths are enabled --- .github/workflows/actions.yml | 6 ++++++ README.md | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 3da0715..eeddb5c 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -261,6 +261,12 @@ jobs: tar -zxvf $DISTNAME $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' echo "DISTDIR=$DISTDIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +# - name: Enable long paths +# run: | +# reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f + - name: Check if long paths are enabled + run: | + reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module diff --git a/README.md b/README.md index 4203c49..21196ed 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,8 @@ in your `PATH`, [PkgConfig](http://metacpan.org/release/PkgConfig/) is tried to locate GSL. - If you have not installed GSL on your system, -[`Alien::GSL`](https://metacpan.org/pod/Alien::GSL) is used to -install the latest version on your system. `Alien::GSL` depends -on [`Net::SSLeay`](https://metacpan.org/pod/Net::SSLeay) to download -the library, which requires that you have -installed `libssl-dev` and `libz-dev` (on Debian platforms, or similar -libraries on other platforms). - +[`Math::GSL::Alien`](https://metacpan.org/pod/Math::GSL::Alien) is used to +install the latest version on your system. # Installation From d7ae9cc89bc513b6155adc790765d380af03b102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 23:26:39 +0200 Subject: [PATCH 06/21] Use install.exe from MSYS2 instead It should be able to handle long path names --- .github/workflows/actions.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index eeddb5c..c61a6a8 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -261,18 +261,26 @@ jobs: tar -zxvf $DISTNAME $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' echo "DISTDIR=$DISTDIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -# - name: Enable long paths -# run: | -# reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f - - name: Check if long paths are enabled + - name: Set up MSYS2 run: | - reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled + # Download and install MSYS2 + curl -L -o msys2-x86_64.exe https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-latest.exe + start /wait msys2-x86_64.exe -y -r -o C:\msys64 + # Update the package database and core system packages + C:\msys64\usr\bin\bash -lc "pacman -Syuu --noconfirm" + C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" + # Install the required packages + C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm base-devel mingw-w64-x86_64-toolchain" + - name: Add MSYS2 to Path + run: echo "::add-path::C:\msys64\usr\bin" - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | $BASEDIR = $PWD cd $env:DISTDIR + $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" + &cpanm -vn Alien::MSYS &cpanm -vn Net::SSLeay &cpanm -n Alien::Build &cpanm -vn Math::GSL::Alien@1.05 From cff6f034d677e35c6f3a6dc7fa5d23b9135e6126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 23:44:04 +0200 Subject: [PATCH 07/21] Use Start-Process instead of start --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c61a6a8..503e7d5 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -265,7 +265,7 @@ jobs: run: | # Download and install MSYS2 curl -L -o msys2-x86_64.exe https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-latest.exe - start /wait msys2-x86_64.exe -y -r -o C:\msys64 + Start-Process msys2-x86_64.exe -ArgumentList '--root C:\msys64 --script install' -NoNewWindow -Wait # Update the package database and core system packages C:\msys64\usr\bin\bash -lc "pacman -Syuu --noconfirm" C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" From 205ada1d85912afdd16674d429c7ebdae4cdb6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 18 Jul 2024 23:59:00 +0200 Subject: [PATCH 08/21] Use msys2/setup-msys2@v2 --- .github/workflows/actions.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 503e7d5..f68dc16 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -262,15 +262,10 @@ jobs: $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' echo "DISTDIR=$DISTDIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Set up MSYS2 - run: | - # Download and install MSYS2 - curl -L -o msys2-x86_64.exe https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-latest.exe - Start-Process msys2-x86_64.exe -ArgumentList '--root C:\msys64 --script install' -NoNewWindow -Wait - # Update the package database and core system packages - C:\msys64\usr\bin\bash -lc "pacman -Syuu --noconfirm" - C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" - # Install the required packages - C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm base-devel mingw-w64-x86_64-toolchain" + uses: msys2/setup-msys2@v2 + with: + update: true + install: base-devel mingw-w64-x86_64-toolchain - name: Add MSYS2 to Path run: echo "::add-path::C:\msys64\usr\bin" - name: install perl modules and build and test From e3b0a824af850e5caea6533b410e6f509897722a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 00:09:29 +0200 Subject: [PATCH 09/21] Use GITHUB_PATH to modify PATH --- .github/workflows/actions.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f68dc16..734be4d 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -267,7 +267,8 @@ jobs: update: true install: base-devel mingw-w64-x86_64-toolchain - name: Add MSYS2 to Path - run: echo "::add-path::C:\msys64\usr\bin" + run: | + echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module From 9be9b0e8ba36f836835733620ef9acfd247d9edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 00:30:16 +0200 Subject: [PATCH 10/21] Added some debug output --- .github/workflows/actions.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 734be4d..eae6b27 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -269,14 +269,16 @@ jobs: - name: Add MSYS2 to Path run: | echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH + echo "PATH = $env:PATH" - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | + echo "PATH = $env:PATH" $BASEDIR = $PWD cd $env:DISTDIR $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" - &cpanm -vn Alien::MSYS + cpanm -vn Alien::MSYS &cpanm -vn Net::SSLeay &cpanm -n Alien::Build &cpanm -vn Math::GSL::Alien@1.05 From 416c3f2c1a5c6cc8b1be49e9c9487a74aa20eee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 09:51:13 +0200 Subject: [PATCH 11/21] Debug: check cpanm existence and shebang line --- .github/workflows/actions.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index eae6b27..59acb0e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -270,15 +270,28 @@ jobs: run: | echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH echo "PATH = $env:PATH" + - name: Verify cpanm existence and check shebang + shell: pwsh + run: | + $cpanmPath = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm" + if (Test-Path $cpanmPath) { + echo "cpanm found at $cpanmPath" + Get-Content $cpanmPath -First 1 | ForEach-Object {echo "Shebang: $_"} + } else { + echo "cpanm not found at $cpanmPath" + } - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | echo "PATH = $env:PATH" + ls D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm $BASEDIR = $PWD cd $env:DISTDIR $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" - cpanm -vn Alien::MSYS + echo "ok" + &cpanm -vn Alien::MSYS + echo "ok2" &cpanm -vn Net::SSLeay &cpanm -n Alien::Build &cpanm -vn Math::GSL::Alien@1.05 From 6ed47f4bcb2113ae4394825e1a7c74f47d0ce415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 11:02:24 +0200 Subject: [PATCH 12/21] More debugging output --- .github/workflows/actions.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 59acb0e..fac3158 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -270,22 +270,31 @@ jobs: run: | echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH echo "PATH = $env:PATH" + - name: Verify cpanm existence and check shebang shell: pwsh run: | - $cpanmPath = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm" - if (Test-Path $cpanmPath) { - echo "cpanm found at $cpanmPath" - Get-Content $cpanmPath -First 1 | ForEach-Object {echo "Shebang: $_"} - } else { - echo "cpanm not found at $cpanmPath" - } + $cpanmPath = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm" + $cpanmBatPath = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm.bat" + if (Test-Path $cpanmPath) { + echo "cpanm found at $cpanmPath" + Get-Content $cpanmPath -First 1 | ForEach-Object {echo "Shebang: $_"} + } else { + echo "cpanm not found at $cpanmPath" + } + if (Test-Path $cpanmBatPath) { + echo "cpanm.bat found at $cpanmBatPath" + echo "Contents of cpanm.bat:" + Get-Content $cpanmBatPath | ForEach-Object {echo $_} + } else { + echo "cpanm.bat not found at $cpanmBatPath" + } - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | echo "PATH = $env:PATH" - ls D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm + perl -V $BASEDIR = $PWD cd $env:DISTDIR $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" From 9a0be081172923b066c0ae226153c42811068e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 18:35:27 +0200 Subject: [PATCH 13/21] More debugging --- .github/workflows/actions.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index fac3158..459519e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -113,12 +113,12 @@ jobs: run: | ./.github/scripts/build_dist.sh - name: Save dist as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: math_gsl_dist path: ${{ env.MATH_GSL_DISTNAME }} - name: Save name of dist as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: math_gsl_dist_name path: math-gsl-dist-name.txt @@ -162,11 +162,11 @@ jobs: PERL_DIR: ~/perl/${{runner.os}}/5.${{ matrix.perl }} GSL_NAME: gsl-${{ matrix.gsl }} GSL_DIR: ~/gsl/${{runner.os}}/gsl-${{ matrix.gsl }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: math_gsl_dist - name: Download dist name - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: math_gsl_dist_name - name: extract dist @@ -210,11 +210,11 @@ jobs: env: PERL_NAME: perl-5.${{ matrix.perl }} PERL_DIR: ~/perl/${{runner.os}}/5.${{ matrix.perl }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: math_gsl_dist - name: Download dist name - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: math_gsl_dist_name - name: extract dist @@ -247,11 +247,11 @@ jobs: perl-version: ${{ matrix.perl }} distribution: strawberry - name: Download dist - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: math_gsl_dist - name: Download dist name - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: math_gsl_dist_name - name: extract dist @@ -268,6 +268,7 @@ jobs: install: base-devel mingw-w64-x86_64-toolchain - name: Add MSYS2 to Path run: | + echo "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin" >> $env:GITHUB_PATH echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH echo "PATH = $env:PATH" From c2d885d04b48c6b042c8c649dbc6b50e66154e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 18:47:17 +0200 Subject: [PATCH 14/21] More debugging --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 459519e..424f703 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -268,7 +268,6 @@ jobs: install: base-devel mingw-w64-x86_64-toolchain - name: Add MSYS2 to Path run: | - echo "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin" >> $env:GITHUB_PATH echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH echo "PATH = $env:PATH" @@ -294,6 +293,7 @@ jobs: shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | + $env:PATH = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin;$env:PATH" echo "PATH = $env:PATH" perl -V $BASEDIR = $PWD From b5672948ce8d75a56bfbade35e72e773ca360e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 19:09:12 +0200 Subject: [PATCH 15/21] More debugging --- .github/workflows/actions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 424f703..f775ed3 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -257,6 +257,7 @@ jobs: - name: extract dist shell: pwsh run: | + perl -V $DISTNAME = Get-Content -Path math-gsl-dist-name.txt tar -zxvf $DISTNAME $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' @@ -268,6 +269,7 @@ jobs: install: base-devel mingw-w64-x86_64-toolchain - name: Add MSYS2 to Path run: | + perl -V echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH echo "PATH = $env:PATH" From 379e4f73d6bd6f344d7fbc578769d257730ae635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 19:27:24 +0200 Subject: [PATCH 16/21] More debugging --- .github/workflows/actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f775ed3..86c9986 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -270,6 +270,7 @@ jobs: - name: Add MSYS2 to Path run: | perl -V + where.exe perl echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH echo "PATH = $env:PATH" From fb43792e38a62abe9a90513fe7029b225a7eb80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 19:51:29 +0200 Subject: [PATCH 17/21] More debugging --- .github/workflows/actions.yml | 41 +++++++++++++---------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 86c9986..77d2711 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -257,11 +257,24 @@ jobs: - name: extract dist shell: pwsh run: | - perl -V $DISTNAME = Get-Content -Path math-gsl-dist-name.txt tar -zxvf $DISTNAME $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' echo "DISTDIR=$DISTDIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Add Strawberry Perl to PATH + shell: pwsh + run: | + $perlPaths = &where.exe perl + echo "All Perl paths found:" + echo $perlPaths + $perlPath = $perlPaths | Select-String -Pattern "C:\\hostedtoolcache\\windows\\strawberry-perl" + if ($perlPath) { + $perlDir = [System.IO.Path]::GetDirectoryName($perlPath -split "`n")[0] # Get the first matching path and its directory + echo "Strawberry Perl found at $perlDir" + echo "STRAWBERRY_PERL_PATH=$perlDir" >> $env:GITHUB_ENV + } else { + echo "Strawberry Perl not found" + } - name: Set up MSYS2 uses: msys2/setup-msys2@v2 with: @@ -269,42 +282,18 @@ jobs: install: base-devel mingw-w64-x86_64-toolchain - name: Add MSYS2 to Path run: | - perl -V - where.exe perl echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH - echo "PATH = $env:PATH" - - - name: Verify cpanm existence and check shebang - shell: pwsh - run: | - $cpanmPath = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm" - $cpanmBatPath = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin\cpanm.bat" - if (Test-Path $cpanmPath) { - echo "cpanm found at $cpanmPath" - Get-Content $cpanmPath -First 1 | ForEach-Object {echo "Shebang: $_"} - } else { - echo "cpanm not found at $cpanmPath" - } - if (Test-Path $cpanmBatPath) { - echo "cpanm.bat found at $cpanmBatPath" - echo "Contents of cpanm.bat:" - Get-Content $cpanmBatPath | ForEach-Object {echo $_} - } else { - echo "cpanm.bat not found at $cpanmBatPath" - } - name: install perl modules and build and test shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | - $env:PATH = "D:\a\_actions\shogo82148\actions-setup-perl\v1\bin;$env:PATH" + $env:PATH = "$env:STRAWBERRY_PERL_PATH;$env:PATH" echo "PATH = $env:PATH" perl -V $BASEDIR = $PWD cd $env:DISTDIR $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" - echo "ok" &cpanm -vn Alien::MSYS - echo "ok2" &cpanm -vn Net::SSLeay &cpanm -n Alien::Build &cpanm -vn Math::GSL::Alien@1.05 From 5c785ca84bb59e0e0b67a59d07ff61de23e63aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 20:19:44 +0200 Subject: [PATCH 18/21] More debugging --- .github/workflows/actions.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 77d2711..b24f900 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -261,6 +261,7 @@ jobs: tar -zxvf $DISTNAME $DISTDIR = $DISTNAME -replace '\.tar\.gz$', '' echo "DISTDIR=$DISTDIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Add Strawberry Perl to PATH shell: pwsh run: | @@ -269,7 +270,7 @@ jobs: echo $perlPaths $perlPath = $perlPaths | Select-String -Pattern "C:\\hostedtoolcache\\windows\\strawberry-perl" if ($perlPath) { - $perlDir = [System.IO.Path]::GetDirectoryName($perlPath -split "`n")[0] # Get the first matching path and its directory + $perlDir = [System.IO.Path]::GetDirectoryName(($perlPath | Select-Object -First 1).Line) echo "Strawberry Perl found at $perlDir" echo "STRAWBERRY_PERL_PATH=$perlDir" >> $env:GITHUB_ENV } else { From 9940a819457e0307557389751df7aa4a4883825b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 19 Jul 2024 20:54:43 +0200 Subject: [PATCH 19/21] More debugging --- .github/workflows/actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index b24f900..c17498a 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -295,6 +295,7 @@ jobs: cd $env:DISTDIR $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" &cpanm -vn Alien::MSYS + perl -MAlien::MSYS -E "say Alien::MSYS->msys_path" &cpanm -vn Net::SSLeay &cpanm -n Alien::Build &cpanm -vn Math::GSL::Alien@1.05 From 809cec0da6ceaaa43d62380345b713927f7021b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Sat, 20 Jul 2024 10:54:11 +0200 Subject: [PATCH 20/21] Install m4.exe manually --- .github/workflows/actions.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c17498a..05bb880 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -281,6 +281,13 @@ jobs: with: update: true install: base-devel mingw-w64-x86_64-toolchain + - name: Update MSYS2 and install m4 package + # Note: adding m4 to the install list in the setup-msys2 action did not work + # so we have to install it manually + run: | + C:\msys64\usr\bin\pacman -Syu --noconfirm + C:\msys64\usr\bin\pacman -S --noconfirm m4 + shell: cmd - name: Add MSYS2 to Path run: | echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH From 843f01159dec47af43ab21f482ce08895df54415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Sat, 20 Jul 2024 11:37:24 +0200 Subject: [PATCH 21/21] Use correct binaries --- .github/workflows/actions.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 05bb880..2e5713e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -295,13 +295,16 @@ jobs: shell: pwsh # NOTE: This should first download and install libgsl using the Math::GSL::Alien module run: | - $env:PATH = "$env:STRAWBERRY_PERL_PATH;$env:PATH" + #$env:PATH = "$env:STRAWBERRY_PERL_PATH;$env:PATH" + $Perl = "$env:STRAWBERRY_PERL_PATH\perl" + $Perlcpanm = "$env:STRAWBERRY_PERL_PATH\cpanm" echo "PATH = $env:PATH" - perl -V + & $Perl -V $BASEDIR = $PWD cd $env:DISTDIR $env:PERL_ALIEN_MSYS_BIN = "C:\msys64\usr\bin" - &cpanm -vn Alien::MSYS + & $Perl $Perlcpanm -vn Alien::MSYS + $env:PATH = "$env:STRAWBERRY_PERL_PATH;$env:PATH" perl -MAlien::MSYS -E "say Alien::MSYS->msys_path" &cpanm -vn Net::SSLeay &cpanm -n Alien::Build