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

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

Closed
jelmd opened this issue Nov 12, 2015 · 12 comments
Closed

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

jelmd opened this issue Nov 12, 2015 · 12 comments
Assignees
Labels
build Issues and PRs related to build files or the CI. i18n-api Issues and PRs related to the i18n implementation.

Comments

@jelmd
Copy link

jelmd commented Nov 12, 2015

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
@bnoordhuis bnoordhuis added the build Issues and PRs related to build files or the CI. label Nov 12, 2015
@bnoordhuis
Copy link
Member

/cc @nodejs/intl

@srl295 srl295 self-assigned this Nov 12, 2015
@srl295 srl295 added the i18n-api Issues and PRs related to the i18n implementation. label Nov 12, 2015
@srl295
Copy link
Member

srl295 commented Nov 12, 2015

@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?

@jelmd
Copy link
Author

jelmd commented Nov 12, 2015

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?

@srl295
Copy link
Member

srl295 commented Nov 12, 2015

@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.

@jelmd
Copy link
Author

jelmd commented Nov 13, 2015

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?

@srl295
Copy link
Member

srl295 commented Nov 13, 2015

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.

@jelmd
Copy link
Author

jelmd commented Nov 13, 2015

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!!!

@srl295
Copy link
Member

srl295 commented Nov 13, 2015

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

I'll open a PR.

srl295 added a commit to srl295/node that referenced this issue Nov 13, 2015
* add toolset stuff to icu-system.gyp
* update docs

Fixes: nodejs#3801
@srl295 srl295 closed this as completed in 84f0964 Nov 15, 2015
srl295 added a commit that referenced this issue Nov 17, 2015
* add toolset stuff to icu-system.gyp
* update docs

Fixes: #3801
PR-URL: #3808
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
srl295 added a commit that referenced this issue Nov 30, 2015
* add toolset stuff to icu-system.gyp
* update docs

Fixes: #3801
PR-URL: #3808
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
srl295 added a commit that referenced this issue Dec 4, 2015
* add toolset stuff to icu-system.gyp
* update docs

Fixes: #3801
PR-URL: #3808
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
srl295 added a commit that referenced this issue Dec 17, 2015
* add toolset stuff to icu-system.gyp
* update docs

Fixes: #3801
PR-URL: #3808
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
srl295 added a commit that referenced this issue Dec 23, 2015
* add toolset stuff to icu-system.gyp
* update docs

Fixes: #3801
PR-URL: #3808
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@liudonghua123
Copy link
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.

@srl295
Copy link
Member

srl295 commented Jan 15, 2024

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 ?

@liudonghua123
Copy link
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.

@srl295
Copy link
Member

srl295 commented Jan 15, 2024

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
Labels
build Issues and PRs related to build files or the CI. i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

4 participants