Opened 12 months ago

Last modified 12 months ago

#59289 new defect

base does not necessarily tell you when circular dependency occurs

Reported by: fvaccari Owned by:
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc: mojca (Mojca Miklavec), michaelld (Michael Dickens), kencu (Ken), cjones051073 (Chris Jones), JDLH (Jim DeLaHunt), cooljeanius (Eric Gallager)
Port:

Description (last modified by mojca (Mojca Miklavec))

When updating ports on 10.6 we seem to be lost in a cyclic dependency, but base doesn't seem too helpful communicating this information.

$ sudo port -v upgrade outdated
Warning: No port clang-9.0 found in the index.
Warning: No port legacy-support found in the index.
Warning: No port curl found in the index.
Warning: No port expat found in the index.
Warning: No port bzip2 found in the index.
Warning: No port libarchive found in the index.
Warning: No port libuv found in the index.
Warning: No port legacy-support found in the index.
--->  Computing dependencies for cmakeError: Problem while installing cmake
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
$ sudo port -d upgrade outdated
...
Error: Unable to exec port: too many nested evaluations (infinite loop?)
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

See the logs

Attachments (1)

cyclic-dependency-cmake-clang-9.0.txt (42.4 KB) - added by fvaccari 12 months ago.

Download all attachments as: .zip

Change History (15)

Changed 12 months ago by fvaccari

comment:1 Changed 12 months ago by mojca (Mojca Miklavec)

Cc: mojca michaelld kencu cjones051073 added

comment:2 Changed 12 months ago by kencu (Ken)

Well -- there doesn't seem to be any portindex of any use available...

sources.conf misconfigured?

totally messed repo?

comment:3 Changed 12 months ago by mojca (Mojca Miklavec)

It's not a messed-up repository, it's simply a circular dependency. Please let Franco submit a PR to fix that circular dependency as an exercise ... but the base should at least tell you there's a circular dependency without the need to enter the debug mode.

comment:4 Changed 12 months ago by fvaccari

In 9e7ab4d32e458323f54ec38ad736dc642013d128/macports-ports (master):

cmake: remove cyclic dependency on clang-9.0

See #59289
See #58821

comment:5 Changed 12 months ago by ryandesign (Ryan Schmidt)

Port: cmake removed

Indeed, ports shall not introduce circular dependencies; if they do, base behavior is not defined.

comment:6 Changed 12 months ago by cjones051073 (Chris Jones)

Although in this case it was not really the port itself causing the problem, but base itself through the compiler selection it was making.

I am with Mojca, surely it shouldn’t be too hard for base to detect when this happens and give a reasonable error. Base is really the only place this check could be done. Its difficult for individual ports to know when this is happening.

Last edited 12 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:7 Changed 12 months ago by kencu (Ken)

I would have thought a circular dependency would look more like this one, for a similar issue, earlier today 59279.

How is it that this one shows "no port in the index", and the other was so much more clear?

comment:8 in reply to:  6 ; Changed 12 months ago by jmroot (Joshua Root)

Replying to cjones051073:

Although in this case it was not really the port itself causing the problem, but base itself through the compiler selection it was making.

Technically that choice comes from the ports tree, not base.

comment:9 in reply to:  8 Changed 12 months ago by cjones051073 (Chris Jones)

Replying to jmroot:

Replying to cjones051073:

Although in this case it was not really the port itself causing the problem, but base itself through the compiler selection it was making.

Technically that choice comes from the ports tree, not base.

In this case the cmake port did not have a problem until an unrelated change elsewhere was made, adding a new compiler option. I find it hard to blame the port in this case.

In any case it really does not matter, assigning ‘blame’ is useless. The bottom line there is one place that could ever detect these circular dependencies, and that is in base, so that is the place that needs the protection or error reporting.

comment:10 Changed 12 months ago by mojca (Mojca Miklavec)

My only concern is: debug mode did tell us it was a circular dependency, but the error did not even proliferate to verbose output.

All I'm asking for is for the error to show up to make it obvious what happened.

comment:11 Changed 12 months ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:12 Changed 12 months ago by JDLH (Jim DeLaHunt)

I agree that base should surface the error information that there is a dependency cycle among ports. #59445 is another bug which appears to be caused by a dependency cycle. It manifested as an infinite loop in ./restore_ports.tcl during a Migration. Diagnosing the problem was harder because the base didn't highlight that there was a dependency cycle.

comment:13 Changed 12 months ago by JDLH (Jim DeLaHunt)

Cc: JDLH added

comment:14 Changed 12 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.