Bug 222630

Summary: www/node 8.5.0_1 "gyp" error during make
Product: Ports & Packages Reporter: Shaun <freebsd>
Component: Individual Port(s)Assignee: Bradley T. Hughes <bhughes>
Status: Closed FIXED    
Severity: Affects Only Me CC: andreas.sommer87, w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description Shaun 2017-09-26 20:24:42 UTC
Overview:

    Attempting to build node results in an error during configuration

Steps to Reproduce: 

    cd /usr/ports/www/node
    make

    The default options were used: DOCS, DTRACE, and NLS enabled, with the BUNDLED_SSL option disabled

Actual Results: 

    [root@host /usr/ports/www/node]# make
    ===>  License MIT accepted by the user
    ===>   node-8.5.0_1 depends on file: /usr/local/sbin/pkg - found
    ===> Fetching all distfiles required by node-8.5.0_1 for building
    ===>  Extracting for node-8.5.0_1
    => SHA256 Checksum OK for node-v8.5.0.tar.gz.
    ===>  Patching for node-8.5.0_1
    ===>  Applying FreeBSD patches for node-8.5.0_1
    ===>   node-8.5.0_1 depends on executable: gmake - found
    ===>   node-8.5.0_1 depends on file: /usr/local/bin/python2.7 - found
    ===>   node-8.5.0_1 depends on executable: python2 - found
    ===>   node-8.5.0_1 depends on package: pkgconf>=1.3.0_1 - found
    ===>   node-8.5.0_1 depends on shared library: libcares.so - found (/usr/local/lib/libcares.so)
    ===>   node-8.5.0_1 depends on shared library: libuv.so - found (/usr/local/lib/libuv.so)
    ===>   node-8.5.0_1 depends on shared library: libicui18n.so - found (/usr/local/lib/libicui18n.so)
    ===>  Configuring for node-8.5.0_1
    creating ./icu_config.gypi
    { 'target_defaults': { 'cflags': [],
                           'default_configuration': 'Release',
                           'defines': ['NODE_OPENSSL_CERT_STORE'],
                           'include_dirs': [ '/usr/local/include',
                                             '/usr/local/include',
                                             '/usr/local/include'],
                           'libraries': [ '-lz',
                                          '-L/usr/local/lib',
                                          '-luv',
                                          '-L/usr/local/lib',
                                          '-lcares',
                                          '-lcrypto',
                                          '-lssl',
                                          '-L/usr/local/lib',
                                          '-licui18n',
                                          '-licuuc',
                                          '-licudata']},
      'variables': { 'asan': 0,
                     'coverage': 'false',
                     'debug_devtools': 'node',
                     'debug_http2': 'false',
                     'debug_nghttp2': 'false',
                     'force_dynamic_crt': 0,
                     'host_arch': 'x64',
                     'icu_gyp_path': 'tools/icu/icu-system.gyp',
                     'icu_small': 'false',
                     'llvm_version': '4.0',
                     'node_byteorder': 'little',
                     'node_enable_d8': 'false',
                     'node_enable_v8_vtunejit': 'false',
                     'node_install_npm': 'false',
                     'node_module_version': 57,
                     'node_no_browser_globals': 'false',
                     'node_prefix': '/usr/local',
                     'node_release_urlbase': '',
                     'node_shared': 'false',
                     'node_shared_cares': 'true',
                     'node_shared_http_parser': 'false',
                     'node_shared_libuv': 'true',
                     'node_shared_openssl': 'true',
                     'node_shared_zlib': 'true',
                     'node_tag': '',
                     'node_use_bundled_v8': 'true',
                     'node_use_dtrace': 'true',
                     'node_use_etw': 'false',
                     'node_use_lttng': 'false',
                     'node_use_openssl': 'true',
                     'node_use_perfctr': 'false',
                     'node_use_v8_platform': 'true',
                     'node_without_node_options': 'false',
                     'openssl_fips': '',
                     'openssl_no_asm': 0,
                     'shlib_suffix': 'so.57',
                     'target_arch': 'x64',
                     'uv_parent_path': '/deps/uv/',
                     'uv_use_dtrace': 'true',
                     'v8_enable_gdbjit': 0,
                     'v8_enable_i18n_support': 1,
                     'v8_enable_inspector': 1,
                     'v8_no_strict_aliasing': 1,
                     'v8_optimized_debug': 0,
                     'v8_promise_internal_field_count': 1,
                     'v8_random_seed': 0,
                     'v8_trace_maps': 0,
                     'v8_use_snapshot': 'true',
                     'want_separate_host_toolset': 0,
                     'want_separate_host_toolset_mkpeephole': 0}}
    creating ./config.gypi
    creating ./config.mk
    [21694 refs]
    gyp: Call to '/usr/local/bin/python2.7 -c "import sys; print sys.byteorder"' returned exit status 0 while in /usr/ports/www/node/work/node-v8.5.0/deps/v8/src/v8.gyp. while loading dependencies of /usr/ports/www/node/work/node-v8.5.0/node.gyp while trying to load /usr/ports/www/node/work/node-v8.5.0/node.gyp
    Error running GYP
    [67987 refs]
    ===>  Script "configure" failed unexpectedly.
    Please report the problem to bhughes@FreeBSD.org [maintainer] and attach the
    "/usr/ports/www/node/work/node-v8.5.0/config.log" including the output of the
    failure of your make command. Also, it might be a good idea to provide an
    overview of all packages installed on your system (e.g. a
    /usr/local/sbin/pkg-static info -g -Ea).
    *** Error code 1
    
    Stop.
    make[1]: stopped in /usr/ports/www/node
    *** Error code 1
    
    Stop.
    make: stopped in /usr/ports/www/node

