[MacPorts] #59445: restore_ports.tcl script fails with the error "infinite loop" (deps bug)

MacPorts noreply at macports.org
Tue Oct 22 22:16:58 UTC 2019


#59445: restore_ports.tcl script fails with the error "infinite loop" (deps bug)
--------------------+--------------------
 Reporter:  JDLH    |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  base    |    Version:
 Keywords:          |       Port:
--------------------+--------------------
 I recently updated my macOS version from 10.11 El Capitan to macOS High
 Sierra 10.13.6. I am following the
 [https://trac.macports.org/wiki/Migration 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

-- 
Ticket URL: <https://trac.macports.org/ticket/59445>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list