Opened 7 years ago

Closed 2 years ago

Last modified 2 years ago

#55445 closed defect (fixed)

install phase fails with "no destroot found"

Reported by: gaming-hacker (G Alexander) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.8.0
Component: base Version: 2.4.2
Keywords: Cc: tweakui
Port:

Description

All, I haven't checkecked this witih other ports but I don't want to install anything with perl5.24 as 5.26 is installed.

I am upgrading fftw-3 and this is the listing for dependencies

Installing Port
Full Name: fftw-3 @3.3.5+clang50+openmpi_devel
Build Dependencies:   clang-5.0
Library Dependencies: openmpi-devel-clang50
The following ports are dependencies of fftw-3 @3.3.5_1+clang50+openmpi_devel:
  clang-5.0
    xz
      libiconv
        gperf
      gettext
        expat
        ncurses
    cmake
      py27-sphinx
        py27-docutils
          python27
            pkgconfig
            bzip2
            db48
            libedit
            libffi
            openssl
              zlib
            sqlite3
            python_select
            python2_select
          py27-roman
            unzip
            py27-setuptools
        py27-alabaster
        py27-babel
          py27-tz
        py27-imagesize
        py27-jinja2
          py27-markupsafe
        py27-pygments
        py27-requests
          py27-chardet
          py27-idna
          py27-urllib3
          py27-certifi
        py27-six
        py27-snowballstemmer
        py27-sphinxcontrib-websupport
        sphinx_select
        py27-typing
      curl
        libidn2
          autoconf
          automake
          libtool
            xattr
          libunistring
            perl5.26
              gdbm
                readline
            texinfo
              help2man
                p5.26-locale-gettext
        curl-ca-bundle
      libarchive
        libxml2
        lzo2
        lz4
      libuv
    libomp-devel
    llvm-5.0
      xar
      libcxx
      llvm_select
    clang_select
    ld64
      ld64-latest
        libmacho-headers
  openmpi-devel-clang50
    hwloc
    mpi_select
    mpi-doc

It shows no rdeps on perl5.24 but 5.26, yet when upgrading fftw-3, the following occurs

UPgrading Port
--->  Computing dependencies for perl5.24
--->  Installing perl5.24 @5.24.3_0
Error: Failed to install perl5.24: no destroot found at: /opt/local/var/macports/build/_Users_glen_local_macports-ports_lang_perl5/perl5.24/work/destroot
Error: See /opt/local/var/macports/logs/_Users_glen_local_macports-ports_lang_perl5/perl5.24/main.log for details.
Error: Problem while installing perl5.24
Error: Follow https://guide.macports.org/#project.tickets to report a bug

Change History (17)

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Difficult to say why perl5.24 was used. Could you attach the main.log?

Easy to say why installing it failed; see wiki:ProblemHotlist#nodestrootfound.

comment:2 Changed 7 years ago by mf2k (Frank Schima)

Keywords: rdeps removed
Owner: set to seanfarley
Status: newassigned

Nevermind. Base issue.

Last edited 7 years ago by mf2k (Frank Schima) (previous) (diff)

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

Owner: seanfarley deleted
Port: fftw-3 removed

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

Summary: rdeps doesn't report perl5.24 for fftw-3install phase fails with "no destroot found"

Presumably you have something installed with variants that are not (or are no longer) default, leading to the different dependencies. That part isn't really a bug.

The install failure does seem to be a bug. There have been other reports and we never worked out why it happened. It always seems to work fine after cleaning the affected port. If you had deleted /opt/local/var/macports/build/_Users_glen_local_macports-ports_lang_perl5/perl5.24/work/destroot without cleaning the port completely (i.e. the statefile still existed saying that the destroot phase was complete), that would explain it, but I guess you probably didn't.

comment:5 Changed 6 years ago by jmroot (Joshua Root)

Possibly something to do with the install failing due to conflicting files.

comment:6 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

