Subject: | Building module on MacOS (Bad regex in OS detection) |
Date: | Tue, 11 Feb 2020 15:12:26 -0700 |
To: | bug-DBD-Sybase [...] rt.cpan.org |
From: | Dean Rantala <deanrantala [...] gmail.com> |
Found an issue when trying to install DBD::Sybase on MacOS.
Method of installation:
perl -MCPAN -e shell
OS: MacOS Catalina
Perl Version: This is perl 5, version 30, subversion 0 (v5.30.0) built for
darwin-thread-multi-2level
Issue: when trying to install the module (CPAN or manually downloading),
the Makefile.PL incorrectly identifies my OS as Windows. While I did not
dig too deep into the actual detection logic itself, I found around line
144:
if($^O =~ /win/i) {
@libdir = ( 'dll' );
}
What I did to [temporarily] correct the issue was simply comment out the
array overwriting. This way, /usr/local/lib and /usr/local/lib64 are
correctly checked (vs /usr/local/dll).
It seems the core issue is that this module assumes anything with "win" in
the $^O variable means "windows".. but on MacOS the OSNAME is 'darwin'..
Also, it has been years - but I swear I have seen other scripts that have
also performed the OS check with (darwin|mac).
Perhaps the proper fix for this is:
if($^O =~/win/i && $^O!~/(darwin|mac)/i) {...
Just something that checks to ensure it is NOT MacOS?
-Dean
--
Dean M. Rantala
Phone (US/Denver): +1 (720) 639-0459
Phone (Mexico/Hidalgo): +52 773 114 6440 (WhatsApp)
Skype: deanrantala