Opened 17 months ago

Last modified 5 months ago

#71729 new defect

port deps misdetects dependencies on Rosetta

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: base Version: 2.10.5
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), jmroot (Joshua Root)
Port:

Description

This on 10.6.8 on x86 (not on powerpc):

macmini:~ svacchanda$ port deps LimeChat
Full Name: LimeChat @2.26_1
Build Dependencies:   clang-11
Library Dependencies: libcxx
macmini:~ svacchanda$ port deps LimeChat build_arch="ppc"
Full Name: LimeChat @2.26_1
Build Dependencies:   clang-11
Library Dependencies: libcxx

However nothing in the port requires clang or x86, it builds fine even on 10.5 ppc (I fixed it, and nothing changed since then, it is pegged for < 10.7).

Notice, build works correctly, i.e. it does not try to fetch clang:

--->  Fetching distfiles for LimeChat
--->  limechat-2.26.tar.gz does not exist in /opt/local/var/macports/distfiles/LimeChat
--->  Attempting to fetch limechat-2.26.tar.gz from https://github.com/psychs/limechat/archive/2.26
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 3483k    0 3483k    0     0  1056k      0 --:--:--  0:00:03 --:--:-- 1745k
--->  Verifying checksums for LimeChat
--->  Checksumming limechat-2.26.tar.gz
--->  Extracting LimeChat

Change History (3)

comment:1 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)

Looking at the PortIndex files on the server, I see that the darwin 10 i386 index is the only one that mentions a clang-11 dependency for LimeChat. Later and earlier macOS versions do not mention any clang dependency. I can also see this locally on a macOS 12 machine:

% port deps LimeChat
LimeChat @2.47_1 has no dependencies.
% port deps LimeChat os.major=11
LimeChat @2.47_1 has no dependencies.
% port deps LimeChat os.major=10
Full Name: LimeChat @2.26_1
Build Dependencies:   clang-11
Library Dependencies: libcxx
% port deps LimeChat os.major=9 configure.cxx_stdlib=libstdc++
LimeChat @2.26_1 has no dependencies.

The reason seems to be that MacPorts uses libc++ on 10.6 and later, and it knows that no compiler available via Xcode on 10.6 can use libc++, so it does not attempt to use any Xcode compiler and falls back to a MacPorts clang compiler:

https://github.com/macports/macports-base/blob/b2dcbb94d1a02cc37cb7041c6df48a5d1e4b3d4b/src/port1.0/portconfigure.tcl#L936-L939

On 10.5 and earlier, libstdc++ is used, so the Xcode compilers would be acceptable.

So, as far as I can tell, this is all working as designed.

comment:2 in reply to:  1 Changed 17 months ago by barracuda156

Replying to ryandesign:

On 10.5 and earlier, libstdc++ is used, so the Xcode compilers would be acceptable.

So, as far as I can tell, this is all working as designed.

Well, if it is working as designed, I argue that the design should be fixed :)

  1. There is no libc++ on powerpc, whether natively or for Rosetta, so declaring a dependency on it should not happen. If the build arch is ppc/ppc64, stdlib must be libstdc++, regardless of the host OS and arch.
  1. If C++ runtime is explicitly specified in macports.conf, I would expect MacPorts to recognize that coherently and not just for some cases.
  1. Obviously, behavior of port deps should match port build, and it does not.

comment:3 Changed 5 months ago by jmroot (Joshua Root)

Can't reproduce.

% port deps LimeChat
Full Name: LimeChat @2.26_1
Build Dependencies:   clang-11
Library Dependencies: libcxx
% port deps LimeChat build_arch=ppc
Warning: All compilers are either blacklisted or unavailable; defaulting to first fallback option
LimeChat @2.26_1 has no dependencies.
Note: See TracTickets for help on using tickets.