I don't believe that all of the users who have reported this problem over the years are manually deleting their destroots. There must be a bug in base that causes it to do so, or more likely causes it to not create the destroot (maybe not even run the destroot phase) in the first place.

In src/package1.0/portarchivefetch.tcl in proc portarchivefetch::fetchfiles we have this code:

    if {[info exists archive_exists]} {
        # modify state file to skip remaining phases up to destroot
        global target_state_fd
        foreach target {fetch checksum extract patch configure build destroot} {
            write_statefile target "org.macports.${target}" $target_state_fd
        }
        return 0
    }

I wonder if [info exists archive_exists] might be unexpectedly true in some situation, whereupon we would mark all the phases up to destroot complete, even though we should not have.

comment:7 Changed 5 years ago by mf2k (Frank Schima)

Cc: tweakui added

Has duplicate #58725.

comment:8 Changed 5 years ago by jmroot (Joshua Root)

The recipe to trigger the bug seems to be:

  1. Try to install a port when there is a conflicting file present (the port will be installed but fail to activate)
  2. Uninstall the port
  3. Try to install the port again without cleaning

If you just remove the conflicting file and try again without uninstalling, it's fine. If you clean before the new install attempt, it's of course also fine.

comment:9 Changed 5 years ago by thomasrussellmurphy (Thomas Russell Murphy)

Had this issue today in the midst of swapping out a bunch of port. I found just re-uninstalling didn't immediately help, but subsequent cleaning did work. Probably best to both uninstall and clean. Unfortunately can't really provide a reproduction because this is a 100s of ports reinstall to get something working.

comment:10 Changed 5 years ago by jmroot (Joshua Root)

There's really no need to uninstall anything. After resolving whatever caused the activation to fail, just cleaning will fix the issue, because it is caused by autoclean not being triggered in the first place. (Autoclean only happens after a successful install.)

comment:11 Changed 4 years ago by oseiberts11 (O Seibert Syseleven)

I seem to be in this situation, but no cleaning or uninstalling helps. I get into this cycle:

$ sudo port upgrade outdated jq
--->  Computing dependencies for py36-attrs
--->  Installing py36-attrs @19.3.0_0
Error: Failed to install py36-attrs: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/work/destroot
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/main.log for details.
Error: Problem while installing py36-attrs
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
oseibert:~/tmp$ sudo port clean py36-attrs
--->  Cleaning py36-attrs
oseibert:~/tmp$ sudo port upgrade outdated
--->  Computing dependencies for py36-attrs
--->  Fetching archive for py36-attrs
--->  Attempting to fetch py36-attrs-19.3.0_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/py36-attrs
--->  Attempting to fetch py36-attrs-19.3.0_0.darwin_18.x86_64.tbz2.rmd160 from https://packages.macports.org/py36-attrs
--->  Installing py36-attrs @19.3.0_0
--->  Activating py36-attrs @19.3.0_0
Error: Failed to activate py36-attrs: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/attr/__init__.py already exists and does not belong to a registered port.  Unable to activate port py36-attrs. Use 'port -f activate py36-attrs' to force the activation.
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/main.log for details.
Error: Problem while installing py36-attrs
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
oseibert:~/tmp$ sudo port uninstall py36-attrs
--->  Uninstalling py36-attrs @19.3.0_0
--->  Cleaning py36-attrs
oseibert:~/tmp$ sudo port upgrade outdated
--->  Computing dependencies for py36-attrs
--->  Installing py36-attrs @19.3.0_0
Error: Failed to install py36-attrs: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/work/destroot
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/main.log for details.
Error: Problem while installing py36-attrs
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
oseibert:~/tmp$ sudo port clean py36-attrs
--->  Cleaning py36-attrs
oseibert:~/tmp$ sudo port upgrade py36-attrs
Error: py36-attrs is not installed
oseibert:~/tmp$ sudo port install py36-attrs
--->  Computing dependencies for py36-attrs
--->  Fetching archive for py36-attrs
--->  Attempting to fetch py36-attrs-19.3.0_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/py36-attrs
--->  Attempting to fetch py36-attrs-19.3.0_0.darwin_18.x86_64.tbz2.rmd160 from https://packages.macports.org/py36-attrs
--->  Installing py36-attrs @19.3.0_0
--->  Activating py36-attrs @19.3.0_0
Error: Failed to activate py36-attrs: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/attr/__init__.py already exists and does not belong to a registered port.  Unable to activate port py36-attrs. Use 'port -f activate py36-attrs' to force the activation.
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port py36-attrs failed
oseibert:~/tmp$ sudo port uninstall py36-attrs
--->  Uninstalling py36-attrs @19.3.0_0
--->  Cleaning py36-attrs
oseibert:~/tmp$ sudo port clean py36-attrs
--->  Cleaning py36-attrs
oseibert:~/tmp$ sudo port install py36-attrs
--->  Computing dependencies for py36-attrs
--->  Fetching archive for py36-attrs
--->  Attempting to fetch py36-attrs-19.3.0_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/py36-attrs
--->  Attempting to fetch py36-attrs-19.3.0_0.darwin_18.x86_64.tbz2.rmd160 from https://packages.macports.org/py36-attrs
--->  Installing py36-attrs @19.3.0_0
--->  Activating py36-attrs @19.3.0_0
Error: Failed to activate py36-attrs: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/attr/__init__.py already exists and does not belong to a registered port.  Unable to activate port py36-attrs. Use 'port -f activate py36-attrs' to force the activation.
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-attrs/py36-attrs/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port py36-attrs failed

