X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 11 Jul 2011 07:55:49 +0200 Message-ID: Subject: Re: Perl's ExtUtils::MakeMaker fails and proposed fix From: Reini Urban To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p6B5uC2H009299 2011/7/7 Marco Moreno: > Reini, > > After doing a little debugging, I discovered why installing ExtUtils::MakeMaker > was failing for me.  ExtUtils::MM_Cygwin.pm contains: > > =item maybe_command > > If our path begins with F then we use C > to determine if it may be a command.  Otherwise we use the tests > from C. > > =cut > > sub maybe_command { >    my ($self, $file) = @_; > >    if ($file =~ m{^/cygdrive/}i) { >        return ExtUtils::MM_Win32->maybe_command($file); >    } > >    return $self->SUPER::maybe_command($file); > } > > > Obviously, if your cygdrive prefix is something else (e.g. '/'), then > this will fail. > > What do you think of this instead: > > =item maybe_command > > Determine whether a file is native to Cygwin by checking whether it > resides inside the Cygwin installation (using Windows paths).  If so, > use C to determine if it may be a command. > Otherwise use the tests from C. > > =cut > > sub maybe_command { >    my ($self, $file) = @_; > >    my $cygwin_winpath = Cygwin::posix_to_win_path('/', 1); >    my $file_winpath = Cygwin::posix_to_win_path($file, 1); > >    return ($file_winpath =~ /^${cygwin_winpath}/) >        ? $self->SUPER::maybe_command($file) >        : ExtUtils::MM_Win32->maybe_command($file); > } > > > This passed all the tests and installed ok for me.  Does this look > ok to you and is it reasonable to assume that native Cygwin > commands will always be inside the Cygwin installation directory? > If this proposed change is worthy of implementing, what is the best > way to do it?  rt.cpan.org? Sorry, I did not come to test this this weekend. Yes, this uncommon cornercase looks worthy to be fixed. Please file a perlbug for this. It should go to rt.perl.org. -- Reini -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple