-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Specify full path to pl2bat.bat #459
Comments
How would one know the full path to pl2bat? I suspect that's tricker to get right than what one may expect. |
The default location would be next to the perl executable, so it would be something like If that does not exist then fall back to the bare name and let the system find it in the path. |
@sisyphus do you think the above would work? |
I don't even know where to start thinking about this. To "fall back to the bare name and let the system find it in the path" could also be rather interesting for me during a Irrespective of the crazy way I might do things, I think it's a good defensive programming technique to be specifying a (correct) fully qualified path to pl2bat.bat, rather than just letting Anyway ... I'm happy to test any PRs that are presented.. Sorry - I reckon I'm probably missing the point(s) here. I admit that I haven't really done much in the way of trying to get my head around it. |
So the system on Windows is more complex than I assumed. That said, "falling back to the path" is leaving things as they are currently, for which If there is an easy way to locate the Another option is to document/clarify how to set the pl2bat path in a Makefile.PL. The assignment in WRT the use of MSYS2 to run Strawberry Perl, it's the CI setup for PDL. Details are best provided by @mohawk2. |
Yes - shortly after I posted it occurred to me that if any part of my perl builds were to execute pl2bat.bat, then it's probably the AS perl 5.16 pl2bat that's being executed.
Having (temporarily) set up MSYS2 shell to run StrawberryPerl-5.40..0.1-PDL, I've built and tested PDL-2.082. For reference, that failing command in the CI build was: UPDATE Is there something wrong with the setup of the CI environment ? UPDATE 2 |
The trigger for the issue is the CI setup with what appear to be several levels of different shells. It still remains useful for EUMM to give the full path to |
To that end, I believe pl2bat.bat will always be installed in the directory specified by $Config{installbin}. So I think your suggestion of assigning "$Config{installbin}/pl2bat.bat" (iff it exists) with the fallback to plain "pl2bat.bat" is worth testing .... if SP wants to take it upon itself to solve a problem that is not of SP's (or perl's) making. I don't know whether it's going to fix the problem with these CI tests, but it might. If you can provide the simple patch before 5.41.3 is released, I'll incorporate into my 5.41.3 builds (which will be fairly extensive). |
No ... that's the one that houses the perl.exe. Duh )-: |
I knew perl's configuration made this distinction, but I didn't know any platform actually used it. Good to know. |
I've added a commit to a forked repo. This shows no issues when building and testing PDL. That does not say much about the original problem as I have not been able to replicate it, but it does show that it builds a complex system. I have not opened a PR as the ternary is too repetitive for my liking (full path repeated twice). A less minimal change would convert the |
Looks good. Hopefully, the problematic CI environment will also find the change to be acceptable. I'll leave that change to MM_Win32.pm as a permanent alteration to my 5P-5.40.0.1-PDL installation, and do likewise to my own 5.40.0 builds of perl. I wonder if the CI environment will accept the backslashes. (My MSYS2 environment clearly has no issue with them while building PDL.)
You could change them to forward slashes if you want. AFAIK perl will still understand them, irrespective of the shell in which we're running. |
MSYS2 can handle Windows paths so long as they are quoted or escaped.
WRT using a forward slash, I think older systems don't handle this? I'm not sure if such systems are supported by EUMM, though. In any case I'll open a PR later today (AEST). I'll add a second commit to neaten up the code to avoid repetition in the ternary. It can always be elided if deemed unnecessary. |
See StrawberryPerl/Perl-Dist-Strawberry#174 for further discussion (mainly StrawberryPerl/Perl-Dist-Strawberry#174 (comment) and StrawberryPerl/Perl-Dist-Strawberry#174 (comment)).
The fixin code in ExtUtils::MM_Win32 does not specify the full path to the file. This generally works but things can be tripped up when running with nested MSYS2 and Windows shells, where MSYS2 style paths do not work when passed to Windows shells (e.g.
/c/somepath/bin/pl2bat.bat
is treated asC:\c\somepath\bin\pl2bat.bat
). In such cases the make utility throws an error and the build stops.One way to avoid this is to specify the full path to pl2bat in ExtUtils::MM_Win32 when creating the Makefile.
ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm
Lines 145 to 147 in 5b79f2e
This would then match all the other utilities which are specified using their full paths.
If this is deemed useful then I can prep a PR.
CC @mohawk2
The text was updated successfully, but these errors were encountered: