Opened 7 months ago

Last modified 7 months ago

#68343 reopened defect

ffmpeg configure fails, clang unable to create executables

Reported by: ShadSterling (Shad Sterling) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: mascguy (Christopher Nielsen), dbevans (David B. Evans), jeremyhu (Jeremy Huddleston Sequoia), cjones051073 (Chris Jones), jmroot (Joshua Root)
Port: ffmpeg

Description

sudo port -p -N upgrade outdated updated many ports successfully, but fails to update ffmpeg

The reason in the logs appears to be :info:configure /usr/bin/clang is unable to create an executable file.

/usr/bin/clang --version says

Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

port output says configure failure but doesn't mention a config log (only the main log). I doubt /usr/bin/clang is actually unable to create an executable, but I don't see any indication of what the actual problem is. Trying with no variants and default variants had the same result

Attachments (2)

main.log (295.7 KB) - added by ShadSterling (Shad Sterling) 7 months ago.
config.log (256.3 KB) - added by ShadSterling (Shad Sterling) 7 months ago.

Download all attachments as: .zip

Change History (20)

Changed 7 months ago by ShadSterling (Shad Sterling)

Attachment: main.log added

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

Can you locate a config.log file anywhere within $(port work ffmpeg)? If so, please attach it.

comment:2 Changed 7 months ago by cjones051073 (Chris Jones)

My bet is this is another issue caused by the issues in Xcode 15 with the new linker.

Last edited 7 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:3 Changed 7 months ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

Changed 7 months ago by ShadSterling (Shad Sterling)

Attachment: config.log added

comment:4 Changed 7 months ago by kencu (Ken)

It looks like you may have upgraded Xcode to 15, but not as yet upgraded the command line tools.

comment:5 Changed 7 months ago by ShadSterling (Shad Sterling)

Yep, that was it. Apparently Xcode got updated automatically but the command line tools didn't, and when I got the message and ran the command to accept the license agreement it didn't warn me about the mismatch. Seems like something Apple could do better. After updating the command line tools it's working again. Thanks!

comment:6 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

The config.log said the error was:

ld: library not found for -ld_classic

comment:7 Changed 7 months ago by kencu (Ken)

Resolution: worksforme
Status: newclosed

comment:8 Changed 7 months ago by kencu (Ken)

Resolution: worksforme
Status: closedreopened

I'm sorry, I should let Ryan close this with the resolution he prefers, which may not be 'worksforme'.

comment:9 in reply to:  6 Changed 7 months ago by cjones051073 (Chris Jones)

Replying to ryandesign:

The config.log said the error was:

ld: library not found for -ld_classic

That warning is a little misleading. It suggests the error is a missing library, which is not the case. It is just the ld version did not understand the ld_classic flag and mis-interpreted it as a library request.

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

Right, there should probably be a ProblemHotlist entry explaining what it really means.

comment:11 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

I'm not planning on being the one to close this ticket because I'm not really involving myself in this set of issues. I would expect the ticket to remain open until it is fixed, or closed as a duplicate if there is another ticket tracking this set of issues. Although we recommend not having a mismatched set of Xcode and CLT, I don't understand why having a mismatched set caused this issue for this user. The user runs macOS 13, and we obviously never encountered this issue until after the release of macOS 14 and Xcode 15 since the -ld_classic flag was not something any version of the linker knew about until then, so the fact that this flag is getting inserted now on a system that doesn't understand it seems like a fixable bug to me.

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

Chris, so this is twice now this issue shows up, where a user has Xcode 15 installed but also has out of date command line tools, so this error comes up when the -ld_classic flag is sent to the older ld in the CLTs that doesn't understand it.

I can't think of any good fix other than noticing the issue in their logs and telling people to update their CLTs, but Ryan is asking for one.

Can you think up some magic incantation to get past this issue?

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

Actually "port diagnose" should be able to spot out-of-date CLTs, or mismatched CLTs and Xcode, and tell users to update them.

And MacPorts should require a "port diagnose" output with every ticket, and then we would never see these tickets at all, because "port diagnose" would have (should have) told people how to fix it before they submit the ticket.

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

comment:14 Changed 7 months ago by ShadSterling (Shad Sterling)

port upgrade told me about one problem with the command line tools (that I had to accept the license agreement for them to work), it would have been helpful if it had told me to upgrade them in the same place

comment:15 in reply to:  12 ; Changed 7 months ago by cjones051073 (Chris Jones)

Replying to kencu:

Chris, so this is twice now this issue shows up, where a user has Xcode 15 installed but also has out of date command line tools, so this error comes up when the -ld_classic flag is sent to the older ld in the CLTs that doesn't understand it.

I can't think of any good fix other than noticing the issue in their logs and telling people to update their CLTs, but Ryan is asking for one.

Can you think up some magic incantation to get past this issue?

I guess in principle it would be possible to query the CLT and xcode vesions, using something similar to what I do here

https://github.com/macports/macports-ports/blob/master/lang/gcc13/Portfile#L174

to detect when to apply the flag in gcc builds.

It probably though would not make sense to do this at the port level, so its something someone would have to propose adding to base (perhaps adding it to port diagnose).

That though will take a long time to get to users, and by then who knows perhaps Apple would have fixed the issue anyway...

Until then, I think it is just a cause of being aware of this and looking out for it..

comment:16 in reply to:  13 ; Changed 7 months ago by cjones051073 (Chris Jones)

Replying to kencu:

Actually "port diagnose" should be able to spot out-of-date CLTs, or mismatched CLTs and Xcode, and tell users to update them.

And MacPorts should require a "port diagnose" output with every ticket, and then we would never see these tickets at all, because "port diagnose" would have (should have) told people how to fix it before they submit the ticket.

Perhaps one way to do that is for port to automatically run 'diagnose' at the end ofa failed install, and just dump it into the end of the log...

comment:17 in reply to:  15 Changed 7 months ago by kencu (Ken)

Replying to cjones051073:

Until then, I think it is just a cause of being aware of this and looking out for it..

Well, I agree -- working around mismatched Xcode and CLT installations is not a MacPorts bug to fix.

comment:18 in reply to:  16 Changed 7 months ago by mascguy (Christopher Nielsen)

Cc: jmroot added

Replying to cjones051073:

Replying to kencu:

Actually "port diagnose" should be able to spot out-of-date CLTs, or mismatched CLTs and Xcode, and tell users to update them.

And MacPorts should require a "port diagnose" output with every ticket, and then we would never see these tickets at all, because "port diagnose" would have (should have) told people how to fix it before they submit the ticket.

Perhaps one way to do that is for port to automatically run 'diagnose' at the end of a failed install, and just dump it into the end of the log...

That sounds like an awesome idea, and would pay dividends for all sorts of issues going forward.

@jmroot, your thoughts on that?

Note: See TracTickets for help on using tickets.