Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#57243 closed defect (fixed)

atom @1.30.0 fails to build on Mojave: linking against libstdc++ fails

Reported by: michaellass (Michael Lass) Owned by: kurthindenburg (Kurt Hindenburg)
Priority: Normal Milestone:
Component: ports Version:
Keywords: mojave Cc: libsystem-ethan
Port: atom

Description

On Mojave, the current atom port does not build. I guess the important section of the build log is the following:

:info:build clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
:info:build ld: library not found for -lstdc++
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)

Full build log is attached.

Attachments (1)

atom-build.log (143.0 KB) - added by michaellass (Michael Lass) 6 years ago.
Log of failed build

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by michaellass (Michael Lass)

Attachment: atom-build.log added

Log of failed build

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

Cc: kurthindenburg removed
Owner: set to kurthindenburg
Status: newassigned

comment:2 Changed 6 years ago by michaellass (Michael Lass)

To avoid duplicate work: I have a fix at hand which I'm currently testing. I hope to have a pull request ready soon.

comment:3 Changed 6 years ago by michaellass (Michael Lass)

comment:4 Changed 6 years ago by kurthindenburg (Kurt Hindenburg)

Thanks, I don't have Mojave installed so any of my ports that failed need someone else to look at.

comment:5 Changed 6 years ago by libsystem-ethan

Cc: libsystem-ethan added

comment:6 Changed 6 years ago by Michael Lass <michael.lass@…>

Resolution: fixed
Status: assignedclosed

In 08c7fb67ad9696b68669b7dd137fe3c670d93407/macports-ports (master):

atom: fix build on macOS 10.14

libstdc++ was removed and we need to make sure that modules are built
against libc++. We can do so by setting macOS 10.9 as minimum target in
CFLAGS, CXXFLAGS and LDFLAGS.

While here, it may be a good idea to export these variables always with
macports' default values.

Fixes #57243

comment:7 Changed 6 years ago by kencu (Ken)

I don't completely understand what's going on with this fix, but it looked a bit strange and I deleted it out of the Portfile, and atom built for me right through on Mojave with Xcode10. Perhaps some piece of atom was updated since the original report? At any rate, this might be looked at again at some time in the future to see if it is really needed any longer, as it does not seem to be needed for me.

comment:8 Changed 6 years ago by jmroot (Joshua Root)

It doesn't make much sense since MACOSX_DEPLOYMENT_TARGET is always set in the environment (which does the same thing as -mmacosx-version-min on the command line), and is set to the current OS by default. Unless the build system is changing that internally for some strange reason, it shouldn't have been building for an older target in the first place.

comment:9 in reply to:  8 Changed 6 years ago by michaellass (Michael Lass)

Replying to jmroot:

It doesn't make much sense since MACOSX_DEPLOYMENT_TARGET is always set in the environment (which does the same thing as -mmacosx-version-min on the command line), and is set to the current OS by default. Unless the build system is changing that internally for some strange reason, it shouldn't have been building for an older target in the first place.

Indeed it does. The build is performed by nodejs which in fact sets MACOSX_DEPLOYMENT_TARGET internally: https://github.com/nodejs/node/blob/master/common.gypi#L464

See also: https://github.com/nodejs/node-gyp/issues/469

comment:10 in reply to:  7 Changed 5 years ago by michaellass (Michael Lass)

Replying to kencu:

I don't completely understand what's going on with this fix, but it looked a bit strange and I deleted it out of the Portfile, and atom built for me right through on Mojave with Xcode10. Perhaps some piece of atom was updated since the original report? At any rate, this might be looked at again at some time in the future to see if it is really needed any longer, as it does not seem to be needed for me.

Indeed the issue is magically gone with Atom 1.31.2. I can still reproduce it with 1.30.0 so there must be a change between these versions fixing it. Tracing this down is not worth the effort since many nodejs packages are built during installation and the output is not very verbose. I don't even know which one of those caused the issue in the first place.

So I guess we can just drop the workaround again. Here's a pull request: https://github.com/macports/macports-ports/pull/2874

Note: See TracTickets for help on using tickets.