Skip Menu |

This queue is for tickets about the Tcl CPAN distribution.

Report information
The Basics
Id: 132373
Status: open
Priority: 0/
Queue: Tcl

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc: CAC [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.27
Fixed in: (no value)



Subject: Mac Mojave: your tclconfig ... does not provide tcl.h
Building Tcl.pm on a Mac Mojave system is not possible, regardless with the system perl or a self-compiled one: ... $ perl5.30.1 Makefile.PL tclsh=/usr/bin/tclsh tclConfig.sh=/System/Library/Frameworks/Tcl.framework/Versions/8.5/tclConfig.sh tcl_library=/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts tcl_version=8.5 Using config data in /System/Library/Frameworks/Tcl.framework/Versions/8.5/tclConfig.sh incpath -iwithsysroot /System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers from your tclconfig /System/Library/Frameworks/Tcl.framework/Versions/8.5/tclConfig.sh does not provide tcl.h at Makefile.PL line 36. ... However, if I remove the following condition from Makefile.PL: diff --git i/Makefile.PL w/Makefile.PL index 481d3aa..5ed2d07 100755 --- i/Makefile.PL +++ w/Makefile.PL @@ -157,10 +157,10 @@ if (defined($libpath) && defined($incpath)) { # https://www.cpantesters.org/cpan/report/18397198-6bf4-1014-85e5-4e79f459b9c5 # Tcl.xs:32:10: fatal error: tcl.h: No such file or directory if ($incpath) { - my @tclh = grep {-f "$_/tcl.h"} $incpath=~/-I(\S+)/g; - if ($#tclh==-1) { - _die "incpath $incpath from your tclconfig $tclconfig does not provide tcl.h" - } + #my @tclh = grep {-f "$_/tcl.h"} $incpath=~/-I(\S+)/g; + #if ($#tclh==-1) { + # _die "incpath $incpath from your tclconfig $tclconfig does not provide tcl.h" + #} } else {_die "can not figure out incpath from your tclconfig $tclconfig"} if ($usestubs) { ... then building & testing works OK.
I can reproduce this on 10.15 Catalina, but only after specifying --tclconfig and the new full path to tclConfig.sh. (tclsh8.5 doesn't seem to automatically report existence of tclConfig.sh, which like tcl.h and some other files, must now be retrieved using the full SDK path, i.e. /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tcl.framework/Versions/8.5/ . Doing perl5.18 Makefile.PL --nousestubs works for me on Catalina; trying to use stubs currently crashes.)
 
The problem is partly because the tclConfig.sh from binary Tcl/Tk distributions (including OS-provided ones) tends to have hardcoded paths from the system which compiled it, and not the paths used when installed on another machine. On macOS, its included tclConfig.sh says to look in /System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers for tcl.h, but this directory isn't present (anymore). I would think the path to tcl.h must then be specified manually:
 
--include=-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers/
 
but Tcl.pm will still complains that it can't find tcl.h using just tclConfig.sh; I haven't figured out how to get it to ignore tclConfig.sh once it's been picked up (supposedly --library also needs to be specified, but I haven't figured out how to use it on Mac).
 
I had encountered a similar issue with MagicSplat on Windows: https://sourceforge.net/p/magicsplat/discussion/general/thread/c0438cec2a/ . However because of these sorts of issues, some Tcl/Tk developers advised against relying on tclConfig.sh other than for informational purposes: https://wiki.tcl-lang.org/page/tclConfig.sh . Maybe Tcl.pm should not trust/rely on tclConfig.sh as easily as it currently does.