Skip to content

Node.js 6.x on macOS / Xcode 10.1 failing to compile (libc++) #24648

@rvagg

Description

@rvagg

I don't get this, so hopefully someone else is tuned in to this better than I. I don't follow Xcode happenings and I think that's what this is all about. @srl295 or @ofrobots maybe?

If I compile the current 6.x head with Xcode 10.1 it fails on ICU:

warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library
      instead [-Wstdlibcxx-not-found]
In file included from ../deps/v8/src/libplatform/default-platform.cc:5:
../deps/v8/src/libplatform/default-platform.h:8:10: fatal error: 'functional' file not found
#include <functional>
         ^~~~~~~~~~~~
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library
      instead [-Wstdlibcxx-not-found]
In file included from ../deps/v8/src/libplatform/task-queue.cc:5:
../deps/v8/src/libplatform/task-queue.h:8:10: fatal error: 'queue' file not found
#include <queue>
         ^~~~~~~
1 warning and 1 error generated.

v6.x-staging has a few GYP related fixes for Xcode10, mainly because Apple LLVM went over 10 and string version matching became a problem. But those don't make any impact on this, it still fails in the same way.

7292a1e fixes this, it's on v8.x and later but not v6.x. It came in with V8 5.4. I don't know whether this one is semver-major for macOS, does it do anything to the binaries that might be a problem? We still use -mmacosx-version-min=10.7 so perhaps this is safe?

diff --git a/common.gypi b/common.gypi
index 0838af6b38..d1411ed1c6 100644
--- a/common.gypi
+++ b/common.gypi
@@ -385,6 +385,7 @@
             'xcode_settings': {
               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
               'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',  # -std=gnu++0x
+              'CLANG_CXX_LIBRARY': 'libc++',
             },
           }],
         ],

What I don't understand is why this hasn't already been fixed or why I can't find an issue about it on the repo. The last change to ICU in 6.x was Dec 9, 2016 when we got ICU 58.2. Surely it didn't start requiring libc++ then? Is this simply an Xcode 10 thing and to support 10 we have to turn this on?

Right now I can't test the 6.x security fixes locally on my Mac because of this, but I don't really want to pull in that commit for a security release so I suppose this'll have to wait and I'll rely on CI to test Mac.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.macosIssues and PRs related to the macOS platform / OSX.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions