Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64507 closed defect (fixed)

install-dependencies failed with an unlikely error

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: admin@…
Priority: Normal Milestone:
Component: buildbot/mpbb Version:
Keywords: Cc: mascguy (Christopher Nielsen)
Port:

Description

install-dependencies failed unexpectedly when trying to install psfex:

https://build.macports.org/builders/ports-11_x86_64-builder/builds/62361/steps/install-dependencies/logs/stdio

--->  Unable to deactivate tcl @8.6.12_0+corefoundation+threads, the following ports depend on it:
--->  	tk @8.6.12_0+x11
Warning: Deactivate forced.  Proceeding despite dependencies.
--->  Deactivating tcl @8.6.12_0+corefoundation+threads
--->  Cleaning tcl
Warning: Failed to open Portfile from registry for py39-importlib-metadata @4.10.0_0
--->  Deactivating py39-importlib-metadata @4.10.0_0
deactivating unneeded ports took 42 seconds
Error: couldn't read file "/opt/local/lib/tcl8/8.5/msgcat-1.6.1.tm": no such file or directory
    while executing
"error $result"
    (procedure "mportopen" line 53)
    invoked from within
"mportopen $dep_portinfo(porturl) $dep_options $variations"
    (procedure "mportdepends" line 126)
    invoked from within
"mportdepends $depport {} $recurseDeps $skipSatisfied 1"
    (procedure "mportdepends" line 184)
    invoked from within
"mportdepends $mport "activate""
Error: mportdepends psfex activate failed: couldn't read file "/opt/local/lib/tcl8/8.5/msgcat-1.6.1.tm": no such file or directory
Processing dependencies for 'psfex' failed, aborting.
./mpbb/mpbb: error: `install-dependencies' failed to run successfully

I doubt that couldn't read file "/opt/local/lib/tcl8/8.5/msgcat-1.6.1.tm": no such file or directory is the real reason why it failed, the tcl port which provides that file having been successfully deactivated already, but I don't know what the real error is.

Change History (6)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

The code surrounding mportopen line 53 where the error is thrown is

    if {[catch {$workername eval {source Portfile}} result]} {
        mportclose $mport
        ui_debug $::errorInfo
        error $result
    }

comment:2 Changed 2 years ago by jmroot (Joshua Root)

I wonder if the Tcl interpreter running dependencies.tcl really is using that version of msgcat for some reason, and getting confused when it's deleted.

comment:3 Changed 2 years ago by jmroot (Joshua Root)

Yep, Tcl "helpfully" adds ${prefix}/lib to auto_path when the interpreter is executed as ${prefix}/bin/port-tclsh (or indeed anything under ${prefix}/bin). https://github.com/macports/macports-base/blob/master/vendor/tcl8.5.19/library/init.tcl#L55-L59

This problem is avoided by port(1) because its interpreter is set to ${prefix}/libexec/macports/bin/tclsh8.5.

comment:4 Changed 2 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

In e30835a20648027854888d686dbfa8ae2d34a79c/mpbb (master):

mpb: resolve port-tclsh symlink before executing

This avoids an undesirable modification of auto_path due to Tcl trying
to be helpful.

Closes: #64507

comment:5 Changed 2 years ago by neverpanic (Clemens Lang)

I guess we may also want to look into a way to prevent this for all users of port-tclsh, e.g. by replacing it with a shell script:

#!/bin/sh
exec @prefix@/libexec/macports/bin/tclsh8.5 "$@"

comment:6 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Note: See TracTickets for help on using tickets.