Debugging restore_ports.tcl

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Debugging restore_ports.tcl

MacPorts - Users mailing list
When restore_ports.tcl gets stuck building its list of ports to
restore, is there a way to get it to tell you which ports exactly it's
failing to process? i.e., which ports to remove from your myports.txt
to get it to continue? I tried adding some additional debugging
statements to the script, but they haven't helped very much:
https://github.com/macports/macports-contrib/pull/10
(let me know if attaching script output and/or my myports.txt in
question would be helpful; I'm migrating from Catalina to Big Sur
here)
Thanks,
Eric Gallager
Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

ryandesign2
Administrator


On Feb 7, 2021, at 20:59, Eric Gallager wrote:

> When restore_ports.tcl gets stuck building its list of ports to
> restore, is there a way to get it to tell you which ports exactly it's
> failing to process? i.e., which ports to remove from your myports.txt
> to get it to continue?

I don't know. In what way is it getting stuck?

> I tried adding some additional debugging
> statements to the script, but they haven't helped very much:
> https://github.com/macports/macports-contrib/pull/10
> (let me know if attaching script output and/or my myports.txt in
> question would be helpful; I'm migrating from Catalina to Big Sur
> here)


Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

MacPorts - Users mailing list
On Mon, Feb 8, 2021 at 1:03 PM Ryan Schmidt <[hidden email]> wrote:

>
>
>
> On Feb 7, 2021, at 20:59, Eric Gallager wrote:
>
> > When restore_ports.tcl gets stuck building its list of ports to
> > restore, is there a way to get it to tell you which ports exactly it's
> > failing to process? i.e., which ports to remove from your myports.txt
> > to get it to continue?
>
> I don't know. In what way is it getting stuck?

It's the part on the Troubleshooting section of the wiki page where it says:

If you see an "infinite loop" error message, such as this:

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)

it indicates that the script has a list of ports to install, and it
can't figure out which of the ports to install next.

https://trac.macports.org/wiki/Migration#Troubleshooting

The workaround it suggests to deal with this issue is "to reduce your
list of ports to install, until it no longer has a dependency cycle,"
but it doesn't say exactly HOW to go about choosing which ports to
remove from the list in order to reduce its length.
My myports.txt file has 6147 lines in it. I don't know where to begin with it.

>
> > I tried adding some additional debugging
> > statements to the script, but they haven't helped very much:
> > https://github.com/macports/macports-contrib/pull/10
> > (let me know if attaching script output and/or my myports.txt in
> > question would be helpful; I'm migrating from Catalina to Big Sur
> > here)
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

ryandesign2
Administrator


On Feb 8, 2021, at 18:57, Eric Gallager wrote:

> It's the part on the Troubleshooting section of the wiki page where it says:
>
> If you see an "infinite loop" error message, such as this:
>
> 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)
>
> it indicates that the script has a list of ports to install, and it
> can't figure out which of the ports to install next.
>
> https://trac.macports.org/wiki/Migration#Troubleshooting
>
> The workaround it suggests to deal with this issue is "to reduce your
> list of ports to install, until it no longer has a dependency cycle,"
> but it doesn't say exactly HOW to go about choosing which ports to
> remove from the list in order to reduce its length.
> My myports.txt file has 6147 lines in it. I don't know where to begin with it.

I see. Well, that's a lot of ports. Do you actually need all of them? It could be simpler to install just the ports you actually want. MacPorts will take care of any dependencies for you.


Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

Pieter van Oostrum
In reply to this post by MacPorts - Users mailing list
Eric Gallager via macports-users <[hidden email]> writes:

> On Mon, Feb 8, 2021 at 1:03 PM Ryan Schmidt <[hidden email]> wrote:
>>
>>
>>
>> On Feb 7, 2021, at 20:59, Eric Gallager wrote:
>>
>> > When restore_ports.tcl gets stuck building its list of ports to
>> > restore, is there a way to get it to tell you which ports exactly it's
>> > failing to process? i.e., which ports to remove from your myports.txt
>> > to get it to continue?
>>
>> I don't know. In what way is it getting stuck?
>
> It's the part on the Troubleshooting section of the wiki page where it says:
>
> If you see an "infinite loop" error message, such as this:
>
> 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)
>
> it indicates that the script has a list of ports to install, and it
> can't figure out which of the ports to install next.
>
> https://trac.macports.org/wiki/Migration#Troubleshooting
>
> The workaround it suggests to deal with this issue is "to reduce your
> list of ports to install, until it no longer has a dependency cycle,"
> but it doesn't say exactly HOW to go about choosing which ports to
> remove from the list in order to reduce its length.
> My myports.txt file has 6147 lines in it. I don't know where to begin with it.

The usual way of tackling these kinds of problems is "bisecting". Divide the list in two halves, and try each of these separately. If a half fails, then divide it in two halves again, etc.
--
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

Christopher Jones


On 9 Feb 2021, at 11:22 am, Pieter van Oostrum <[hidden email]> wrote:

