Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#64933 closed defect (fixed)

tiff@4.3.0_0+universal: Failed to destroot tiff, "libtiff-4.pc differs"

Reported by: JDLH (Jim DeLaHunt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc:
Port: tiff

Description (last modified by JDLH (Jim DeLaHunt))

Attempting to install tiff@4.3.0_0+universal on an arm64 machine running macOS 12.3 Monterey fails during destroot because "libtiff-4.pc differs".

% sudo port install tiff +universal
--->  Computing dependencies for tiff
--->  Fetching archive for tiff
--->  Attempting to fetch tiff-4.3.0_0+universal.darwin_21.arm64-x86_64.tbz2 from https://packages.macports.org/tiff
--->  Attempting to fetch tiff-4.3.0_0+universal.darwin_21.arm64-x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/tiff
--->  Attempting to fetch tiff-4.3.0_0+universal.darwin_21.arm64-x86_64.tbz2 from https://kmq.jp.packages.macports.org/tiff
--->  Fetching distfiles for tiff
--->  Verifying checksums for tiff
--->  Extracting tiff
--->  Applying patches to tiff
--->  Configuring tiff
--->  Building tiff                                      
--->  Staging tiff into destroot                         
Error: Failed to destroot tiff: libtiff-4.pc differs in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_tiff/tiff/work/destroot-arm64//opt/local/lib/pkgconfig and /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_tiff/tiff/work/destroot-ppc-intel//opt/local/lib/pkgconfig and cannot be merged
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_tiff/tiff/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port tiff failed

port uninstall tiff followed by port install tiff +universal is not effective.

In the same environment, installing tiff@4.3.0_0 without +universal succeeds.

I have attached the main.log file. The interesting part appears to be:

:info:destroot --->  Patching 1-libtiff-4.pc: s:-arch +[0-9a-zA-Z_]+::g
:debug:destroot Executing reinplace: /usr/bin/sed -E {s:-arch +[0-9a-zA-Z_]+::g} </tmp/muniversal.BBPYjHAk/1-libtiff-4.pc >@file14
:info:destroot --->  Patching 2-libtiff-4.pc: s:-arch +[0-9a-zA-Z_]+::g
:debug:destroot Executing reinplace: /usr/bin/sed -E {s:-arch +[0-9a-zA-Z_]+::g} </tmp/muniversal.BBPYjHAk/2-libtiff-4.pc >@file14
:info:destroot --->  Patching 1-libtiff-4.pc: s:-m32::g
:debug:destroot Executing reinplace: /usr/bin/sed s:-m32::g </tmp/muniversal.BBPYjHAk/1-libtiff-4.pc >@file14
:info:destroot --->  Patching 2-libtiff-4.pc: s:-m32::g
:debug:destroot Executing reinplace: /usr/bin/sed s:-m32::g </tmp/muniversal.BBPYjHAk/2-libtiff-4.pc >@file14
:info:destroot --->  Patching 1-libtiff-4.pc: s:-m64::g
:debug:destroot Executing reinplace: /usr/bin/sed s:-m64::g </tmp/muniversal.BBPYjHAk/1-libtiff-4.pc >@file14
:info:destroot --->  Patching 2-libtiff-4.pc: s:-m64::g
:debug:destroot Executing reinplace: /usr/bin/sed s:-m64::g </tmp/muniversal.BBPYjHAk/2-libtiff-4.pc >@file14
:debug:destroot system: /usr/bin/cmp -s "/tmp/muniversal.BBPYjHAk/1-libtiff-4.pc" "/tmp/muniversal.BBPYjHAk/2-libtiff-4.pc"
:info:destroot Command failed: /usr/bin/cmp -s "/tmp/muniversal.BBPYjHAk/1-libtiff-4.pc" "/tmp/muniversal.BBPYjHAk/2-libtiff-4.pc"
:info:destroot Exit code: 1
:error:destroot Failed to destroot tiff: libtiff-4.pc differs in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_tiff/tiff/work/destroot-arm64//opt/local/lib/pkgconfig and /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_tiff/tiff/work/destroot-ppc-intel//opt/local/lib/pkgconfig and cannot be merged

Why am I installing tiff +universal? I'm not sure. I am migrating from an older machine, which runs MacPorts on macOS 10.14.6 Mojave on x86_64. I think multiple other ports are +universal for some reason, and they depend on tiff, so MacPorts tries to install tiff +universal.

Additionally, attempting to install tiff+universal as second time, after a previous failure, fails during destroot with a different message, "file already exists". But doing port clean restores us to the first error. I think the second error is less important, and so out of scope for this ticket.

Attachments (3)

main_tiff+universal_2022-04-03T1508.log (490.5 KB) - added by JDLH (Jim DeLaHunt) 3 years ago.
main.log from failed install of tiff+universal on arm64
libtiff-4_destroot-arm64_2022-04-11T1915.pc (273 bytes) - added by JDLH (Jim DeLaHunt) 3 years ago.
libtiff-4.pc from .../work/destroot-arm64opt/local/lib/pkgconfig/
libtiff-4_destroot-ppc-intel_2022-04-11T1915.pc (266 bytes) - added by JDLH (Jim DeLaHunt) 3 years ago.
libtiff-4.pc from .../work/destroot--ppc-intelopt/local/lib/pkgconfig/

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by JDLH (Jim DeLaHunt)

main.log from failed install of tiff+universal on arm64

comment:1 Changed 3 years ago by JDLH (Jim DeLaHunt)

Description: modified (diff)

(Corrected formatting of preformatted text, and of paragraph breaks. Sorry.)

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Please attach the two libtiff-4.pc files so that we can see how they differ.

If you were migrating from Mojave, it should not have been possible to install most ports universal unless you had taken special steps to modify MacPorts base. If you don't know why your ports are installed with the universal variant, try installing them without the universal variant. Assuming you don't need universal, you'll likely encounter fewer problems and will be able to receive binaries from our server instead of having to compile things yourself.

Changed 3 years ago by JDLH (Jim DeLaHunt)

libtiff-4.pc from .../work/destroot-arm64opt/local/lib/pkgconfig/

Changed 3 years ago by JDLH (Jim DeLaHunt)

libtiff-4.pc from .../work/destroot--ppc-intelopt/local/lib/pkgconfig/

comment:3 in reply to:  2 Changed 3 years ago by JDLH (Jim DeLaHunt)

Replying to ryandesign:

Please attach the two libtiff-4.pc files so that we can see how they differ.

Attached. File libtiff-4_destroot-arm64_2022-04-11T1915.pc is from subdirectory .../destroot-arm64/opt/local/lib/pkgconfig/ within the work subdirectory. It contains this:

prefix=/opt/local
exec_prefix=${prefix

libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libtiff
Description:  Tag Image File Format (TIFF) library.
Version: 4.3.0
Libs: -L${libdir} -ltiff
Libs.private: -lzstd -llzma -lLerc -ljpeg -lz 
Cflags: -I${includedir}

File libtiff-4_destroot-ppc-intel_2022-04-11T1915.pc is from subdirectory .../destroot-ppc-intel/opt/local/lib/pkgconfig/. It has almost exactly the same contents, except that in the Libs.private line, delete an arg like so: s/-lLerc //.

If you were migrating from Mojave, it should not have been possible to install most ports universal unless you had taken special steps to modify MacPorts base. If you don't know why your ports are installed with the universal variant, try installing them without the universal variant.

Good advice, except that I don't know why the restore_ports.tcl script is specifying the universal variant. My list of installed ports does not ask for universal variants of any port. I asked on Macports-users, in thread During Migration to Arm64 mac, should I null out archs='x86_64' from installed ports list? , whether I should uninstall and reinstall every port, but changing archs='x86_64' to archs='' everywhere in my list of installed ports.

I think I will try that experiment just to see what happens. The CPU is not doing anything else.

comment:4 Changed 3 years ago by JDLH (Jim DeLaHunt)

I did not do the experiment of changing archs='x86_64' to archs='' everywhere. I tried another experiment first, and anyway Ryan Schmidt's helpful reply on MacPorts-users says that it would not be necessary.

Instead I patched the restore_ports.tcl script to print out each port name as it starts to work on it. That made it clear that port qt4-mac is the port which was installing tiff +universal in place of tiff. The qt4-mac Portfiles says, "# no support for ARM64 yet", "supported_archs ppc ppc64 i386 x86_64". More info about this choice at #61789.

My workaround is to eliminate qt4-mac from my port migration list. Part of the qt4-mac ticket discussion is that its code is old. MacPorts presently has many Qt5-related ports, and a few Qt6-related port.

comment:5 Changed 3 years ago by kencu (Ken)

so the issue is lerc. One arch is using it, the other not.

Needs to be a tiff dep, or disabled.

Do you have lerc installed universal now? If not, install it universal and try tiff universal again.

comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

comment:7 in reply to:  5 Changed 3 years ago by JDLH (Jim DeLaHunt)

Replying to kencu:

Do you have lerc installed universal now? If not, install it universal and try tiff universal again.

The arm64 machine had tiff-universal installed. (By "tiff-universal" I mean "tiff" without "+universal".) The sequence of events from the restore_ports.tcl script seemed to be: 1. install lerc-universal, 2. install tiff-universal, 3. install tiff+universal (but without first installing lerc+universal). I can imagine how that might lead to the symptoms seen.

I will wait for the new tiff Portfile to propogate to the arm64 machine and try to port install tiff +universal.

Thank you, Ken and Ryan!

Note: See TracTickets for help on using tickets.