Expected Results: 

    Successful build of node

Build Date & Hardware: 

    FreeBSD 11.1-RELEASE-p1 #0 r323722: Mon Sep 18 20:53:37 CDT 2017 amd64

Additional Information:

    The file solicited by the error message, /usr/ports/www/node/work/node-v8.5.0/config.log, wasn't created.

    Output of `pkg-static info -g -Ea` follows:

    [root@host /usr/ports/www/node]# pkg-static info -g -Ea
    GeoIP-1.6.11                   Find the country that any IP address or hostname originates from
    apr-1.6.2.1.6.0                Apache Portability Library
    asciidoc-8.6.9_5               Text document format for writing short documents and man pages
    autoconf-2.69_1                Automatically configure source code on many Un*x platforms
    autoconf-wrapper-20131203      Wrapper script for GNU autoconf
    automake-1.15.1                GNU Standards-compliant Makefile generator
    automake-wrapper-20131203      Wrapper script for GNU automake
    bash-4.4.12_2                  GNU Project's Bourne Again SHell
    bash-completion-2.7,1          Programmable completion library for Bash
    bdftopcf-1.0.5                 Convert X font from BDF to PCF
    bind911-9.11.2                 BIND DNS suite with updated DNSSEC and DNS64
    bison-3.0.4,1                  Parser generator from FSF, (mostly) compatible with Yacc
    boehm-gc-7.6.0                 Garbage collection and memory leak detection for C and C++
    c-ares-1.12.0_2                Asynchronous DNS resolver library
    ca_root_nss-3.32.1             Root certificate bundle from the Mozilla Project
    cairo-1.14.8_1,2               Vector graphics library with cross-device output support
    cmake-3.9.2_1                  Cross-platform Makefile generator
    curl-7.55.1                    Command line tool and library for transferring data with URLs
    cvsps-2.1_2                    Create patchset information from CVS
    cyrus-sasl-2.1.26_12           RFC 2222 SASL (Simple Authentication and Security Layer)
    db5-5.3.28_6                   Oracle Berkeley DB, revision 5.3
    dejavu-2.37                    Bitstream Vera Fonts clone with a wider range of characters
    dialog4ports-0.1.6             Console Interface to configure ports
    docbook-1.5                    Meta-port for the different versions of the DocBook DTD
    docbook-sgml-4.5_1             DocBook SGML DTD
    docbook-xml-5.0_3              DocBook XML DTD
    docbook-xsl-1.76.1_3           XSL DocBook stylesheets
    encodings-1.0.4_3,1            X.Org Encoding fonts
    expat-2.2.1                    XML 1.0 parser written in C
    font-bh-ttf-1.0.3_3            X.Org Bigelow & Holmes TTF font
    font-misc-ethiopic-1.0.3_3     X.Org miscellaneous Ethiopic font
    font-misc-meltho-1.0.3_3       X.Org miscellaneous Meltho font
    font-util-1.3.1                Create an index of X font files in a directory
    fontconfig-2.12.1,1            XML-based font configuration API for X Windows
    fontsproto-2.1.3,1             Fonts extension headers
    fping-3.16                     Quickly ping multiple hosts without flooding the network
    freetype2-2.8                  Free and portable TrueType font rendering engine
    fstrm-0.3.2                    Implementation of the Frame Streams data transport protocol in C
    gdbm-1.13_1                    GNU database manager
    getopt-1.1.6                   Replacement for getopt(1) that supports GNU-style long options
    gettext-runtime-0.19.8.1_1     GNU gettext runtime libraries and programs
    gettext-tools-0.19.8.1         GNU gettext development and translation tools
    git-2.14.1                     Distributed source code management tool
    glib-2.50.2_6,1                Some useful routines of C programming (current stable version)
    gmake-4.2.1_1                  GNU version of 'make' utility
    gobject-introspection-1.50.0,1 Generate interface introspection data for GObject libraries
    graphite2-1.3.10               Rendering capabilities for complex non-Roman writing systems
    harfbuzz-1.5.1_1               OpenType text shaping engine
    heirloom-mailx-12.4_7          BSD mail utility with MIME, IMAP, POP3, SMTP, and S/MIME extensions
    help2man-1.47.5                Automatically generating simple manual pages from program output
    htop-2.0.2                     Better top(1) - interactive process viewer
    icu-59.1,1                     International Components for Unicode (from IBM)
    idnkit-1.0_6                   Library to handle internationalized domain names
    indexinfo-0.2.6                Utility to regenerate the GNU info page index
    intltool-0.51.0_1              Tools to internationalize various kinds of data files
    iso8879-1986_3                 Character entity sets from ISO 8879:1986 (SGML)
    json-c-0.12.1                  JSON (JavaScript Object Notation) implementation in C
    jsoncpp-1.8.1_1                JSON reader and writer library for C++
    libXfont-1.5.2,2               X font library
    libarchive-3.3.1,1             Library to create and read several streaming archive formats
    libatomic_ops-7.6.0_1          Atomic operations access library
    libedit-3.1.20170329_2,1       Command line editor library
    libevent-2.1.8                 API for executing callback functions on events or timeouts
    libffi-3.2.1_1                 Foreign Function Interface
    libfontenc-1.1.3_1             The fontenc Library
    libgcrypt-1.8.1                General purpose crypto library based on code used in GnuPG
    libgpg-error-1.27              Common error values for all GnuPG components
    libiconv-1.14_10               Character set conversion library
    libltdl-2.4.6                  System independent dlopen wrapper
    liblz4-1.8.0,1                 LZ4 compression library, lossless and very fast
    libmcrypt-2.5.8_3              Multi-cipher cryptographic library (used in PHP)
    libnghttp2-1.26.0              HTTP/2.0 C Library
    libpaper-1.1.24.4              Library providing routines for paper size management
    libtool-2.4.6                  Generic shared library support script
    libuv-1.14.1                   Multi-platform support library with a focus on asynchronous I/O
    libxml2-2.9.4                  XML parser library for GNOME
    libxslt-1.1.29_1               The XSLT C library for GNOME
    lmdb-0.9.21,1                  OpenLDAP Lightning Memory-Mapped Database
    lsof-4.90.p,8                  Lists information about open files (similar to fstat(1))
    lzo2-2.10_1                    Portable speedy, lossless data compression library
    m4-1.4.18,1                    GNU M4
    mkfontdir-1.0.7                Create an index of X font files in a directory
    mkfontscale-1.1.2              Creates an index of scalable font files for X
    mtr-0.92                       Traceroute and ping in a single network diagnostic tool
    mysql57-client-5.7.19_2        Multithreaded SQL database (client)
    mysql57-server-5.7.19_2        Multithreaded SQL database (server)
    nano-2.8.7                     Nano's ANOther editor, an enhanced free Pico clone
    net-snmp-5.7.3_17              Extendable SNMP implementation
    ninja-1.7.2,2                  Ninja is a small build system closest in spirit to Make
    nmap-7.40_1                    Port scanning utility for large networks
    openldap-client-2.4.45         Open source LDAP client implementation
    p5-Authen-SASL-2.16_1          Perl5 module for SASL authentication
    p5-Digest-HMAC-1.03_1          Perl5 interface to HMAC Message-Digest Algorithms
    p5-Error-0.17025               Error/exception handling in object-oriented programming style
    p5-GSSAPI-0.28_1               Perl extension providing access to the GSSAPIv2 library
    p5-Locale-gettext-1.07         Message handling functions
    p5-XML-Parser-2.44             Perl extension interface to James Clark's XML parser, expat
    pango-1.40.6                   Open-source framework for the layout and rendering of i18n text
    pcre-8.40_1                    Perl Compatible Regular Expressions library
    pear-Net_IPv4-1.3.4            IPv4 network calculations and validation
    perl5-5.24.2                   Practical Extraction and Report Language
    pixman-0.34.0                  Low-level pixel manipulation library
    pkg-1.10.1                     Package manager
    pkgconf-1.3.7,1                Utility to help to configure compiler and linker flags
    png-1.6.32                     Library for manipulating PNG images
    portmaster-3.17.10             Manage your ports without external databases or languages
    protobuf-3.4.1                 Data interchange format library
    protobuf-c-1.3.0               Code generator and libraries to use Protocol Buffers from pure C
    py27-Babel-2.3.4               Collection of tools for internationalizing Python applications
    py27-Jinja2-2.9.5              Fast and easy to use stand-alone template engine
    py27-MarkupSafe-1.0            Implements XML/HTML/XHTML Markup safe string for Python
    py27-MySQLdb-1.2.5             Access a MySQL database through Python
    py27-alabaster-0.7.6           Modified Kr Sphinx theme
    py27-docutils-0.14             Python Documentation Utilities
    py27-imagesize-0.7.1           Python image size library
    py27-pip-9.0.1                 Tool for installing and managing Python packages
    py27-pygments-2.2.0            Syntax highlighter written in Python
    py27-pystemmer-1.3.0_1         Snowball Stemming Algorithms for Information Retrieval
    py27-pytz-2017.2,1             World Timezone Definitions for Python
    py27-setuptools-36.2.2         Python packages installer
    py27-six-1.11.0                Python 2 and 3 compatibility utilities
    py27-snowballstemmer-1.2.0_1   Snowball stemming library collection for Python
    py27-sphinx-1.4.8_2,1          Python documentation generator
    py27-sphinx_rtd_theme-0.2.4    Mobile-friendly py-sphinx theme
    python2-2_3                    The "meta-port" for version 2 of the Python interpreter
    python27-2.7.14                Interpreted object-oriented programming language
    readline-7.0.3                 Library for editing command lines as they are typed
    rhash-1.3.4                    Utility and library for computing and checking of file hashes
    rrdtool-1.7.0_1                Round Robin Database Tools
    scons-2.5.1_1                  Build tool alternative to make
    sdocbook-xml-1.1_2,2           "Simplified" DocBook XML DTD
    serf-1.3.9_1                   Serf HTTP client library
    sqlite3-3.20.1_1               SQL database engine in a C library
    stunnel-5.42,1                 SSL encryption wrapper for standard network daemons
    subversion-1.9.7               Version control system
    texinfo-6.5,1                  Typeset documentation system with multiple format output
    unix2dos-1.3                   Convert ASCII newlines between CR/LF and LF
    w3m-0.5.3.20170102             Pager/text-based WWW browser
    xmlcatmgr-2.2_2                SGML and XML catalog manager
    xmlcharent-0.3_2               XML character entities
    xmlto-0.0.28                   Front-end to an XSL toolchain
    xorg-fonts-truetype-7.7_1      X.Org TrueType fonts
    xorg-macros-1.19.1             X.Org development aclocal macros
    xproto-7.0.31                  X11 protocol headers
    xtrans-1.3.5                   Abstract network code for X
