Skip to content

deps: static cares build fails if shared c-ares installed  #2637

@sambthompson

Description

@sambthompson

Followup from patches landed in #38, I've had this problem on both Mac OS X 10.9.5 and FreeBSD 10.2:

../deps/cares/src/ares_parse_txt_reply.c:153:25: error: no member named 'record_start' in 'struct ares_txt_reply'
        txt_curr->record_start = strptr == aptr;
        ~~~~~~~~  ^
1 error generated.

Edit, to explain context better: There is a breaking API change in Node's cares to support multiple txt records in dns lookup replies. It has not landed upstream - see discussion in #38. When compiling Node's cares, build is referring to the globally installed headers first, which don't include this change to the struct.

This is immediately caused by -I/usr/local/include appearing before -I../deps/cares/include in the compile command. This, in turn, results from the gyp generated makefile, which orders the includes this way. I note that this is not the order used when compiling V8, where the -I../deps/v8/include parameter appears before -I/usr/local/include.

To reproduce, install c-ares as a shared library in /usr/local/..., then build node with --with-intl=system-icu --without-npm --shared-openssl

In discussion at #38, @jbergstroem suggested this related to other shared libraries being included (e.g. zlib), or it may be related to the use of --with-intl=system-icu

nei;tmm:
The exact steps I used on FreeBSD were:

Download VM-image or liveboot iso [for clean env];
Boot...

# Install c-ares.
pkg install c-ares

# Now try to build node 
pkg install gmake libexecinfo python27 icu openssl

mkdir ~/build && cd ~/build
curl https://iojs.org/dist/latest/iojs-v3.2.0.tar.xz | tar -xf -

setenv CC clang
setenv CXX clang++
setenv LINK clang++
setenv GYP_DEFINES clang=1

./configure --with-intl=system-icu --without-npm --shared-openssl --shared-openssl-includes=usr/local/include/openssl --shared-openssl-libpath=/usr/local/lib

patch deps/v8/src/runtime/runtime-i18n.cc:630
-  local_object->SetInternalField(1, reinterpret_cast<Smi*>(NULL));
+  local_object->SetInternalField(1, reinterpret_cast<Smi*>(0));

make

The patch refered to above is in PR #2636, kindly being shepherded through CI by @thefourtheye. It relates to v8 compilation on FreeBSD, and doesn't otherwise relate to the issue here; just had to patch it to get to this point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions