Opened 3 years ago

Last modified 2 years ago

#56638 assigned defect

p5-tkx doesn't depend on or use tk port

Reported by: chrstphrchvz (Christopher Chavez) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.5.2
Keywords: Cc:
Port: p5-tkx p5-tcl

Description

p5-tkx doesn't depend on the tk port. For comparison, other package managers have their Tkx package depend on Tk (e.g. on debian, libtkx-perl depends on Tk). Is it intentionally omitted from the port?

However, even if p5-tkx did depend on tk, I don't think it would have any effect, since the system's Tcl/Tk is being used (reports version 8.5.9 on macOS 10.13) even when MacPorts' Tcl/Tk (8.6.8) is installed. And Tkx does not appear to be the only module with this issue: I've installed Tcl::pTk (separately from CPAN, though I'm interested in creating a port for it) and I observe that it uses the system Tcl/Tk as well. So I'm wondering if the issue might be in either the p5-tcl, tcl, or tk ports.

Change History (10)

comment:1 Changed 3 years ago by mojca (Mojca Miklavec)

I admit I did not pay attention at which version of Tcl or Tk was used. I tried to figure it out, but it's not yet entirely clear to me how to properly do this.

I assume that this would need a fix in p5-tcl. The Makefile.PL mentions

Usage: perl Makefile.PL [--tclsh <path>] [--tclconfig <path>]
                        [--buildspec] [--nousestubs] [<makemaker opts>...]

or for expert compilation:

       perl --library=-l/path/to/tcl(stub).a --include=-I/path/to/tcl/include
            --define="-DLIB_RUNTIME_DIR=... -DTCL_LIB_FILE=..."

Searching further I have found /opt/local/lib/tclConfig.sh, but inspecting this file ... it looks pretty problematic, with references to build directory which no longer exists etc.

Advice and suggestions welcome, I'm not sure if I could invest sufficient time to fix this properly.

comment:2 in reply to:  1 Changed 3 years ago by ryandesign (Ryan Schmidt)

Replying to mojca:

Searching further I have found /opt/local/lib/tclConfig.sh, but inspecting this file ... it looks pretty problematic, with references to build directory which no longer exists etc.

...which is no different from how the one provided by Apple in /usr/lib/tclConfig.sh works. I think we can just assume that all of the variables in those scripts whose values contain references to the build directory are never used by anyone, since obviously they would not work after the build directory is removed.

So I would try using the --tclconfig build option and see what happens.

comment:3 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Port: p5-tcl added

Also, I noticed the --nousestub option in configure.args-append should probably be --nousestubs. But the only difference that makes by itself is preventing a dyld warning from appearing (once during configure and once during destroot).

Even without --tclconfig, it already reports Using config data in /opt/local/lib/tclConfig.sh:

--->  Configuring p5.26-tcl
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_perl_p5-tcl/p5.26-tcl/work/Tcl-1.05" && /opt/local/bin/perl5.26 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" --nousestub
Using config data in /opt/local/lib/tclConfig.sh
LIBS   = -L/opt/local/lib -ltcl8.6
INC    = -I/opt/local/include
DEFINE =
dyld: warning: could not load inserted library '/opt/local/libexec/macports/lib/darwintrace1.0/darwintrace.dylib' into library validated process because no suitable image found.  Did find:
        /opt/local/libexec/macports/lib/darwintrace1.0/darwintrace.dylib: code signing blocked mmap() of '/opt/local/libexec/macports/lib/darwintrace1.0/darwintrace.dylib'
        /opt/local/libexec/macports/lib/darwintrace1.0/darwintrace.dylib: stat() failed with errno=1
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Tcl
Writing MYMETA.yml and MYMETA.json
Fixing flags in Makefile

Compare to with --tclconfig:

--->  Configuring p5.26-tcl
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_perl_p5-tcl/p5.26-tcl/work/Tcl-1.05" && /opt/local/bin/perl5.26 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" --nousestubs --tclconfig /opt/local/lib/tclConfig.sh
Using config data in /opt/local/lib/tclConfig.sh
LIBS   = -L/opt/local/lib -ltcl8.6
INC    = -I/opt/local/include
DEFINE =
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Tcl
Writing MYMETA.yml and MYMETA.json
Fixing flags in Makefile

comment:4 Changed 3 years ago by mf2k (Frank Schima)

Cc: mojca removed
Owner: set to mojca
Status: newassigned

comment:5 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

I've also tried setting --tclsh ${prefix}/bin/tclsh but that has made no difference as well.

$ perl5.26 -e 'use Tcl; print Tcl->new->Eval("puts \$tcl_version")'
8.5

I do think it's probably a good idea to have --tclsh and --tclconfig specified anyways to make sure nothing else gets used by accident.

comment:6 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

I can get p5-tcl (and p5-tkx) to use Tcl/Tk 8.6 on my machine now, but I'm not quite sure how I got it working other than possibly uninstalling/reinstalling tcl, tk, p5-tcl, and p5-tkx each at some point recently. Maybe this is still an issue in the sense that p5-tcl should only look for MacPorts Tcl/Tk rather than allow the system Tcl/Tk to be used, however I'm fine with closing this for now as e.g. WORKSFORME or INVALID.

comment:7 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

I'm forgetting why I opened this ticket in the first place. The p5-tkx port still needs to depend on Tk; I have submitted a PR for that (https://github.com/macports/macports-ports/pull/2037).

I'll need to retrace my steps some more to figure out if there's an issue with p5-tcl still, should that discussion move to another ticket?

comment:8 Changed 2 years ago by chrstphrchvz (Christopher Chavez)

Not long after I reported this, some improvements were made to Tcl.pm's Makefile.PL which could affect building on macOS. I tried reverting the p5-tcl Portfile to use the earlier Tcl.pm versions (1.05 and 1.06), but still could not reproduce the issue of p5-tcl using macOS' Tcl 8.5. For future safety though, I'll open a PR so that p5-tcl is using tclsh and tclConfig.sh from MacPorts.

comment:9 Changed 2 years ago by chrstphrchvz (Christopher Chavez)

In 20bcf55af1582302c4aa22e5e788b47ff5ff475a/macports-ports (master):

p5-tcl: add Makefile.PL options, self to maintainers

Specify --tclsh and --tclconfig, fix spelling of --nousestubs
to try preventing e.g. macOS' included Tcl from being used

See: #56638

comment:10 Changed 2 years ago by chrstphrchvz (Christopher Chavez)

I'm fine with this ticket being closed (I don't have permission to close it myself). Or would it be better to leave this open for visibility in case someone else manages to reproduce the issue?

Note: See TracTickets for help on using tickets.