Skip to content
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

perl Makefile.PL #17835

Open
1 of 7 tasks
takulark opened this issue Jul 22, 2023 · 12 comments
Open
1 of 7 tasks

perl Makefile.PL #17835

takulark opened this issue Jul 22, 2023 · 12 comments
Labels

Comments

@takulark
Copy link

takulark commented Jul 22, 2023

Description / Steps to reproduce the issue

perl Makefile.PL can't be done.

perl -MCPAN -e shell
cpan[1]>reload index
cpan[2]>make ExtUtils::MakeMaker
shell cmd <-stop

ctrl+c
exit <-Force quit with

cd ~/.cpan/build/ExtUtils-MakeMaker-7.70-0
patches(Needs a patch for each update)
perl Makefile.PL INSTALLDIRS=site
make install

Although it is a modification of Config_heavy.pl, it can be omitted.
+++ lib/ExtUtils/MM_Win32.pm
@@ -40,7 +40,14 @@
        my $BORLAND = $config->{cc} =~ /\bbcc/i ? 1 : 0;
        my $GCC     = $config->{cc} =~ /\bgcc\b/i ? 1 : 0;
        my $MSVC    = $config->{cc} =~ /\b(?:cl|icl)/i ? 1 : 0; # MSVC can come as clarm.exe, icl=Intel C
-
+#      for my $cv (keys %$config) {
+#          next if(!exists $config->{$cv});
+#          my $v=$config->{$cv};
+#          next if(!defined $v);
+#          if($v=~/\w:\\/i){
+#              $v=~ s/\\/\//g;
+#              $config->{$cv}=$v;
+#          }}
        return ( $BORLAND, $GCC, $MSVC );
 }
need this.
@@ -120,7 +127,7 @@

 =cut

-sub init_DIRFILESEP {
+sub init_DIRFILESEPd {
     my($self) = shift;

     # The ^ makes sure its not interpreted as an escape in nmake
@@ -139,7 +146,7 @@
 sub init_tools {
     my ($self) = @_;

-    $self->{NOOP}     ||= 'rem';
+#    $self->{NOOP}     ||= 'rem';
     $self->{DEV_NULL} ||= '> NUL';

     $self->{FIXIN}    ||= $self->{PERL_CORE} ?
@@ -226,7 +233,7 @@

 =cut

-sub specify_shell {
+sub specify_shelld {
     my $self = shift;
     return '' unless $self->is_make_type('gmake');
     "\nSHELL = $ENV{COMSPEC}\n";


Expected behavior

File::Spec::Win32 & ExtUtils::MM_Win32
is made for Command Prompt (CMD).
\ is not a dir separator on bash.
It cannot be used as is, so a patch is required.

+++ File/Spec.pm
@@ -15,8 +15,8 @@
              cygwin  => 'Cygwin',
              amigaos => 'AmigaOS');

-
-my $module = $module{$^O} || 'Unix';
+my $os=$^O;$os='cygwin' if $ENV{'MSYSTEM'} eq "MINGW64";
+my $module = $module{$os} || 'Unix';

 require "File/Spec/$module.pm";
 our @ISA = ("File::Spec::$module");

sample.
before patch
-INST_AUTODIR = $(INST_LIB)\auto$(FULLEXT)
-INST_ARCHAUTODIR = $(INST_ARCHLIB)\auto$(FULLEXT)
After patch
+INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
+INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)

Actual behavior

Verification

Windows Version

MINGW64_NT-10.0-19045

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

No response

@takulark takulark added the bug label Jul 22, 2023
@Biswa96
Copy link
Member

Biswa96 commented Jul 25, 2023

Please fill up the issue template and explain the issue.

@zmughal
Copy link

zmughal commented Jul 25, 2023

It looks like this is trying to patch ExtUtils::MakeMaker, but I'm not sure why. Can you explain what you are using this for? These aren't the kinds of issues I've had with ExtUtils::MakeMaker under MSYS2's MinGW64.

@takulark
Copy link
Author

Edited for clarity.
MSYS is patched.

@Biswa96
Copy link
Member

Biswa96 commented Jul 26, 2023

What issue are you trying to solve?

@takulark
Copy link
Author

cmd starts and ends.
Even if I fix the makefile here
Because the dir separator is different
cp lib/yyy/xxx.pm blib\yyy\xxx.pm ->blibyyyxxx.pm
become.

@zmughal
Copy link

zmughal commented Jul 26, 2023

What specifically are you trying to install and how are you running it? Info such as:

which perl
echo $PATH
echo $MSYSTEM
echo $SHELL

would help as well.

@takulark
Copy link
Author

Discovered that XML::Parser is required.
perl -MCPAN -e shell,Trying to get install in.
OS is judgement only by $^O. not considering the shell.
Because it is also necessary for module creation of ActivePerl.

which perl
echo $PATH
echo $MSYSTEM
echo $SHELL
/mingw64/bin/perl
/mingw64/bin:/mingw64/bin/site_perl/5.32.1:/mingw64/bin/vendor_perl:/mingw64/bin/core_perl:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows
MINGW64
/usr/bin/bash

@revelator
Copy link
Contributor

revelator commented Jul 27, 2023

i think i know what he means, the XML::Parser module is missing from the mingw-w64-perl packages but is needed by other build packages. i ran into this one myself so i installed it to mingw-w64-perl and no problems since.
it builds fine so could we add it to the mingw-w64-perl packages ?.

@revelator
Copy link
Contributor

made a package for it ->
mingw-w64-perl-xml-parser.zip

feel free to add it to the repo if usefull.

@takulark
Copy link
Author

How about changing $^O?
For example MSWin32sh or MSWin64.
I don't need the patch anymore,
but will changing it cause other problems?

@revelator
Copy link
Contributor

not a perl guru myself but i guess those two might be for msvc ?

@Kreijstal
Copy link
Contributor

Had this issue too compiling sftl, see newsboat/stfl#7 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants