Skip to content

node5: unable to build with '--with-intl=system-icu' #3801

Description

@jelmd

When I try to build node5 '--with-intl=system-icu' it fails with an obscure message shown below - any hints how to fix it?

creating  ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [ '/export/scratch/build/root4build/usr/include',
                                         '/export/scratch/build/root4build/usr/include'],
                       'libraries': [ '-lz',
                                      '-I/export/scratch/build/root4build/usr/include',
                                      '-luv',
                                      '-lsocket',
                                      '-lsendfile',
                                      '-lkstat',
                                      '-lssl',
                                      '-lcrypto',
                                      '-L/export/scratch/build/root4build/usr/lib/amd64',
                                      '-licui18n',
                                      '-licuuc',
                                      '-licudata']},
  'variables': { 'asan': 0,
                 'host_arch': 'ia32',
                 'icu_gyp_path': 'tools/icu/icu-system.gyp',
                 'icu_small': 'false',
                 'node_byteorder': 'little',
                 'node_install_npm': 'true',
                 'node_prefix': '/usr',
                 'node_release_urlbase': '',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'true',
                 'node_shared_openssl': 'true',
                 'node_shared_zlib': 'true',
                 'node_tag': '',
                 'node_use_dtrace': 'true',
                 'node_use_etw': 'false',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'python': '/usr/bin/amd64/python',
                 'target_arch': 'x64',
                 'uv_parent_path': '/deps/uv/',
                 'uv_use_dtrace': 'true',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 1,
                 'want_separate_host_toolset': 1}}