Comment 1 Bradley T. Hughes freebsd_committer 2017-10-21 10:05:53 UTC
I have seen reports of this error before, but I have no idea what causes it. I have not been able to reproduce it on any of my test machines, which makes it difficult to investigate and fix. I would appreciate any help in finding out what causes this.
Comment 2 w.schwarzenfeld freebsd_triage 2018-02-03 03:12:43 UTC
Found a lot of similar problems in the net. Seems it does not find python. Try replace 
USES= python:2,build
with
USES= python:2.7,build
Comment 3 w.schwarzenfeld freebsd_triage 2018-02-03 03:16:46 UTC
Btw
/!\ node8-8.9.3: Makefile warnings, please consider fixing /!\

USES=python:2 is deprecated, use USES=python:2.7
Comment 4 Bradley T. Hughes freebsd_committer 2018-02-05 09:39:35 UTC
Another user sent me an email with the following:

"I was finally able to build node version 9.4.0 on FreeBSD 11-1. It turns out that the problem was using python build with the "DEBUG" option ON. Therefore I set the python "DEBUG" option OFF and rebuild python then I was able to build node successfully. Hopefully you can reproduce the error."

I have not tried to reproduce this locally yet, but it seems that there is at least a workaround.
Comment 5 w.schwarzenfeld freebsd_triage 2018-02-05 09:43:55 UTC
I was not able to reproduce it with 10.4 and 11.1.
Comment 6 Andreas Sommer 2018-02-22 20:24:15 UTC
(In reply to Bradley T. Hughes from comment #4)
I can confirm it stemming from the DEBUG option of python27. These combinations failed for me: 103amd64 + python27-2.7.12(DEBUG) + node-{6.7.0,6.8.0,6.9.1} (in a ports tree roughly dated end 2016). As the other people, there was no reasonable error and I did not dig deeper.
Comment 7 w.schwarzenfeld freebsd_triage 2019-02-10 23:52:46 UTC
Is this still relevant?
Comment 8 Shaun 2019-02-11 03:59:28 UTC
(In reply to w.schwarzenfeld from comment #7)

I can't speak to the original conditions, as the system where I was experiencing this problem has since been upgraded from FreeBSD 11.1 to 11.2, and the version of node in ports has advanced from 8.5.0 to 11.9.0. Under this environment, node builds without any errors.

I'm assuming this was fixed somewhere along the way, so I'll close out the bug.