Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build stuff (using gyp) on FreeBSD 11.1 (or clang 4.0) #14076

Closed
nanaya opened this issue Jul 4, 2017 · 8 comments
Closed

Can't build stuff (using gyp) on FreeBSD 11.1 (or clang 4.0) #14076

nanaya opened this issue Jul 4, 2017 · 8 comments
Labels
addons Issues and PRs related to native addons. build Issues and PRs related to build files or the CI. freebsd Issues and PRs related to the FreeBSD platform.

Comments

@nanaya
Copy link
Contributor

nanaya commented Jul 4, 2017

  • Version: v8.1.3
  • Platform: FreeBSD 11.1-RC1
  • Subsystem: ?

The flag added here breaks the above FreeBSD version because it uses clang 4.0 which doesn't need it anymore (or something). It's removed in ports (depending on clang version) but when building node-sass, it uses the unpatched version (downloads https://nodejs.org/download/release/v8.1.3/node-v8.1.3-headers.tar.gz ). Modifying common.gypi in ~/.node-gyp fixes it.

node-sass$ sudo pkg install -y node npm
node-sass$ npm install
...stuff...
gmake: Entering directory '/home/edho/git/node-sass/build'
  c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.0.beta.2"' -I/home/edho/.node-gyp/8.1.3/include/node -I/home/edho/.node-gyp/8.1.3/src -I/home/edho/.node-gyp/8.1.3/deps/uv/include -I/home/edho/.node-gyp/8.1.3/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -O3 -fno-omit-frame-pointer -std=gnu++0x -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
In file included from ../src/libsass/src/ast.cpp:1:
In file included from ../src/libsass/src/sass.hpp:46:
In file included from ../src/libsass/include/sass/base.h:19:
In file included from /usr/include/c++/v1/stddef.h:40:
/usr/include/c++/v1/__config:73:2: error: "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead
#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \
 ^
1 error generated.
gmake: *** [src/libsass.target.mk:144: Release/obj.target/libsass/src/libsass/src/ast.o] Error 1
gmake: Leaving directory '/home/edho/git/node-sass/build'
gyp ERR! build error
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/edho/git/node-sass/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System FreeBSD 11.1-RC1
gyp ERR! command "/usr/local/bin/node" "/home/edho/git/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/edho/git/node-sass
gyp ERR! node -v v8.1.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/edho/.npm/_logs/2017-07-04T18_31_33_467Z-debug.log
@bnoordhuis bnoordhuis added addons Issues and PRs related to native addons. build Issues and PRs related to build files or the CI. freebsd Issues and PRs related to the FreeBSD platform. labels Jul 4, 2017
@bnoordhuis
Copy link
Member

See #12784 for context. If there is a way to make it work with both freebsd 10 and 11, file a pull request and I'll review it. You can probably branch on llvm_version>="4.0" in common.gypi.

@nanaya
Copy link
Contributor Author

nanaya commented Jul 4, 2017

Looks like there's no llvm_version variable though and I don't know any good way to generate it (short of doing shell script monstrosity).

@bnoordhuis
Copy link
Member

The configure script sets it if it detects that CC is clang. You should see it in config.gypi.

@nanaya
Copy link
Contributor Author

nanaya commented Jul 4, 2017

Doesn't seem to be used when building node-sass though. Also the value is 0 in ~/.node-gyp because it's downloaded and not generated.

@refack refack closed this as completed in 8979b4f Jul 22, 2017
addaleax pushed a commit that referenced this issue Jul 22, 2017
PR-URL: #14077
Fixes: #14076
Refs: https://svnweb.freebsd.org/ports/head/www/node/Makefile?revision=444555&view=markup
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Fishrock123 pushed a commit that referenced this issue Jul 24, 2017
PR-URL: #14077
Fixes: #14076
Refs: https://svnweb.freebsd.org/ports/head/www/node/Makefile?revision=444555&view=markup
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@Jehops
Copy link

Jehops commented Aug 3, 2017

Assuming these node-sass build issues are fixed after 8.2.1 (we're still seeing them in 8.2.1 on FreeBSD 11.1 amd64; see below) would it be possible to roll a new v8 release?

gmake: Entering directory '/usr/local/www/mastodon/node_modules/node-sass/build'
  c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.0.beta.2"' -I/usr/local/www/mastodon/.node-gyp/8.2.1/include/node -I/usr/local/www/mastodon/.node-gyp/8.2.1/src -I/usr/local/www/mastodon/.node-gyp/8.2.1/deps/uv/include -I/usr/local/www/mastodon/.node-gyp/8.2.1/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -O3 -fno-omit-frame-pointer -std=gnu++0x -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
In file included from ../src/libsass/src/ast.cpp:1:
In file included from ../src/libsass/src/sass.hpp:46:
In file included from ../src/libsass/include/sass/base.h:19:
In file included from /usr/include/c++/v1/stddef.h:40:
/usr/include/c++/v1/__config:73:2: error: "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported.        use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead
#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \

@refack
Copy link
Contributor

refack commented Aug 3, 2017

@Jehops seems like it will be in node@8.3.0 (#14594), available now as RC https://nodejs.org/download/rc/v8.3.0-rc.0/

uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Aug 6, 2017
…eBSD

11.1 that prevents building node modules with gyp [2].

[1] nodejs/node#14076
[2] Users still have to install www/yarn and devel/rubygem-execjs with
non-default NODE6 option.


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@447464 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Aug 6, 2017
…eBSD

11.1 that prevents building node modules with gyp [2].

[1] nodejs/node#14076
[2] Users still have to install www/yarn and devel/rubygem-execjs with
non-default NODE6 option.
@oschonrock
Copy link

oschonrock commented Nov 30, 2017

I still have problems building node-sass (under gyp) on FBSD11.1.

In order to get the fix in mat813/freebsd-ports@cea3aae now, I updated to latest packages:

# cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}

and then

pkg install npm-node8

New packages to be INSTALLED:
        npm-node8: 5.4.2_2
        node8: 8.9.1_1

but still

$ npm install node-sass
...
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/local/bin/python2
gyp info spawn args [ '/usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/oliver/.node-gyp/8.9.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',  
gyp info spawn args   '-Dnode_root_dir=/home/oliver/.node-gyp/8.9.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/oliver/.node-gyp/8.9.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /home/oliver/.node-gyp/8.9.1
gyp verb `which` succeeded for `gmake` /usr/local/bin/gmake
gyp info spawn gmake
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
gmake: Entering directory '/usr/local/www/bootstrap4.webcollect.org.uk/node_modules/node-sass/build'
  c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.0.beta.2"' -I/home/oliver/.node-gyp/8.9.1/include/node -I/home/oliver/.node-gyp/8.9.1/src -I/home/oliver/.node-gyp/8.9.1/deps/uv/include -I/home/oliver/.node-gyp/8.9.1/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -O3 -fno-omit-frame-pointer -std=gnu++0x -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
In file included from ../src/libsass/src/ast.cpp:1:
In file included from ../src/libsass/src/sass.hpp:46:
In file included from ../src/libsass/include/sass/base.h:19:
In file included from /usr/include/c++/v1/stddef.h:40:
/usr/include/c++/v1/__config:73:2: error: "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
      instead
#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \

also documented here: sass/node-sass#2153 (comment)

@oschonrock
Copy link

@saper

I solved it. It was to do with how the binary node8 package was being built in the FreeBSD pack build infrastructure. TLDR; it was being built under FBSD 11.0 (clang3.8.0), and if you then run it on a FBSD11.1 (clang 4.0.0) machine the gyp build (of eg node-sass) will fail with above error. Building the port from source on local machine always works.

Details here:
https://lists.freebsd.org/pipermail/freebsd-ports/2017-December/111288.html

referred to here: sass/node-sass#2153 (comment)
and here: #17404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Issues and PRs related to native addons. build Issues and PRs related to build files or the CI. freebsd Issues and PRs related to the FreeBSD platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants