Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#56326 closed defect (fixed)

rev-upgrade considers gcc as broken due to libstdc++

Reported by: raimue (Rainer Müller) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.5.0
Component: base Version: 2.4.99
Keywords: Cc: jmroot (Joshua Root), iEFdev
Port:

Description

...
--->  Found 1 broken file, matching files to ports
gcc7 is using libstdc++ (this installation is configured to use libc++)
gcc6 is using libstdc++ (this installation is configured to use libc++)
--->  Found 3 broken ports, determining rebuild order
DEBUG: Broken: pgAdmin3
DEBUG: Broken: gcc7
DEBUG: Broken: gcc6
DEBUG: Processing port pgAdmin3 @0:1.22.2_0 +postgresql95
DEBUG: Processing port gcc7 @2:7.3.0_0
DEBUG: Processing port gcc6 @2:6.4.0_0
--->  Rebuilding in order
     pgAdmin3 @1.22.2 +postgresql95
     gcc7 @7.3.0
     gcc6 @6.4.0
...

I was unable to find out why it thinks gcc6 and gcc7 are broken. I installed both gcc6 and gcc7 from the archives from packages.macports.org. Even stranger, if I deactive pgAdmin3, no broken files will be found and then, gcc6 and gcc7 are also no longer considered broken.

Is this a problem with the gcc ports or with rev-upgrade reporting a false-positive? Why does it only appear when rev-upgrade finds at least one other broken port?

pgAdmin3 apparently was not rev-bumped for the readline @7.0 update (looks like it copied the psql binary into the port), so this is a separate problem that needs to be dealt with. However, gcc6 and gcc7 should not be involved in this at all.

I am attaching the full debug output.

Attachments (1)

rev-upgrade-gcc.log (265.4 KB) - added by raimue (Rainer Müller) 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by raimue (Rainer Müller)

Attachment: rev-upgrade-gcc.log added

comment:1 Changed 6 years ago by neverpanic (Clemens Lang)

pgAdmin3 is considered broken because of

Could not open /opt/local/lib/libreadline.6.dylib: Error opening or reading file (referenced from /Applications/MacPorts/pgAdmin3.app/Contents/SharedSupport/psql)

It seems it should have been revbumped for the readline update.

gcc6 and gcc7 seem to be considered broken because the discovered value for the c++ stdlib used by the port does not match your global configuration (which defaults to libc++). Of course that's a false positive for these ports. There is an override to deal with this, but the override requires information from the Portfile to be set. This only works when installing the port freshly, but does not work when rev-upgrade initially determines the c++ stdlib usage of a port, which is why this code path assumes a false value for cxx_stdlib_overridden, which then causes this problem.

This should not occur when compiling GCC from source, and it should also not occur when installing from a prebuilt package, but only if the prebuilt package was compiled with a version of MacPorts that supports setting this flag (which of course our buildbots are currently not running yet).

This is not ideal. Maybe jmr has an idea how to solve this?

comment:2 Changed 6 years ago by jmroot (Joshua Root)

Hmm. I can't think of a better way to work around this than having a list of ports to ignore when rev-upgrade adds this information.

comment:3 Changed 6 years ago by raimue (Rainer Müller)

In 8525b9c18d67db7e100f3a71161a185510163b38/macports-base (master):

rev-upgrade: Always check for wrong cxx_stdlib

rev-upgrade would only check for cxx_stdlib when at least one broken
file was found. Do not return early, but always run the cxx_stdlib
check.

See: #56326

comment:4 Changed 6 years ago by raimue (Rainer Müller)

I am fine if this would be fixed once we release MacPorts 2.5.0. We just have to remember to rev-bump the gcc ports then.

To ease the transition, maybe we could have a port-upgrade script that sets cxx_stdlib and cxx_stdlib_overridden for well-known ports?

comment:5 Changed 6 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts 2.5.0

comment:6 Changed 6 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 328eb9567872bb7011eb015f601aa7b5c29ab245/macports-base (master):

Add script to set cxx_stdlib_overridden on upgrade

You can't tell whether configure.cxx_stdlib was overridden by a port if
it was not recorded at install time. This creates a problem for users
upgrading from versions of MacPorts that did not record it: rev-upgrade
will think that ports that do override it are broken, because they do
not follow the global cxx_stdlib setting.

Therefore, to ease the transition, keep a list of ports that are known
to override the setting, and when upgrading base, set the flag in the
registry for those ports if it is currently null.

Closes: #56326

comment:7 Changed 6 years ago by jmroot (Joshua Root)

If you have gcc or one of the other listed ports installed, please test that this works.

comment:8 Changed 6 years ago by raimue (Rainer Müller)

Thanks, that seems to work as intended. I reset cxx_stdlib = NULL for gcc6 and gcc7, then upgraded base to current master. Now sudo port rev-upgrade no longer considers the ports as broken.

comment:9 Changed 6 years ago by iEFdev

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