creating  ./config.gypi
creating  ./config.mk
gyp: Dependency '/export/scratch/build/node-v5.0.0/tools/icu/icu-system.gyp:icui18n#host' not found while trying to load target /export/scratch/build/node-v5.0.0/deps/v8/tools/gyp/v8.gyp:v8_base#host
Error running GYP

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Nov 12, 2015
  2. bnoordhuis commented on Nov 12, 2015

    @bnoordhuis
    Member

    /cc @nodejs/intl

  3. self-assigned this
    on Nov 12, 2015
  4. added
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Nov 12, 2015
  5. srl295 commented on Nov 12, 2015

    @srl295
    Member

    @jelmd can you tell me more about your environment? I tried both master and v5.x on ubuntu 14.04 ( after apt-get install libicu-dev ) and could not reproduce this.

    system-icu just calls pkg-config. Can you try pkg-config icu-i18n --cflags --libs and report what it produces vs. what you would expect for ICU?

  6. jelmd commented on Nov 12, 2015

    @jelmd
    Author

    Im Building the stuff on solaris 11. The output is

    -I/export/scratch/build/root4build/usr/include  -L/export/scratch/build/root4build/usr/lib/amd64 -licui18n -licuuc -licudata
    

    Not sure, why this is broken - build works with --with-intl=none. I do not know, what "pseudo-intelligence" is going on there. I don't even know, why this strange tool does such strange things. Isn't there a debug switch, where one can see, what strange thing it is trying todo/expects?

  7. srl295 commented on Nov 12, 2015

    @srl295
    Member

    @jelmd what about --with-intl=small-icu --download=all ? does that work?

    How is ICU installed on this platform? I notice it says host_arch a32 but the library has amd64 in its name - are you cross compiling?

    I do not know, what "pseudo-intelligence" is going on there. I don't even know, why this strange tool does such strange things.

    I don't follow you, sorry. No pseudo-intelligence here, but if there's a human-induced bug let's try to squash it.

  8. jelmd commented on Nov 13, 2015

    @jelmd
    Author

    Never tried with small-icu, because IMHO it doesn't make much sense - just implies more maintenance nightmares.

    The ICU libs and includes are put as needed into DESTDIR=/export/scratch/build/root4build/ .

    Pseudo-intelligence in the sense of black box, which does something, but no one can tell what, why, how and what the expected results are. E.g. I have no clue, what "hostarch ia32" implies or how this stuff deduces this value. As almost all modern *x, Solaris is able to execute 32 as well as 64bit binaries - nothing special here.

    Finally it makes me a little bit nervous, that no-one seems to be able to explain "gyp: Dependency '/export/scratch/build/node-v5.0.0/tools/icu/icu-system.gyp:icui18n#host' not found while trying to load target /export/scratch/build/node-v5.0.0/deps/v8/tools/gyp/v8.gyp:v8_base#host". Another incarnation of autotools but this time even without any logs?

  9. srl295 commented on Nov 13, 2015

    @srl295
    Member

    Never tried with small-icu,

    Could you try it for comparison?

    What is your exact configure command line? I think system-icu may not work for cross compilation.
    edit we may need to support <something>-pkg-config as in here

    Can you try replacing tools/icu/icu-system.gyp with the following:

    {
      'targets': [
        {
          'target_name': 'icuuc',
          'type': 'none',
          'toolsets': [ 'host', 'target' ],
        },
        {
          'target_name': 'icui18n',
          'type': 'none',
          'toolsets': [ 'host', 'target' ],
        },
      ],
    }
    

    As to your answer to how to debug gyp, I am not sure. It was a process of trial and error for me.

  10. jelmd commented on Nov 13, 2015

    @jelmd
    Author

    Yepp, haven't found any useful stuff wrt. gyp either - everything was superficial stuff, only.

    Anyway, tried small-icu: beside that it takes "hours" to download it, it finally works.

    After that I tried with your icu-system.gyp from above as well and heureka: it works like a charm :-) !

    Thank you very much!!!

  11. srl295 commented on Nov 13, 2015

    @srl295
    Member

    Shouldn't take hours— it's sourceforge mirrors. Anyway— welcome!

    I'll open a PR.

  12. liudonghua123 commented on Jan 15, 2024

    @liudonghua123
    Contributor

    I tried to build node v20.10.0 with system-icu on windows. But it seems not supported.

    > .\vcbuild.bat x64 ltcg system-icu
    Looking for Python
    Python found in C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python311\\python.exe
    Python 3.11.2
    Looking for NASM
    Looking for Visual Studio 2022
    Found MSVS version 17.0
    configure  --with-ltcg --with-intl=system-icu --dest-cpu=x64
    Node.js configure: Found Python 3.11.2...
    Package icu-i18n was not found in the pkg-config search path.
    Perhaps you should add the directory containing `icu-i18n.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'icu-i18n', required by 'virtual:world', not found
    ERROR: Could not load pkg-config data for "icu-i18n".
           See above errors or the README.md.
    Failed to create vc project files.
    
  13. srl295 commented on Jan 15, 2024

    @srl295
    Member

    I tried to build node v20.10.0 with system-icu on windows. But it seems not supported.

    
    > .\vcbuild.bat x64 ltcg system-icu
    
    Looking for Python
    
    Python found in C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python311\\python.exe
    
    Python 3.11.2
    
    Looking for NASM
    
    Looking for Visual Studio 2022
    
    Found MSVS version 17.0
    
    configure  --with-ltcg --with-intl=system-icu --dest-cpu=x64
    
    Node.js configure: Found Python 3.11.2...
    
    Package icu-i18n was not found in the pkg-config search path.
    
    Perhaps you should add the directory containing `icu-i18n.pc'
    
    to the PKG_CONFIG_PATH environment variable
    
    Package 'icu-i18n', required by 'virtual:world', not found
    
    ERROR: Could not load pkg-config data for "icu-i18n".
    
           See above errors or the README.md.
    
    Failed to create vc project files.
    
    

    Do you have the file icu-i18n.pc ? Is it on PKG_CONFIG_PATH ?

  14. liudonghua123 commented on Jan 15, 2024

    @liudonghua123
    Contributor

    I am using windows, pkg-config and libicu-dev is not available.

    I found windows 10/11 is bundled with a ms version of icu. But I don't know how to config the path of ic in config script.

  15. srl295 commented on Jan 15, 2024

    @srl295
    Member

    I think you should file a new issue and link it here.

    I am using windows, pkg-config and libicu-dev is not available.

    I found windows 10/11 is bundled with a ms version of icu. But I don't know how to config the path of icu in config script.

    The headers to compile against that ICU must be available. macOS also has an ICU but does not provide headers.

    system-icu is there for the situation where your system provides an ICU that you can compile against. This is the case with Linux for example, and it is also the case on macos when you install icu via brew.sh.

    I found this but I have not used it:

    https://learn.microsoft.com/en-us/windows/win32/intl/international-components-for-unicode--icu-#getting-started

    It looks like the files have different names.

    node.js will expect the header files to be named the same way as with usual ICU.

    perhaps if you create a custom .pc file you can make the build happen this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buildIssues and PRs related to Node.js builds or CI infrastructure.i18n-apiIssues and PRs related to Node.js internationalization support.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions