StrawberryPerl / Perl-Dist-Strawberry

Tooling to build and package releases for Perl on Windows.
https://strawberryperl.com
Other
289 stars 49 forks source link

SP 5.38.2 fails on GitHub Actions at pl2bat #174

Closed mohawk2 closed 3 months ago

mohawk2 commented 8 months ago

Excerpt from build of PDL-NDBin just now:

  "C:\hostedtoolcache\windows\strawberry-perl\5.38.2\x64\perl\bin\perl.exe" -MExtUtils::Command -e cp -- pptemplate ..\..\blib\script\pptemplate
  pl2bat.bat ..\..\blib\script\pptemplate
  Can't execute /c/hostedtoolcache/windows/strawberry-perl/5.38.2/x64/perl/bin/pl2bat.bat.
  gmake[2]: *** [Makefile:433: ..\..\blib\script\pptemplate] Error 29
  gmake[2]: Leaving directory 'C:/Users/RUNNER~1/.cpanm/work/1711465690.4852/PDL-2.085_02/Basic/Gen'
  gmake[1]: *** [Makefile:511: subdirs] Error 2
  gmake[1]: Leaving directory 'C:/Users/RUNNER~1/.cpanm/work/1711465690.4852/PDL-2.085_02/Basic'
  gmake.EXE: *** [makefile:524: subdirs] Error 2
  -> FAIL Installing PDL::Basic failed. See C:\Users\RUNNER~1\.cpanm\work\1711465690.4852\build.log for details. Retry with --force to force install it.

When I switch that CI instead to 5.32, it doesn't have that error.

shawnlaffan commented 8 months ago

I cannot reproduce this locally using 5.38.2.2.

Which version of 5.38 is being used under CI?

Also, what specific flags are you passing to the build? It's possible the issue is related to parallel builds (I ran without any parallel flags).

Update:

Run from commit:

commit bf88db3ec6228c4afb4ef81e1bd1688167728b28 (HEAD -> master, tag: 2.085_02, origin/master, origin/HEAD) Author: Ed J mohawk2@users.noreply.github.com Date: Mon Mar 25 20:31:24 2024 +0000

2.085_02
mohawk2 commented 8 months ago

The log I excerpted shows 5.38.2. The above was not run from PDL, but PDL-NDBin, so I don't know why you're putting anything about PDL?

shawnlaffan commented 8 months ago

I assumed it was part of the main PDL distro. Will test with PDL-NDBin when I get a chance later today.

Can you note the make flags used? e.g. number of parallel runs requested.

shawnlaffan commented 8 months ago

I assumed it was part of the main PDL distro. Will test with PDL-NDBin when I get a chance later today.

Can you note the make flags used? e.g. number of parallel runs requested.

mohawk2 commented 8 months ago

The CI config is on https://github.com/ebaudrez/PDL-NDBin/blob/master/.github/workflows/ci.yml

The action it's using is in PDLPorters/devops, at https://github.com/PDLPorters/devops/blob/master/github-actions/ci-dist/action.yml#L162-L167 which shows the relevant part - it is indeed doing parallel build. I can't see how that would cause a "failure to execute pl2bat"?

shawnlaffan commented 8 months ago

Thanks for the details.

The parallel mode might not be relevant, but it's good to be able to eliminate issues, even if unlikely.

sisyphus commented 8 months ago

FWIW, it builds fine for me on Windows 11 (with -j8). Is it possible that /c/hostedtoolcache/windows/strawberry-perl/5.38.2/x64/perl/bin/pl2bat.bat is being interpreted as (edited):

C:/c/hostedtoolcache/windows/strawberry-perl/5.38.2/x64/perl/bin/pl2bat.bat

instead of as:

C:/hostedtoolcache/windows/strawberry-perl/5.38.2/x64/perl/bin/pl2bat.bat
shawnlaffan commented 8 months ago

Thanks Rob.

It also builds fine for me on Win11, using both SP 5.38.2.2 and 5.38.0.1.

mohawk2 commented 8 months ago

If you wanted to have a go at reproducing this in the reported environment, you could fork PDL-NDBin, revert the commit where I version-pinned SP, and then cause the CI to do debugging stuff?

shawnlaffan commented 3 months ago

Just looping back to this.

This does not appear to be an issue with Strawberry Perl. So far as I can tell it is either with PDL or ExtUtils::MakeMaker, caused by something like an interaction with MSYS2 paths in a windows shell.

The error logs in the first comment are related to a PDL build. The Makefile that errors is under .../PDL-2.085_02/Basic/Gen.

When I build PDL locally and check the generated Basic/Gen/Makefile the line specifying pl2bat does not provide a full path (L245). This means it is looked for in the path and thus any windows/MSYS2 style differences can have an impact if they are not handled by the shell the command is called from.

FIXIN = pl2bat.bat

All other paths are fully specified. For example L84-L87 contains:

PERLPREFIX = C:\perls\5.40.0.1_PDL_xx\perl
SITEPREFIX = C:\perls\5.40.0.1_PDL_xx\perl\site
VENDORPREFIX = C:\perls\5.40.0.1_PDL_xx\perl\vendor
INSTALLPRIVLIB = C:\perls\5.40.0.1_PDL_xx\perl\lib

This part of ExtUtils::MakeMaker might be the place to update things: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/blob/5b79f2e55bfa308a282f5abbd1733cfd1d7862db/lib/ExtUtils/MM_Win32.pm#L145-L147

mohawk2 commented 3 months ago

I think you're right! Do you mind opening an EUMM issue? This is definitely not something that PDL has any knowing effect on.

shawnlaffan commented 3 months ago

I'll close this issue now. Further discussion is best done on the upstream issue (https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/459) or PR (https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/460).