Fixing borked macports

5

3

I tried to install some packages and got following errors:

$ sudo port install pkgconfig
--->  Computing dependencies for pkgconfig
--->  Dependencies to be installed: libiconv
--->  Installing libiconv @1.14_0
Error: org.macports.install for port libiconv returned: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_libiconv/libiconv/work/destroot
Error: Failed to install libiconv
Please see the log file for port libiconv for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_libiconv/libiconv/main.log
Error: The following dependencies were not installed: libiconv
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port pkgconfig failed

This seemed like a macports issue. So I tried to update the ports. It threw the same error (no destroot found):

$ sudo port upgrade outdated
--->  Installing expat @2.1.0_0
Error: org.macports.install for port expat returned: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work/destroot
Please see the log file for port expat for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
Error: Problem while installing expat
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

I've tried sudo port selfupdate, which didn't work. However sudo port -v selfupdate worked. When I try to install expat via sudo port install -fp expat, for example, I get this:

no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work/destroot

The error suggested me to look at the log it created, which can be found here: http://pastebin.com/H39VTf7b. It goes on about something with user privileges, although I'm running the command with sudo.

After that, I tried manually creating the directory for expat. Then it brilliantly failed telling me that it had no destroot for ncurses. Created that as well (along with chown to macports). Now it fails for gawk (log file: http://pastebin.com/E5w66mqe). I can't be going through all the dependencies and creating directories for them. I also have no idea how to fix this. I tried changing owner of macports files to "macports" with no results..

EDIT: I've also reinstalled command line tools. Still nothing.

Lightheaded

Posted 2014-05-01T10:27:28.550

Reputation: 153

Answers

13

The "no destroot found at" error occurs when installation from a binary archive failed earlier (at least that's what I think, I haven't dug into it and fixed it because I couldn't reproduce so far).

Anyway, the solution for that isn't to do stuff manually, but to run sudo port clean $portname and try again. That's the first thing you should try whenever a build fails, and it fixes 100% of the "no destroot found" errors.

Btw, you shouldn't use the -p switch when installing or upgrading stuff. It's considered harmful in this case. It isn't being removed because it is useful with some operations that don't depend on each other, such as sudo port -p fetch outdated. MacPorts often forces rebuilds of ports without changes in order to pick up an updated version of a dependency. If you run sudo port -p upgrade outdated that can lead to a rebuild even though the the updated version of the dependency failed to build, defying the point of the upgrade.

Your installation of gawk failed because your /opt/local/bin/xz binary is broken and it failed to extract the source because of that:

:info:extract dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
:info:extract   Referenced from: /opt/local/lib/libintl.8.dylib
:info:extract   Reason: Incompatible library version: libintl.8.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0

Ironically, this exact situation can happen when you run upgrade with -p. To fix this specific error you need to rebuild the gettext port: sudo port -nf upgrade gettext. You should also run sudo port rev-upgrade to discover similar problems and fix them automatically (or at least attempt to).

neverpanic

Posted 2014-05-01T10:27:28.550

Reputation: 325

3

As a side note; if Python related packages shows destroot errors, check the double installation with pip. In my particular case, i had py27-funcsigs as a port package installed and funcsigs also installed with pip. I had to remove pip version first.

sudo -H pip uninstall funcsigs
sudo port clean py27-funcsigs
sudo port install py27-funcsigs

hope this helps.

Kunthar

Posted 2014-05-01T10:27:28.550

Reputation: 131