-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Intl: Build "English-only" binaries for the distribution. #7676
Comments
opened a couple of tickets in v8 that may be needed here. |
Does |
@trevnorris that one has some odd behavior (maybe fixable) , ignored under some build configs, and also reads the entire file into memory (fread) before applying it. My version just configures ICU to do the right thing. Could maybe improve the API upstream (v8) and just have one function. I actually think that InitializeICU's model may be what we will need to go with eventually, though. |
@tjfontaine as #7719 is nearing completion and is marked for v0.12 .. what else will need to happen so that we can get "icu .. enabled by default in builds, but not necessarily included in github"? Who builds the binaries for http://nodejs.org and is there anything that should be done to make things easier for building those? |
Three things I'd like fixed before
|
|
@bnoordhuis You have any ideas about the possible bug in gyp wrt the |
I looked into it and I know what causes it now but I'm not sure how to fix it. You get that warning when using multiple toolsets for a target of type 'executable' (because both binaries end up in the PRODUCT_DIR directory) or when multiple actions have the same filename as their output (for pretty much the same reason.) Neither is something that @srl295's patch seems to do outright but perhaps it's the result of transitive dependencies. It may be a bug in our .gyp and .gypi files after all. |
fix number one of nodejs#7676 (comment) move `icu_src_*` variables to separate `.gypi`
fix number one of nodejs#7676 (comment) move `icu_src_*` variables to separate `.gypi`
Fixes: #7676 (comment) Reviewed-by: Trevor Norris <trev.norris@gmail.com>
@trevnorris re |
@bnoordhuis @trevnorris and I'm still not sure what to do about |
|
Apropos the warnings from the Makefile, I'm not sure if that is a bug in GYP or in our .gyp files but it's because some targets and actions have both host and target toolsets. Maybe try asking on the mailing list? |
@bnoordhuis sure.. I will try that. Last I checked there weren't docs on |
@srl295 re all_deps += $(obj).target/tools/icu/libicui18n.a
# Add target alias
.PHONY: icui18n
icui18n: $(obj).host/tools/icu/libicui18n.a
# Add target alias to "all" target.
.PHONY: all
all: icui18n
# Add target alias
.PHONY: icui18n
icui18n: $(builddir)/libicui18n.a That target exists in both |
@trevnorris yes, but why bother having |
@srl295 that's actually exactly what I had to do. Appended something the |
Though in this case it does look like V8 requires that specific name. From
I'll see if I can fix it. |
Here's a partial "fix" diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp
index bc0a660..8848096 100644
--- a/tools/icu/icu-generic.gyp
+++ b/tools/icu/icu-generic.gyp
@@ -90,7 +90,7 @@
{
'target_name': 'icui18n',
'type': '<(library)',
- 'toolsets': [ 'host', 'target' ],
+ 'toolsets': [ 'target' ],
'sources': [
'<@(icu_src_i18n)'
],
@@ -108,6 +108,27 @@
},
'export_dependent_settings': [ 'icuucx' ],
},
+ {
+ 'target_name': 'icui18n-host',
+ 'type': '<(library)',
+ 'toolsets': [ 'host' ],
+ 'sources': [
+ '<@(icu_src_i18n)'
+ ],
+ 'include_dirs': [
+ '../../deps/icu/source/i18n',
+ ],
+ 'defines': [
+ 'U_I18N_IMPLEMENTATION=1',
+ ],
+ 'dependencies': [ 'icuucx-host', 'icu_implementation', 'icu_uconfig' ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../../deps/icu/source/i18n',
+ ],
+ },
+ 'export_dependent_settings': [ 'icuucx-host' ],
+ },
# this library is only built for derb..
{
'target_name': 'icuio',
@@ -122,13 +143,13 @@
'defines': [
'U_IO_IMPLEMENTATION=1',
],
- 'dependencies': [ 'icuucx', 'icui18n', 'icu_implementation', 'icu_uconfig' ],
+ 'dependencies': [ 'icuucx-host', 'icui18n-host', 'icu_implementation', 'icu_uconfig' ],
'direct_dependent_settings': {
'include_dirs': [
'../../deps/icu/source/io',
],
},
- 'export_dependent_settings': [ 'icuucx', 'icui18n' ],
+ 'export_dependent_settings': [ 'icuucx-host', 'icui18n-host' ],
},
# This exports actual ICU data
{
@@ -288,7 +309,19 @@
{
'target_name': 'icustubdata',
'type': '<(library)',
- 'toolsets': [ 'host', 'target' ],
+ 'toolsets': [ 'target' ],
+ 'dependencies': [ 'icu_implementation' ],
+ 'sources': [
+ '<@(icu_src_stubdata)'
+ ],
+ 'include_dirs': [
+ '../../deps/icu/source/common',
+ ],
+ },
+ {
+ 'target_name': 'icustubdata-host',
+ 'type': '<(library)',
+ 'toolsets': [ 'host' ],
'dependencies': [ 'icu_implementation' ],
'sources': [
'<@(icu_src_stubdata)'
@@ -313,7 +346,35 @@
'target_name': 'icuucx',
'type': '<(library)',
'dependencies': [ 'icu_implementation', 'icu_uconfig' ],
- 'toolsets': [ 'host', 'target' ],
+ 'toolsets': [ 'target' ],
+ 'sources': [
+ '<@(icu_src_common)'
+ ],
+ 'include_dirs': [
+ '../../deps/icu/source/common',
+ ],
+ 'defines': [
+ 'U_COMMON_IMPLEMENTATION=1',
+ ],
+ 'export_dependent_settings': [ 'icu_uconfig' ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../../deps/icu/source/common',
+ ],
+ 'conditions': [
+ [ 'OS=="win"', {
+ 'link_settings': {
+ 'libraries': [ '-lAdvAPI32.Lib', '-lUser32.lib' ],
+ },
+ }],
+ ],
+ },
+ },
+ {
+ 'target_name': 'icuucx-host',
+ 'type': '<(library)',
+ 'dependencies': [ 'icu_implementation', 'icu_uconfig' ],
+ 'toolsets': [ 'host' ],
'sources': [
'<@(icu_src_common)'
],
@@ -342,7 +403,7 @@
'target_name': 'icutools',
'type': '<(library)',
'toolsets': [ 'host' ],
- 'dependencies': [ 'icuucx', 'icui18n', 'icustubdata' ],
+ 'dependencies': [ 'icuucx-host', 'icui18n-host', 'icustubdata-host' ],
'sources': [
'<@(icu_src_tools)'
],
@@ -358,7 +419,7 @@
'../../deps/icu/source/tools/toolutil',
],
},
- 'export_dependent_settings': [ 'icuucx', 'icui18n', 'icustubdata' ],
+ 'export_dependent_settings': [ 'icuucx-host', 'icui18n-host', 'icustubdata-host' ],
},
# This tool is needed to rebuild .res files from .txt,
# or to build index (res_index.txt) files for small-icu
# or to build index (res_index.txt) files for small-icu
@@ -366,7 +427,7 @@
'target_name': 'genrb',
'type': 'executable',
'toolsets': [ 'host' ],
- 'dependencies': [ 'icutools', 'icuucx', 'icui18n' ],
+ 'dependencies': [ 'icutools', 'icuucx-host', 'icui18n-host' ],
'sources': [
'<@(icu_src_genrb)'
],
@@ -382,7 +443,7 @@
'target_name': 'iculslocs',
'toolsets': [ 'host' ],
'type': 'executable',
- 'dependencies': [ 'icutools', 'icuucx', 'icui18n', 'icuio' ],
+ 'dependencies': [ 'icutools', 'icuucx-host', 'icui18n-host', 'icuio' ],
'sources': [
'iculslocs.cc',
'no-op.cc',
@@ -394,7 +455,7 @@
'target_name': 'icupkg',
'toolsets': [ 'host' ],
'type': 'executable',
- 'dependencies': [ 'icutools', 'icuucx', 'icui18n' ],
+ 'dependencies': [ 'icutools', 'icuucx-host', 'icui18n-host' ],
'sources': [
'<@(icu_src_icupkg)',
'no-op.cc',
@@ -405,7 +466,7 @@
'target_name': 'genccode',
'toolsets': [ 'host' ],
'type': 'executable',
- 'dependencies': [ 'icutools', 'icuucx', 'icui18n' ],
+ 'dependencies': [ 'icutools', 'icuucx-host', 'icui18n-host' ],
'sources': [
'<@(icu_src_genccode)',
'no-op.cc', Maybe there's a better way to do this. |
@trevnorris Argh! That's exactly what I was trying to avoid- duplicating everything- seems very fragile. I posted this - https://groups.google.com/forum/#!topic/gyp-developer/NrFzsJd2l78 |
@srl295 Thanks for posting that. Though I'll be surprised if anyone responds. Honestly I'm not super familiar with gyp, but maybe there's a way to use a variable. I forget how gyp uses those, but something like:
No idea how that would actually work, but might be worth a try. |
@trevnorris in between Unicode committe and Unicode conference. . but, I can try to do something like the above if there's a short window to v0.12 |
@srl295 The above should be the quickest solution. Why don't we have that one on hand just in case we can't figure out something better by the time v0.12 is released. |
This is to implement nodejs#7676 (comment) * make `--with-intl=none` the default * Download, verify (md5), unpack ICU's zip if not there * update docs There's a "list" of URLs being used, but right now only the first is picked up. The logic works something like this: * if there is no directory `deps/icu`, * if no zip file (currently `icu4c-54_1-src.zip`), * download zip file (icu-project.org -> sf.net) * verify the MD5 sum of the zipfile * if bad, print error and exit * unpack the zipfile into `deps/icu` * if `deps/icu` now exists, use it, else fail with help text Also: * refactor some code into tools/configure.d/nodedownload.py * add `intl-none` option for `vcbuild.bat` To rebuild `deps/icu-small` - (not currently checked in) ``` bash tools/icu/prepare-icu-source.sh ``` Also: Reduce space by about 1MB with ICU 54 (over without this patch). Also trims a few other source files, but only conditional on the exact ICU version used. This is to future-proof - a file that is unneeded now may be needed in future ICUs.
This is to implement nodejs#7676 (comment) * make `--with-intl=none` the default * Download, verify (md5), unpack ICU's zip if not there * update docs * add a test There's a "list" of URLs being used, but right now only the first is picked up. The logic works something like this: * if there is no directory `deps/icu`, * if no zip file (currently `icu4c-54_1-src.zip`), * download zip file (icu-project.org -> sf.net) * verify the MD5 sum of the zipfile * if bad, print error and exit * unpack the zipfile into `deps/icu` * if `deps/icu` now exists, use it, else fail with help text Also: * refactor some code into tools/configure.d/nodedownload.py * add `intl-none` option for `vcbuild.bat` To rebuild `deps/icu-small` - (not currently checked in) ``` bash tools/icu/prepare-icu-source.sh ``` Also: Reduce space by about 1MB with ICU 54 (over without this patch). Also trims a few other source files, but only conditional on the exact ICU version used. This is to future-proof - a file that is unneeded now may be needed in future ICUs.
This is to implement nodejs#7676 (comment) * make `--with-intl=none` the default * Download, verify (md5), unpack ICU's zip if not there * update docs * add a test There's a "list" of URLs being used, but right now only the first is picked up. The logic works something like this: * if there is no directory `deps/icu`, * if no zip file (currently `icu4c-54_1-src.zip`), * download zip file (icu-project.org -> sf.net) * verify the MD5 sum of the zipfile * if bad, print error and exit * unpack the zipfile into `deps/icu` * if `deps/icu` now exists, use it, else fail with help text Also: * refactor some code into tools/configure.d/nodedownload.py * add `intl-none` option for `vcbuild.bat` To rebuild `deps/icu-small` - (not currently checked in) ``` bash tools/icu/prepare-icu-source.sh ``` Reduce space by about 1MB with ICU 54 (over without this patch). Also trims a few other source files, but only conditional on the exact ICU version used. This is to future-proof - a file that is unneeded now may be needed in future ICUs.
This is to implement nodejs#7676 (comment) * make `--with-intl=none` the default * Download, verify (md5), unpack ICU's zip if not there * update docs * add a test There's a "list" of URLs being used, but right now only the first is picked up. The logic works something like this: * if there is no directory `deps/icu`, * if no zip file (currently `icu4c-54_1-src.zip`), * download zip file (icu-project.org -> sf.net) * verify the MD5 sum of the zipfile * if bad, print error and exit * unpack the zipfile into `deps/icu` * if `deps/icu` now exists, use it, else fail with help text Also: * refactor some code into tools/configure.d/nodedownload.py * add `intl-none` option for `vcbuild.bat` To rebuild `deps/icu-small` - (not currently checked in) ``` bash tools/icu/prepare-icu-source.sh ``` Reduce space by about 1MB with ICU 54 (over without this patch). Also trims a few other source files, but only conditional on the exact ICU version used. This is to future-proof - a file that is unneeded now may be needed in future ICUs.
Make "--with-intl=none" the default and add "intl-none" option to vcbuild.bat. If icu data is missing print a warning unless either --download=all or --download=icu is set. If set then automatically download, verify (MD5) and unpack the ICU data if not already available. There's a "list" of URLs being used, but right now only the first is picked up. The logic works something like this: * If there is no directory deps/icu, * If no zip file (currently icu4c-54_1-src.zip), * Download zip file (icu-project.org -> sf.net) * Verify the MD5 sum of the zipfile * If bad, print error and exit * Unpack the zipfile into deps/icu * If deps/icu now exists, use it, else fail with help text Add the configuration option "--with-icu-source=..." Usage: * --with-icu-source=/path/to/my/other/icu * --with-icu-source=/path/to/icu54.zip * --with-icu-source=/path/to/icu54.tgz * --with-icu-source=http://example.com/icu54.tar.bz2 Add the configuration option "--with-icu-locals=...". Allows choosing which locales are used in the "small-icu" case. Example: configure --with-intl=small-icu --with-icu-locales=tlh,grc,nl (Also note that as of this writing, neither Klingon nor Ancient Greek are in upstream CLDR data. Serving suggestion only.) Don't use hard coded ../../out paths on windows. This was suggested by @misterdjules as it causes test failures. With this fix, "out" is no longer created on windows and the following can run properly: python tools/test.py simple Reduce space by about 1MB with ICU 54 (over without this patch). Also trims a few other source files, but only conditional on the exact ICU version used. This is to future-proof - a file that is unneeded now may be needed in future ICUs. Also: * Update distclean to remove icu related files * Refactor some code into tools/configure.d/nodedownload.py * Update docs * Add test PR-URL: #8719 Fixes: #7676 (comment) [trev.norris@gmail.com small change to test's whitespace and logic] Signed-off-by: Trevor Norris <trev.norris@gmail.com>
I find that having this "general discussion" issue makes it difficult to track the current state of this work. If I understand correctly, here's what we want regarding the distribution of binaries that include ICU support:
If we agree on that, I suggest closing this issue and creating two separate issues that correspond to the two points mentioned above. @tjfontaine @srl295 @trevnorris What do you think? |
But, that's the only and entire point of #7676 - if that's true,, it should |
@srl295 Ok, I was just confused by some comments that mention several sub-issues/sub-tasks that we may want to address separately. This issue also contains comments that were not updated and I think that just adds to the confusion. Like I said I would rather have each issue/PR address only "atomic" issues so that we can track them more easily. I just tested the However, in my previous comment I failed to mention that some more work needs to be done to have So as soon as the changes needed to make binary packages include small-icu land, I suggest closing this issue and we'll start creating several more specific issues. @srl295 How does that sound? |
Sounds good to me... more later. |
Invokes the configure script used to build binary packages (OSX pkg, binary tarballs, pkgsrc, MSI) with --download=all --with-intl=small-icu. Also makes PACKAGEMAKER customizable, because PackageMaker is not necessarily installed in /Developer on OSX anymore. Tested all binary packages on Windows, OSX, Linux and SmartOS. Fixes nodejs#7676.
Invokes the configure script used to build binary packages (OSX pkg, binary tarballs, pkgsrc, MSI) with --download=all --with-intl=small-icu. Also makes PACKAGEMAKER customizable, because PackageMaker is not necessarily installed in /Developer on OSX anymore. Tested all binary packages on Windows, OSX, Linux and SmartOS. Fixes nodejs#7676. Reviewed-by: Steven R. Loomis <srl@icu-project.org> Reviewed-by: Trevor Norris <trev.norris@gmail.com>
A new issue to continue the discussion in #6371 and #4689 - especially to implement #6371 (comment)
--with-default-icu-path=...
--icu-data-dir=
path.. or NODE_ICU_DATA env var can override the default/cc @tjfontaine @trevnorris
The text was updated successfully, but these errors were encountered: