Opened 10 months ago

Closed 10 months ago

Last modified 4 months ago

#67922 closed defect (fixed)

macports-libcxx does not support +universal on Intel?

Reported by: barracuda156 Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: catap (Kirill A. Korinsky), mascguy (Christopher Nielsen)
Port: macports-libcxx

Description

Trying to install tiledb on 10.8 got me this:

10:~ svacchanda$ sudo port -v install tiledb
Error: Cannot install tiledb for the archs 'i386 x86_64' because
Error: its dependency macports-libcxx is only installed for the arch 'x86_64'
Error: and does not have a universal variant.
Error: Unable to execute port: architecture mismatch

Change History (19)

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

The macports-libcxx port is weird. It doesn't build anything; it just copies and installs files that were installed by the clang-11 port. So macports-libcxx's architectures and universality depend on the archs and universality for which the clang-11 port was installed. This does not seem great.

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

It was expedient to just copy the already-built lib++ out of clang-11 rather than rebuild it, but as the Portfile says

“ # for now, we will leverage the already-built libc++ in the appropriate clang port # later, we can build this independently if we choose to do so, much like libtapi “

It’s easy enough to rebuilt all of the desired clang and then copy the libc++ out of it.

Slightly more complicated would be to set up a new build that only installs libc++… for the universal build of that, Apple uses a shell script. One of the Apple engineers showed me where it was one time… let me see if I can find it for you…

Last edited 10 months ago by kencu (Ken) (previous) (diff)

comment:4 in reply to:  3 ; Changed 10 months ago by barracuda156

Replying to kencu:

here it is:

https://github.com/llvm/llvm-project/blob/main/libcxx/utils/ci/apple-install-libcxx.sh

And here’s the thread I started about it a few years ago:> https://lists.llvm.org/pipermail/libcxx-dev/2021-April/001116.html

Thank you!

Maybe Kirill @catap will be interested in the topic too, could we tag him?

comment:5 Changed 10 months ago by kencu (Ken)

now, about there being no universal macports-libcxx… it may have just never come up before….

as clang-11 seems to exist universal on all the needed systems, it might be as simple as adding a blank universal variant to macports-libcxx!

why don’t you give that a try?

variant universal {}
Last edited 10 months ago by kencu (Ken) (previous) (diff)

comment:6 in reply to:  1 ; Changed 10 months ago by barracuda156

Replying to ryandesign:

The macports-libcxx port is weird. It doesn't build anything; it just copies and installs files that were installed by the clang-11 port. So macports-libcxx's architectures and universality depend on the archs and universality for which the clang-11 port was installed. This does not seem great.

I actually have clang-11 as universal though. (Besides, wouldn't it be better to use clang-11-bootstrap?)

comment:7 in reply to:  4 Changed 10 months ago by kencu (Ken)

Replying to barracuda156:

Maybe Kirill @catap will be interested in the topic too, could we tag him?

Sure! Go ahead!

comment:8 in reply to:  6 Changed 10 months ago by kencu (Ken)

Replying to barracuda156:

(Besides, wouldn't it be better to use clang-11-bootstrap?)

Right up until someone wants macports-libcxx to be based on a newer clang, like, clang-15…

then, you’re DOA :)

comment:9 in reply to:  6 Changed 10 months ago by catap (Kirill A. Korinsky)

Replying to barracuda156:

I actually have clang-11 as universal though. (Besides, wouldn't it be better to use clang-11-bootstrap?)

It builds only clang and compiler-rt :)

Thus, it might be linked with gcc10-bootstrap libgcc_s ;)

Last edited 10 months ago by catap (Kirill A. Korinsky) (previous) (diff)

comment:10 Changed 10 months ago by catap (Kirill A. Korinsky)

to be honest all llvm ports can be done as universal but it will lead to 2x building time and need to revdump all of them. Seems like a week of overload build bots.

comment:11 Changed 10 months ago by catap (Kirill A. Korinsky)

Cc: catap added

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

Resolution: fixed
Status: assignedclosed

In 759116ba564f7b9d6673c35933d653d8de89d2f9/macports-ports (master):

macports-libcxx: add a default universal variant

closes: #67922

comment:13 Changed 10 months ago by kencu (Ken)

$ port contents | grep dylib | xargs file
/opt/local/lib/libcxx/libc++.1.0.dylib:    Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libcxx/libc++.1.0.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libcxx/libc++.1.0.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/opt/local/lib/libcxx/libc++.1.dylib:      Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libcxx/libc++.1.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libcxx/libc++.1.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/opt/local/lib/libcxx/libc++.dylib:        Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libcxx/libc++.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libcxx/libc++.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/opt/local/lib/libcxx/libc++abi.1.0.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libcxx/libc++abi.1.0.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libcxx/libc++abi.1.0.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/opt/local/lib/libcxx/libc++abi.1.dylib:   Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libcxx/libc++abi.1.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libcxx/libc++abi.1.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/opt/local/lib/libcxx/libc++abi.dylib:     Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libcxx/libc++abi.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libcxx/libc++abi.dylib (for architecture i386):	Mach-O dynamically linked shared library i386

comment:14 in reply to:  12 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)

Seems like you would at least want to enforce that if the universal variant of macports-libcxx is selected, then the universal variant of clang-11 must be selected (via the active_variants 1.1 portgroup), and similarly when the variant is not selected.

comment:15 Changed 10 months ago by kencu (Ken)

it’s automatically done already at build time, so no need to complicate things up further

to elaborate… the files are copied out when macports-libcxx is built, so after that, whatever clang-11 is is no longer relevant

Last edited 10 months ago by kencu (Ken) (previous) (diff)

comment:16 Changed 10 months ago by kencu (Ken)

unless you see some way this might fail with those sharp eyes of yours that I cannot see….

comment:17 Changed 10 months ago by kencu (Ken)

hmm….

what would happen if a user had clang-11 installed +universal

and then tried to install macports-libcxx without the universal variant, building it from source rather than downloading the prebuilt binary for some reason (eg alternate prefix)?

Would macports base accept the installed clang-11 +universal as filling the build dependency for clang-11 (probably would I guess) and then copy in the universal libc++ dylibs from that?

I could see that pathway perhaps giving you an installed actual universal macports-libcxx that is registered as not being universal by base, if that works like that…

comment:18 Changed 10 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:19 Changed 4 months ago by barracuda156

It is still broken #69189

Note: See TracTickets for help on using tickets.