Bug 1755114 - nodejs is built without internationalization support
Summary: nodejs is built without internationalization support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nodejs
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stephen Gallagher
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1766771
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-24 19:30 UTC by Giovanni Campagna
Modified: 2020-11-05 10:31 UTC (History)
7 users (show)

Fixed In Version: nodejs-12.13.0-7.fc31 nodejs-12-3120191029011808.f636be4b nodejs-12-3020191029011808.a5b0195c
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-15 03:01:39 UTC
Type: Bug


Attachments (Terms of Use)

Description Giovanni Campagna 2019-09-24 19:30:12 UTC
Description of problem:
Since the update to 12.8.1, nodejs is built with small-icu, so any application that relies on the Intl JS module is broken. 

Version-Release number of selected component (if applicable):
Observed with nodejs-12.10.0-1.fc31.x86_64

How reproducible:
Always.

Steps to Reproduce:
Follow instructions at https://nodejs.org/api/intl.html#intl_detecting_internationalization_support

Additional info:
If building with system-icu (as it was done in the past) is not possible, nodejs should be built with full-icu, which will embed the whole data files in the binary.

Shipping without internationalization support is not good.

Comment 1 Stephen Gallagher 2019-09-25 12:18:17 UTC
(In reply to Giovanni Campagna from comment #0)

> If building with system-icu (as it was done in the past) is not possible,
> nodejs should be built with full-icu, which will embed the whole data files
> in the binary.

OK, I suppose it's going to have to be full-icu, because system-icu in Fedora is still on 63.2 and Node.js requires 64.1.

I'll see what I can do.

Comment 2 Stephen Gallagher 2019-09-25 19:06:07 UTC
It turns out that building with `full-icu` results in a huge increase in disk usage (70MiB on x86_64). That... doesn't seem appropriate to have for all deployments. We want to be able to retain a very small installation for container usage.

https://nodejs.org/api/intl.html#intl_providing_icu_data_at_runtime indicates that you can set an environment variable or pass `--icu-data-dir` to the node binary in order to have it read the unicode data. My plan is this: continue to build Node.js with `small-icu` and also ship a new subpackage 'nodejs-i18n' that will contain the data files in /usr/lib[64] (the 64 depends on if it's a 64-bit or 32-bit OS). To work with them, you'd run `node --icu-data-dir=/usr/lib64` or set `NODE_ICU_DATA=/usr/lib64` in the environment.

Will that work for you, Giovanni?

Comment 3 Vít Ondruch 2019-09-26 06:35:16 UTC
(In reply to Stephen Gallagher from comment #2)
> ship a new subpackage 'nodejs-i18n'

Please be careful about the subpackage name. It might one day collide with https://www.npmjs.com/package/i18n

Comment 4 Giovanni Campagna 2019-10-08 05:05:22 UTC
(In reply to Stephen Gallagher from comment #2)
> It turns out that building with `full-icu` results in a huge increase in
> disk usage (70MiB on x86_64). That... doesn't seem appropriate to have for
> all deployments. We want to be able to retain a very small installation for
> container usage.
> 
> https://nodejs.org/api/intl.html#intl_providing_icu_data_at_runtime
> indicates that you can set an environment variable or pass `--icu-data-dir`
> to the node binary in order to have it read the unicode data. My plan is
> this: continue to build Node.js with `small-icu` and also ship a new
> subpackage 'nodejs-i18n' that will contain the data files in /usr/lib[64]
> (the 64 depends on if it's a 64-bit or 32-bit OS). To work with them, you'd
> run `node --icu-data-dir=/usr/lib64` or set `NODE_ICU_DATA=/usr/lib64` in
> the environment.
> 
> Will that work for you, Giovanni?

It's not a great solution. I should also point out that one can install the ICU data separately from NPM, so yeah a similar workaround is already possible without a new package.
The whole point of this bug, though, is that running "node" used to do the right thing, and now the command line needs to change. Especially for scripts and terminal usage this is quite painful.

Maybe the compromise is that the nodejs-i18n package also ships a profile.sh snippet to set the right environment variable? At least it would help with interactive, desktop usage.
Alternatively, can node be patched to always look for the data in the system directory, and fallback to the builtin US English data only if the package is not installed?

Comment 5 Stephen Gallagher 2019-10-29 14:59:42 UTC
Getting this solved "the right way" is taking too much of my time. I'm going to go the "full-icu" route for now and we can try to optimize it if and when someone packages ICU 64.2 for Fedora.

Comment 6 Stephen Gallagher 2019-10-30 13:30:29 UTC
OK, I lied. I've gone ahead and packaged a version of libicu 64.2 (see BZ#1766771, linked as blocking this BZ). Once that lands, I'll rebuild Node.js against it.

Comment 7 Fedora Update System 2019-11-06 23:54:56 UTC
FEDORA-2019-dcd50aea78 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-dcd50aea78

Comment 8 Fedora Update System 2019-11-06 23:54:59 UTC
FEDORA-MODULAR-2019-6f02daa6ca has been submitted as an update to Fedora 29 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-6f02daa6ca

Comment 9 Fedora Update System 2019-11-06 23:55:02 UTC
FEDORA-MODULAR-2019-376858362f has been submitted as an update to Fedora 31 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-376858362f

Comment 10 Fedora Update System 2019-11-06 23:55:06 UTC
FEDORA-MODULAR-2019-2aeb4c4522 has been submitted as an update to Fedora 30 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-2aeb4c4522

Comment 11 Fedora Update System 2019-11-07 01:45:03 UTC
nodejs-12.13.0-7.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-dcd50aea78

Comment 12 Fedora Update System 2019-11-09 19:40:06 UTC
nodejs-12-2920191029011808.6c81f848 has been pushed to the Fedora 29 Modular testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-6f02daa6ca

Comment 13 Fedora Update System 2019-11-10 04:32:31 UTC
nodejs-12-3020191029011808.a5b0195c has been pushed to the Fedora 30 Modular testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-2aeb4c4522

Comment 14 Fedora Update System 2019-11-10 04:42:21 UTC
nodejs-12-3120191029011808.f636be4b has been pushed to the Fedora 31 Modular testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2019-376858362f

Comment 15 Fedora Update System 2019-11-15 03:01:39 UTC
nodejs-12.13.0-7.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2019-11-18 02:27:48 UTC
nodejs-12-3120191029011808.f636be4b has been pushed to the Fedora 31 Modular stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2019-11-18 03:14:05 UTC
nodejs-12-3020191029011808.a5b0195c has been pushed to the Fedora 30 Modular stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.