Opened 5 years ago

Last modified 3 years ago

#59445 closed enhancement

restore_ports.tcl script fails with the error "infinite loop" (deps bug) — at Initial Version

Reported by: JDLH (Jim DeLaHunt) Owned by:
Priority: Normal Milestone:
Component: contrib Version: 2.6.2
Keywords: Cc:
Port:

Description

I recently updated my macOS version from 10.11 El Capitan to macOS High Sierra 10.13.6. I am following the Migration instructions.

When I ran the restore_ports.tcl script, it failed with the error message:

Error: we appear to be stuck, exiting...
infinite loop
    while executing
"sort_ports $portList"
    invoked from within
"set operationList [sort_ports $portList]"
    (file "./restore_ports.tcl" line 285)

I did some investigation, adding diagnostic statements to restore_ports.tcl . My conclusion is that the underlying cause of the problem is an error in the script's gathering of dependencies for one port it was trying to restore, which so happened to cause a dependency cycle with another port it was also trying to restore. The cycle meant that it could not come up with an installation order for these two ports, and issued the "infinite loop" error message. Details below.

My workaround was to edit my list of ports to restore. I looked at the ports involved in the cycle. One was clearly little used, I didn't even recognise it. I removed that from my list of ports. I also had hundreds of entries for old versions of ports which were no longer active; I removed all of them also. With this change, restore_ports.tcl was able to avoid the dependency cycle, and the restore is underway.

This problem is similar to https://trac.macports.org/ticket/49210 'restore_ports.tcl script on fails on El Capitan with the error "infinite loop"'. That ticket did not come up with a clear solution to their problem, and it is closed and four years old. I think it's better to open a new ticket than to add this commentary on to that ticket. Hopefully others with this problem will find the workaround helpful, even before the underlying bug gets fixed.

Versions:
macOS High Sierra 10.13.6
Xcode 10.1 [but I think not involved in this bug]
restore_ports.tcl: https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl (I believe commit 75135bd from Mar 24, 2015).
Port with incorrect dependency calculation: librsvg
Port incorrectly listed as dependency, causing cycle: adwaita-icon-theme

Change History (0)

Note: See TracTickets for help on using tickets.