Opened 19 months ago

Closed 10 months ago

Last modified 7 months ago

#67359 closed defect (invalid)

transmission @4.0.3_1: error: redefinition of module 'libxml2'

Reported by: Gandoon (Erik Hedlund) Owned by: kurthindenburg (Kurt Hindenburg)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: catalina Cc:
Port: transmission

Description (last modified by Gandoon (Erik Hedlund))

A few days ago, the port of Transmission was refreshed to the 4.0.3 version. However it fails with what seems to be a problem with libxml2 but it could also potentially be a problem with QuickLook. I am using a legacy MacOS 10.15 system, but I did not have any trouble building Transmission version 4.n pulled from their github repository. I started using that as MacPorts was still only offering version 3.00.

I did not see the root cause immediately, so I here enclose the log file and hope someone might help figuring out why it does not want to build.

Attachments (1)

Transmission-main.log (1.0 MB) - added by Gandoon (Erik Hedlund) 19 months ago.
Transmission build fails

Download all attachments as: .zip

Change History (20)

Changed 19 months ago by Gandoon (Erik Hedlund)

Attachment: Transmission-main.log added

Transmission build fails

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

Keywords: catalina added
Owner: set to kurthindenburg
Status: newassigned
Summary: Updating to Transmission @4.0.3_1 fails on MacOS 10.15transmission @4.0.3_1: error: redefinition of module 'libxml2'

