Opened 3 years ago

Closed 13 months ago

Last modified 12 months ago

#63078 closed defect (fixed)

`port clean` can fail without identifying the failing port

Reported by: ShadSterling (Shad Sterling) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.9.0
Component: base Version: 2.7.1
Keywords: Cc:
Port:

Description

When I run port clean --all -f all -p it fails without identifying which port it's trying to clean when it fails

The output ends with

--->  Cleaning ssss
--->  Cleaning sstp-client
--->  Cleaning sstrings
Error: Unable to open port: can't read "configure.env": can't read "haskell_stack.env": can't read "haskell_stack.yaml": can't read "worksrcpath": can't read "worksrcdir": can't read "distname": can't read "name": no such variable

If I clean just sstrings, the entire output is

--->  Cleaning sstrings

I'd like to create a ticket for the affected port, but I don't know what port that is, and the output should tell me

Change History (7)

comment:1 Changed 3 years ago by ShadSterling (Shad Sterling)

I added -p as suggested in comment:ticket:62657:5; it doesn't affect the output. I tried adding --verbose to get more information, and got Error: clean does not accept --verbose

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

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

Verbose mode is a global flag so it goes before the action, e.g. sudo port -v clean --all all. If that doesn't show enough information, try debug mode with -d.

This specific failure looks like #63076.

comment:3 Changed 3 years ago by ShadSterling (Shad Sterling)

port -v clean --all -f all -p has more output, but isn't more helpful; ends with:

--->  Cleaning ssss
--->  Removing distfiles for ssss
--->  Removing temporary archives for ssss
--->  Removing work directory for ssss
--->  Cleaning sstp-client
--->  Removing distfiles for sstp-client
--->  Removing temporary archives for sstp-client
--->  Removing work directory for sstp-client
--->  Cleaning sstrings
--->  Removing distfiles for sstrings
--->  Removing temporary archives for sstrings
--->  Removing work directory for sstrings
Error: Unable to open port: can't read "configure.env": can't read "haskell_stack.env": can't read "haskell_stack.yaml": can't read "worksrcpath": can't read "worksrcdir": can't read "distname": can't read "name": no such variable

comment:4 Changed 3 years ago by ShadSterling (Shad Sterling)

The port that was failing after sstrings seems to have been fixed, now port clean all fails after xvega-bindings

Using sudo port -d clean --all all to get debug info now (runs for almost an hour and) generates output ending with

DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/xvega-bindings
DEBUG: OS darwin/20.3.0 (macOS 11.2.3) arch i386
DEBUG: Re-registering default for destroot.target
DEBUG: Re-registering default for configure.dir
DEBUG: Re-registering default for build.dir
DEBUG: Re-registering default for configure.pre_args
DEBUG: Sourcing PortGroup cmake 1.1 from /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/cmake-1.1.tcl
DEBUG: Sourcing PortGroup github 1.0 from /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/github-1.0.tcl
DEBUG: Re-registering default for livecheck.url
DEBUG: Re-registering default for livecheck.regex
DEBUG: adding the default universal variant
DEBUG: Reading variant descriptions from /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/variant_descriptions.conf
DEBUG: Requested variant +aqua is not provided by port xvega-bindings.
DEBUG: Requested variant +cocoa is not provided by port xvega-bindings.
DEBUG: Requested variant +no_x11 is not provided by port xvega-bindings.
DEBUG: Requested variant -x11 is not provided by port xvega-bindings.
DEBUG: Requested variant +bash_completion is not provided by port xvega-bindings.
DEBUG: Requested variant +quartz is not provided by port xvega-bindings.
DEBUG: Executing variant universal provides universal
DEBUG: Running callback portconfigure::add_automatic_compiler_dependencies
DEBUG: Finished running callback portconfigure::add_automatic_compiler_dependencies
DEBUG: Running callback portbuild::add_automatic_buildsystem_dependencies
DEBUG: Finished running callback portbuild::add_automatic_buildsystem_dependencies
DEBUG: Running callback portstartupitem::add_notes
DEBUG: Finished running callback portstartupitem::add_notes
DEBUG: Executing org.macports.main (xvega-bindings)
DEBUG: clean phase started at Sun Jun 27 18:16:41 EDT 2021
--->  Cleaning xvega-bindings
DEBUG: Executing org.macports.clean (xvega-bindings)
--->  Removing distfiles for xvega-bindings
DEBUG: Looking for xvega-bindings-0.0.10.tar.gz
DEBUG: No distfiles found to remove at /opt/local/var/macports/distfiles/xvega-bindings
DEBUG: No patchfiles found to remove at /opt/local/var/macports/distfiles/xvega-bindings
DEBUG: No distfile directory found to remove.
--->  Removing temporary archives for xvega-bindings
DEBUG: No archives found to remove at /opt/local/var/macports/incoming
--->  Removing work directory for xvega-bindings
DEBUG: No work directory found to remove at /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_xvega-bindings/xvega-bindings
DEBUG: No log directory found to remove at /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_xvega-bindings
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/multimedia/XviD
DEBUG: OS darwin/20.3.0 (macOS 11.2.3) arch i386
DEBUG: Sourcing PortGroup muniversal 1.0 from /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/muniversal-1.0.tcl
DEBUG: can't read "my_targets(arm64)": no such element in array
    while executing
"set merger_configure_args(${arch}) --build=$my_targets(${arch})-apple-darwin${os.major}"
    ("foreach" body line 2)
    invoked from within
"foreach arch ${configure.universal_archs} {
            set merger_configure_args(${arch}) --build=$my_targets(${arch})-apple-darwin${os.major}
      ..."
    ("uplevel" body line 6)
    invoked from within
"uplevel 1 $code"
    (procedure "platform" line 34)
    invoked from within
"platform darwin {
    if {![info exists universal_possible]} {
        set universal_possible [expr {${os.universal_supported} && [llength ${configure..."
    (file "Portfile" line 49)
    invoked from within
"source Portfile"
    invoked from within
"$workername eval {source Portfile}"
DEBUG: can't read "my_targets(arm64)": no such element in array
    while executing
"error $result"
    (procedure "mportopen" line 53)
    invoked from within
"mportopen $porturl [array get options] [array get requested_variations]"
Error: Unable to open port: can't read "my_targets(arm64)": no such element in array

Which appears to fail on port XviD

The bug here is that port doesn't include the failing port name in the normal output

comment:5 Changed 13 months ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 7a93047fb58a63d35e1c434b92ed5350ea9cade8/macports-base (master):

action_target: show port name when an error is caught

Closes: #63078

comment:6 Changed 13 months ago by jmroot (Joshua Root)

Keywords: clean removed
Milestone: MacPorts Future

comment:7 Changed 12 months ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.9.0
Note: See TracTickets for help on using tickets.