Eric Gallager via macports-users <[hidden email]> writes:

On Mon, Feb 8, 2021 at 1:03 PM Ryan Schmidt <[hidden email]> wrote:



On Feb 7, 2021, at 20:59, Eric Gallager wrote:

When restore_ports.tcl gets stuck building its list of ports to
restore, is there a way to get it to tell you which ports exactly it's
failing to process? i.e., which ports to remove from your myports.txt
to get it to continue?

I don't know. In what way is it getting stuck?

It's the part on the Troubleshooting section of the wiki page where it says:

If you see an "infinite loop" error message, such as this:

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)

it indicates that the script has a list of ports to install, and it
can't figure out which of the ports to install next.

https://trac.macports.org/wiki/Migration#Troubleshooting

The workaround it suggests to deal with this issue is "to reduce your
list of ports to install, until it no longer has a dependency cycle,"
but it doesn't say exactly HOW to go about choosing which ports to
remove from the list in order to reduce its length.
My myports.txt file has 6147 lines in it. I don't know where to begin with it.

The usual way of tackling these kinds of problems is "bisecting". Divide the list in two halves, and try each of these separately. If a half fails, then divide it in two halves again, etc.

Personally, I would recommend not trying to restore *every* port, as this will include a bunch of dependencies that might not be needed on a new OS, or might even not work there. 

Look at the list of *requested* ports you installed. This will be a lot lot shorter, short enough to go through by hand and install one by one.

Chris


smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

MacPorts - Users mailing list
In reply to this post by Pieter van Oostrum
On Tue, Feb 9, 2021 at 6:23 AM Pieter van Oostrum
<[hidden email]> wrote:

>
> Eric Gallager via macports-users <[hidden email]> writes:
>
> > On Mon, Feb 8, 2021 at 1:03 PM Ryan Schmidt <[hidden email]> wrote:
> >>
> >>
> >>
> >> On Feb 7, 2021, at 20:59, Eric Gallager wrote:
> >>
> >> > When restore_ports.tcl gets stuck building its list of ports to
> >> > restore, is there a way to get it to tell you which ports exactly it's
> >> > failing to process? i.e., which ports to remove from your myports.txt
> >> > to get it to continue?
> >>
> >> I don't know. In what way is it getting stuck?
> >
> > It's the part on the Troubleshooting section of the wiki page where it says:
> >
> > If you see an "infinite loop" error message, such as this:
> >
> > 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)
> >
> > it indicates that the script has a list of ports to install, and it
> > can't figure out which of the ports to install next.
> >
> > https://trac.macports.org/wiki/Migration#Troubleshooting
> >
> > The workaround it suggests to deal with this issue is "to reduce your
> > list of ports to install, until it no longer has a dependency cycle,"
> > but it doesn't say exactly HOW to go about choosing which ports to
> > remove from the list in order to reduce its length.
> > My myports.txt file has 6147 lines in it. I don't know where to begin with it.
>
> The usual way of tackling these kinds of problems is "bisecting". Divide the list in two halves, and try each of these separately. If a half fails, then divide it in two halves again, etc.

With git at least, there's a built-in command (`git bisect`) to assist
with cases like this; would it be possible to add a similar feature to
the restore_ports.tcl script?

> --
> Pieter van Oostrum
> www: http://pieter.vanoostrum.org/
> PGP key: [8DAE142BE17999C4]
Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

ryandesign2
Administrator


On Feb 9, 2021, at 21:26, Eric Gallager wrote:

> With git at least, there's a built-in command (`git bisect`) to assist
> with cases like this; would it be possible to add a similar feature to
> the restore_ports.tcl script?

That seems out of scope for what the script is meant to do.

It might be more productive for us to change the instructions to recommend that users install only the ports they requested, rather than all previously installed ports.

raf
Reply | Threaded
Open this post in threaded view
|

Re: Debugging restore_ports.tcl

raf
On Wed, Feb 10, 2021 at 08:17:42PM -0600, Ryan Schmidt <[hidden email]> wrote:

> On Feb 9, 2021, at 21:26, Eric Gallager wrote:
>
> > With git at least, there's a built-in command (`git bisect`) to assist
> > with cases like this; would it be possible to add a similar feature to
> > the restore_ports.tcl script?
>
> That seems out of scope for what the script is meant to do.
>
> It might be more productive for us to change the instructions to
> recommend that users install only the ports they requested, rather
> than all previously installed ports.

That's what I ended up doing recently on 10.6 when
trying to update macports after a very long period with
no updates. I think that the existing instructions make
a lot of sense when moving from one version of macOS to
another (with macports up-to-date to start with),
because the versions of all the ports and their
dependencies wouldn't have changed, but if the versions
of installed ports no longer exist, or if the
dependencies have changed a lot since the last update,
then just installing the requested ports, and letting
the current dependencies sort themselves out, is a good
approach.

cheers,
raf