The log says the error is:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/libxml/module.modulemap:1:8: error: redefinition of module 'libxml2'
module libxml2 [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/module.modulemap:1:8: note: previously defined here
module libxml2 [system] [extern_c] {
       ^
1 error generated.

comment:2 Changed 19 months ago by Gandoon (Erik Hedlund)

Description: modified (diff)

comment:3 in reply to:  1 Changed 19 months ago by Gandoon (Erik Hedlund)

Replying to ryandesign:

The log says the error is:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/libxml/module.modulemap:1:8: error: redefinition of module 'libxml2'
module libxml2 [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/module.modulemap:1:8: note: previously defined here
module libxml2 [system] [extern_c] {
       ^
1 error generated.

You are right, I made a little mistake when I copied the text from where I wrote it into the field. I missed the key bit of libxml2, I apologise. But it also did seem to have some complaints about QuickLook.

comment:4 Changed 19 months ago by ryandesign (Ryan Carsten Schmidt)

I find it's often a good idea to deal with the first error first. The other errors could all be a result of the first error.

comment:5 Changed 18 months ago by kurthindenburg (Kurt Hindenburg)

I was considering having both version 3 and 4 available but the port got updated before I got around to it. I would go back to the previous version if you can.

wiki:howto/InstallingOlderPort

Last edited 17 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 in reply to:  5 Changed 18 months ago by Gandoon (Erik Hedlund)

Replying to kurthindenburg:

I was considering having both version 3 and 4 available but the port got updated before I got around to it. I would go back to the previous version if you can.

wiki:howto/InstallingOlderPort

I never uninstalled the old version, and that one still technically works for me. However, as I hinted at: I pulled the most recent version 4 from GitHub and built it separately and it works like a charm.

But that doesn't really scratch the itch that is that ever more ports are starting to fail to build, despite they really should be just fine even if I have a slightly older OS (10.15).

Last edited 17 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 17 months ago by Gandoon (Erik Hedlund)

Is there anyone who could shed some light on what the issue with libxml2 is here? I have tried this after deactivating the port libxml2 and the build still fails with the same error. Does anyone have any tips?

It is worth noting that as mentioned before, the code itself seems fine. A Github checkout does build with no issues. So, what are the main differences here between the port and the Github checkout? I haven't found them.

comment:8 Changed 17 months ago by Gandoon (Erik Hedlund)

I do now have a slightly clearer image of why QuickLook is involved. I tried to do a port extract transmission, chown the source directory to my normal user and open the code in the Xcode IDE. Now trying to build it, I realised the build order involving building the QuickLookPlugin first. When building for release, the default is to build for both Intel and Apple silicon. This yields linking errors that first shows up in QuickLookPlugin. If I either forced an Intel architecture-only build or defined ONLY_ACTIVE_ARCH=YES, the build succeeded as intended and finished with a built application. So there seems to be no problem with the Transmission source as such.

Because I had a vague recollection of MacOS 10.15 has some issues with building for non-Intel architectures I further tested to add the following to the portfile (the second one is already somewhat included in the patch-file, and the second one was a try to really force only Intel code to be built.

xcode.build.settings-append   ARCHS=x86_64
xcode.build.settings-append   ONLY_ACTIVE_ARCH=YES

However, adding this still does not work with the port upgrade transmission command (and yes, the options do show up on the commandline as instructed). The error remains exactly the same. I really cannot wrap my head around what is really referencing libxml2. It seems to be outside MacPorts ecosystem altogether, as far as I know the .modulemap referenced in the log is part of Apples SDK.

So at this point I am quickly running out of ideas as to why it actually builds with the Xcode IDE but not with the commandline tools MacPorts uses.

comment:9 Changed 15 months ago by Gandoon (Erik Hedlund)

A quick update:

The version offered is now updated to version @4.0.4_0. However, the build error is still present.

Suggestions anyone??

comment:10 Changed 10 months ago by Gandoon (Erik Hedlund)

Yet another update:

The version offered at MacPorts is now at @4.0.5 but the port still fails to build with the same libxml2 module redefinition error.

No luck regardless of if MacPorts libxml2 has been activated or not.

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

this file:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/module.modulemap

Doesn’t seem to exist in this 10.15 SDK:

https://github.com/kencu/macos-sdk/tree/master/MacOSX10.15.sdk/usr/include/libxml2

Given that the port builds on the buildbot, but not for you, and the error seems to relate to the noted file that doesn’t exist in the SDK I referenced, I would wonder why your SDK / Xcode has that file whereas others do not…

I don’t have the answer to that, just the question at present.

comment:13 in reply to:  12 Changed 10 months ago by Gandoon (Erik Hedlund)

Replying to kencu:

this file:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/module.modulemap

Doesn’t seem to exist in this 10.15 SDK:

https://github.com/kencu/macos-sdk/tree/master/MacOSX10.15.sdk/usr/include/libxml2

Given that the port builds on the buildbot, but not for you, and the error seems to relate to the noted file that doesn’t exist in the SDK I referenced, I would wonder why your SDK / Xcode has that file whereas others do not…

I don’t have the answer to that, just the question at present.

Hi there Ken,

Thank you for that comment. I think you may have found the reason for why the build system complained about a redefinition. By renaming and disabling the modulemap in the libxml2 directory you mentioned, I managed to get the application to build. I suspect it may have been a remnant of older stuff since the modulemap in the mentioned directory is almost five years old (14 July 2019) whereas all other files and links, including the ones in the linked to ../libxml directory (where there also exists a modulemap) are no older than 11 June 2020. I.e. still old, but markedly younger than the one I had where you couldn't find one.

Remains to see if this breaks anything, but hopefully not.

comment:14 Changed 10 months ago by Gandoon (Erik Hedlund)

However, all is not well yet unfortunately.

Despite the port building, I get a crash on launch. Here is an excerpt:

Process:               Transmission [29920]
Path:                  /Applications/MacPorts/Transmission.app/Contents/MacOS/Transmission
Identifier:            org.m0k.transmission
Version:               4.0.5 (14714.4.0.5)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Transmission [29920]
User ID:               502

Date/Time:             2024-01-24 17:56:35.527 +0100
OS Version:            Mac OS X 10.15.7 (19H2026)
Report Version:        12
Anonymous UUID:        * * *


Time Awake Since Boot: 96000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x5] Code Signature

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /opt/local/lib/libiconv.2.dylib
  Referenced from: /Applications/MacPorts/Transmission.app/Contents/MacOS/Transmission
  Reason: no suitable image found.  Did find:
	/opt/local/lib/libiconv.2.dylib: code signature in (/opt/local/lib/libiconv.2.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
	/opt/local/lib/libiconv.2.dylib: stat() failed with errno=1

I will have a look at libiconv, but I guess this ticket is not quite done yet.

Last edited 7 months ago by Gandoon (Erik Hedlund) (previous) (diff)

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

good you had luck with libxml2 issue.

your code-signing issue is of course a completely different problem.

probably needs a new ticket for that, to get any attention.

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

Aside:

once I see build errors due to cryptic odd files where they shouldn’t be, I get pretty suspicious about the status of the build system.

Software building is complicated, and really only works reliably on a pristine system.

Given your weird errors, unique to you…. I would be very tempted to start fresh.

I personally would list my requested ports, then uninstall macports, Xcode, and erase the CLTs directory. clean everything out like new.

Then install xcode and the proper CLTs, reinstall macports, and then your ports.

This seems perhaps time-consuming, but would take < 1 hour, and would probably save you months of headaches.

IMHO..

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

comment:17 in reply to:  16 Changed 10 months ago by Gandoon (Erik Hedlund)

Replying to kencu:

Aside:

once I see build errors due to cryptic odd files where they shouldn’t be, I get pretty suspicious about the status of the build system.

Software building is complicated, and really only works reliably on a pristine system.

Given your weird errors, unique to you…. I would be very tempted to start fresh.

I personally would list my requested ports, then uninstall macports, Xcode, and erase the CLTs directory. clean everything out like new.

Then install xcode and the proper CLTs, reinstall macports, and then your ports.

This seems perhaps time-consuming, but would take < 1 hour, and would probably save you months of headaches.

IMHO..

This is quite annoying, and I would have been quite tempted at following your advice if it wasn't for the fact that I have built all my ports from source, and that would take way longer than an hour (I have a gut feeling of closer to a week) if I have to rebuild them all, even if the reinstallation of the build systems would be fairly straightforward.

I think I lean towards abandoning the Macports build of Transmission and just use a standalone build, since that is what I have successfully done since I got fed up with trying to find out what was the issue with the port and submitted the ticket in hope of figuring it out.

Thank you for all your input. I don't know what is the best course of action, leaving the ticket open and I will come back if I find a solution, or close it due to it being an isolated case on an antiquated machine with partly equally antiquated software. I may try a final rebuild of libxml2 or maybe see if I can tweak the directories linked to. Either way, this is more or less life support actions for this machine. I only expect to have it as my main machine for another few months if all goes to plan.

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

Resolution: invalid
Status: assignedclosed

I’ll close this ticket, as the libxml2 thing doesn’t need fixing in macports, it was something unique to your system.

good luck!

comment:19 in reply to:  18 Changed 10 months ago by Gandoon (Erik Hedlund)

Replying to kencu:

I’ll close this ticket, as the libxml2 thing doesn’t need fixing in macports, it was something unique to your system.

good luck!

Makes sense. Thank you,

Note: See TracTickets for help on using tickets.