Opened 4 years ago

Closed 3 years ago

#55115 closed defect (fixed)

audacity @2.1.3_1: Undefined symbols: "_OBJC_CLASS_$_ModalDialogDelegate"

Reported by: tehcog (tehcog) Owned by: RJVB (René Bertin)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc: mojca (Mojca Miklavec)
Port: audacity

Description

Oct 18 16:20:22 NerdCenter === Update MacPorts
Oct 18 16:20:22 NerdCenter --->  Updating MacPorts base sources using rsync
Oct 18 16:20:28 NerdCenter MacPorts base version 2.4.2 installed,
Oct 18 16:20:28 NerdCenter MacPorts base version 2.4.2 downloaded.
Oct 18 16:20:28 NerdCenter --->  MacPorts base is already the latest version
Oct 18 16:20:29 NerdCenter === Update Portfiles
Oct 18 16:20:29 NerdCenter --->  Updating the ports tree
Oct 18 16:20:34 NerdCenter
Oct 18 16:20:34 NerdCenter === List Outdated Ports
Oct 18 16:20:35 NerdCenter audacity                       @2.1.3_0
Oct 18 16:20:35 NerdCenter
Oct 18 16:20:35 NerdCenter === Clean Outdated Ports
Oct 18 16:20:36 NerdCenter --->  Cleaning audacity
Oct 18 16:20:36 NerdCenter
Oct 18 16:20:36 NerdCenter === Fetch Outdated Ports
Oct 18 16:20:37 NerdCenter --->  Fetching distfiles for audacity
Oct 18 16:20:37 NerdCenter
Oct 18 16:20:37 NerdCenter === Upgrade Outdated Ports (port -p upgrade --enforce-variants outdated)
Oct 18 16:20:41 NerdCenter --->  Computing dependencies for audacity
Oct 18 16:20:41 NerdCenter --->  Fetching archive for audacity
Oct 18 16:20:41 NerdCenter --->  Attempting to fetch audacity-2.1.3_1.darwin_13.x86_64.tbz2 from https://packages.macports.org/audacity
Oct 18 16:20:42 NerdCenter --->  Attempting to fetch audacity-2.1.3_1.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/audacity
Oct 18 16:20:43 NerdCenter --->  Attempting to fetch audacity-2.1.3_1.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/audacity
Oct 18 16:20:44 NerdCenter --->  Verifying checksums for audacity
Oct 18 16:20:45 NerdCenter --->  Extracting audacity
Oct 18 16:20:46 NerdCenter --->  Applying patches to audacity
Oct 18 16:20:46 NerdCenter --->  Configuring audacity
Oct 18 16:21:31 NerdCenter --->  Building audacity
Oct 18 16:23:16 NerdCenter Error: Failed to build audacity: command execution failed
Oct 18 16:23:16 NerdCenter Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_audio_audacity/audacity/main.log for details.
Oct 18 16:23:16 NerdCenter Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Oct 18 16:23:16 NerdCenter
Oct 18 16:23:16 NerdCenter === List Inactive Duplicate Ports
Oct 18 16:23:17 NerdCenter
Oct 18 16:23:17 NerdCenter === Uninstall Inactive Duplicate Ports
Oct 18 16:23:17 NerdCenter Error: No ports matched the given expression
Oct 18 16:23:17 NerdCenter
Oct 18 16:23:17 NerdCenter === Upgrade Done

Attachments (3)

main.tar.gz (104.4 KB) - added by tehcog (tehcog) 4 years ago.
log
patch-wxw-303.diff (3.8 KB) - added by RJVB (René Bertin) 4 years ago.
audacity.diff (2.5 KB) - added by RJVB (René Bertin) 4 years ago.

Download all attachments as: .zip

Change History (20)

Changed 4 years ago by tehcog (tehcog)

Attachment: main.tar.gz added

log

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: RJVB removed
Owner: set to RJVB
Port: audacity added; Audacity removed
Status: newassigned

comment:2 Changed 4 years ago by tehcog (tehcog)

Mavericks

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

Summary: Error updating Audacity 2.1.3.1audacity @2.1.3_1: Undefined symbols: "_OBJC_CLASS_$_ModalDialogDelegate"