It seems that the problem is that the same package was installed with pip....

Really, tool or language specific package managers do NOT go together with system-level package managers... sigh.

Afer using pip to remove the package (having to guess what pip's name for it is of course), and port uninstall + port clean for it, I could continue successfully.

I had to follow the same procedure with a handful of other python packages too.

Last edited 4 years ago by oseiberts11 (O Seibert Syseleven) (previous) (diff)

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

I can reliably reproduce this by hitting control-C during the activate phase.

$ sudo port install gcc11
--->  Computing dependencies for gcc11
--->  Fetching archive for gcc11
--->  Attempting to fetch gcc11-11.1.0_2.darwin_20.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/gcc11
--->  Attempting to fetch gcc11-11.1.0_2.darwin_20.x86_64.tbz2.rmd160 from https://ywg.ca.packages.macports.org/mirror/macports/packages/gcc11
--->  Installing gcc11 @11.1.0_2
--->  Activating gcc11 @11.1.0_2
^CError: Aborted: SIGINT received.
$ sudo port uninstall gcc11
--->  Uninstalling gcc11 @11.1.0_2
--->  Cleaning gcc11
$ sudo port install gcc11
--->  Computing dependencies for gcc11
--->  Installing gcc11 @11.1.0_2
Error: Failed to install gcc11: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc11/gcc11/work/destroot
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc11/gcc11/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port gcc11 failed

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

Yes, this will happen anytime a port is installed but doesn't finish activating for whatever reason (thus preventing the final automatic clean from running), and is then uninstalled.

comment:14 Changed 3 years ago by gaming-hacker (G Alexander)

I fixed it by adding my own local repo of macports and I run a set of bash/sed scripts that cleans out all of the old versions of perl 5.34, php 8.0 and python 3.9 from all portfiles and configurations. Some old broken portfiles that rely on python 2.7 only will break but since python2.7 is EOL, I find other solutions.

Version 0, edited 3 years ago by gaming-hacker (G Alexander) (next)

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

Owner: set to jmroot
Resolution: fixed
Status: assignedclosed

In bdd0a139182e7c87efb2b27276d4d7a1b4238a16/macports-base (master):

Clean statefile after installing from an archive

Fixes: #55445

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

Milestone: MacPorts Future

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

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