From my machine with macOS Sierra:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_ModalDialogDelegate", referenced from:
      objc-class-ref in libFileDialog.a(libFileDialog_la-FileDialogPrivate.o)
ld: symbol(s) not found for architecture x86_64

comment:4 Changed 4 years ago by RJVB (René Bertin)

This looks like a visibility issue. With wxW 3.0.2.4:

nm /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/lib/libwx_osx_cocoau_core-3.0.dylib | fgrep ModalDialogDelegate
0000000000012af0 t -[ModalDialogDelegate code]
0000000000012ad0 t -[ModalDialogDelegate finished]
0000000000012a50 t -[ModalDialogDelegate init]
0000000000012ab0 t -[ModalDialogDelegate setImplementation:]
0000000000012b40 t -[ModalDialogDelegate sheetDidEnd:returnCode:contextInfo:]
0000000000012b00 t -[ModalDialogDelegate waitForSheetToFinish]
00000000003f7238 S _OBJC_CLASS_$_ModalDialogDelegate
00000000003f70c0 S _OBJC_IVAR_$_ModalDialogDelegate.impl
00000000003f70b8 S _OBJC_IVAR_$_ModalDialogDelegate.resultCode
00000000003f70b0 S _OBJC_IVAR_$_ModalDialogDelegate.sheetFinished
00000000003f7260 S _OBJC_METACLASS_$_ModalDialogDelegate

but with v3.0.3:

nm /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/lib/libwx_osx_cocoau_core-3.0.dylib | fgrep ModalDialogDelegate
00000000000110ad t -[ModalDialogDelegate code]
000000000001109c t -[ModalDialogDelegate finished]
0000000000011036 t -[ModalDialogDelegate init]
000000000001108b t -[ModalDialogDelegate setImplementation:]
00000000000110e5 t -[ModalDialogDelegate sheetDidEnd:returnCode:contextInfo:]
00000000000110bd t -[ModalDialogDelegate waitForSheetToFinish]
0000000000378528 s _OBJC_CLASS_$_ModalDialogDelegate
00000000003783a0 s _OBJC_IVAR_$_ModalDialogDelegate.impl
0000000000378398 s _OBJC_IVAR_$_ModalDialogDelegate.resultCode
0000000000378390 s _OBJC_IVAR_$_ModalDialogDelegate.sheetFinished
0000000000378550 s _OBJC_METACLASS_$_ModalDialogDelegate

I'll check tomorrow if Audacity has an upstream fix but if not it may be necessary to fix this in wxWidgets. Can somebody please add Mojca to the CC list?

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

Cc: mojca added

comment:6 Changed 4 years ago by RJVB (René Bertin)

This is proving to be a tough one. I'm grappling with Audacity 2.2.0 RC1 and there's clearly a symbol visibility (-fvisibility) issue which I haven't yet gotten my finger behind. I'm also getting it on Linux, with a function from portaudio (PaUtil_GetTime()). It looks like that might be a "private" portaudio function, which begs the question why using it worked before. For now I've gone back to using the contributed portaudio copy instead of the one in MacPorts, fortunately that's a rather small library which doesn't evolve (quickly) at that.

Changed 4 years ago by RJVB (René Bertin)

Attachment: patch-wxw-303.diff added

Changed 4 years ago by RJVB (René Bertin)

Attachment: audacity.diff added

comment:7 Changed 4 years ago by RJVB (René Bertin)

I've attached a "minimal" portfile diff and a source patch.

The problem here is that Audacity tries to reimplement a part of a wxWidgets class to add some features to it - including the class "private bits". That's bound to cause problems when visibility comes into play.

Fortunately (for us), it turns out that the ModalDialogDelegate class is only required because a deprecated NSSavePanel method was used. This can be modernised and then we can ignore the delegate. It doesn't appear to be required.

Please test as thoroughly as you can and let me know if there are issues or not. Upstream should be informed.

comment:8 Changed 4 years ago by tehcog (tehcog)

Successful build and running on Mavericks

Thank You

comment:9 Changed 4 years ago by rpspringuel (Fr. Samuel Springuel)

I've tried applying these diffs by copying them into the files directory for audacity, but am still getting the same error. Is that the correct way to apply these patches or do I need to do something else?

comment:10 Changed 4 years ago by RJVB (René Bertin)

https://trac.macports.org/attachment/ticket/55115/patch-wxw-303.diff is to be copied into the files directory, but https://trac.macports.org/attachment/ticket/55115/audacity.diff is a patch to apply to the Portfile.

What you can also do is grab the updated & upgraded port from here, gives you Audacity 2.2.0 :

https://github.com/RJVB/macstrop/tree/master/audio/audacity

comment:11 Changed 4 years ago by mojca (Mojca Miklavec)

Rene, can you please try another super ugly temporary patch of using wxPython-3.0 instead of wxWidgets-3.0 for Audacity? In the meantime we can get the necessary patches upstream.

comment:12 Changed 4 years ago by RJVB (René Bertin)

If you don't mind I won't. Audacity is written around the assumption that WXCOCOA means building on Mac, WXGTK building on just about all other Unix flavours etc. I'd have to go through the entire codebase to figure out which #ifdefs are really Mac-specific and which are specific to using wxWidgets (instead of wxPython). I quickly remembered that nicety when I tried to build it against wxQt.

There isn't any real hurry now that I have a workable patch that removes the dependency on ModalDialogDelegate altogether.

comment:13 Changed 4 years ago by mojca (Mojca Miklavec)

Oh, before there's a misunderstanding: wxPython-3.0 is basically wxWidgets-3.0 (Cocoa) due to a totally sad fact that wxPython always lags behind and won't even be updated to wxWidgets 3.0.3. So basically you get wxWidgets 3.0.2 with one additional folder for python support (irrelevant).

I forgot, but I guess that for wxWidgets 2.8 I went for GTK for Python just because one could not build the Carbon version any longer on modern macs. wxWidgets-3.0 has nothing to do with GTK unless you ask it to.

I saw this patch here, but I thought it was for wxWidgets. I now see it's for Audacity. I would still prefer to get wxWidgets (and/or Audacity) fixed though (upstream) rather than having ugly hacks lying around forever. In the short term we should go for a local patch of course.

Should I commit these patches to Audacity then?

(I wanted to fix the totally broken wxWidgets first - that's done, now it's time to fix Audacity and other remaining problems with wx.)

comment:14 Changed 4 years ago by RJVB (René Bertin)

The patch has already been sent to the Audacity team. I've pointed out that the NSSavePanel they use which gives the dependency on a ModalDialogDelegate class has been deprecated since 10.6 and could be removed anytime now, that gave the patch a bit higher priority ;)

Whether or not that risk is real (for 10.14), the fact is that this patch isn't ugly at all, it's an actual fix for the problem in question. It would be even better if they could use existing wx mechanisms to provide extra features in the file dialogs. But it's not up to us even to push for that unless we're prepared to chip in. I'm not, for the time being.

comment:15 Changed 4 years ago by mojca (Mojca Miklavec)

So basic question: should I commit patches from this ticket now?

(I found patches "ugly" in the sense that I don't like the fact that it should behave different in 3.0.3 than in 3.0.2. If there's a proper solution, it would probably work equally well in both versions. But I'm not eager to patch sources of Audacity either.)

comment:16 Changed 4 years ago by RJVB (René Bertin)

If you're going to commit anything, try the new port version from the link above, so users also get Audacity 2.2.0 .

I didn't notice any difference in behaviour between wx 3.0.3 (with the patch) and 3.0.2 (without the patch). And yes, the patch should work just as well with wx 3.0.2, despite what the version-specific #ifdefs might suggest.

comment:17 Changed 3 years ago by RJVB (René Bertin)

Resolution: fixed
Status: assignedclosed

In f5617a1b95d53a40c20b7e912cd798d8dc886d3e/macports-ports:

audacity[-devel]: update to version 2.2.0/2.2.0.1

  • Update audacity to version 2.2.0.
  • Update audacity devel to version 2.2.0-1-gfd3813f from git.
  • Address incompatibility with wxWidgets 3.0.3. #55115
  • New (experimental) variant wx32 to test builds against wxWidgets 3.1.
  • Dependency portmidi is now taken from MacPorts. The built-in one seems to require ALSA.
  • Dependency portaudio is the built-in one. The one from MacPorts no longer works.
  • Fixes the failure to find ffmpeg. #53438

Closes: #53438
Closes: #55115

Note: See TracTickets for help on using tickets.