GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: Auto-load ICU data from --with-icu-default-data-dir by sgallagher · Pull Request #30825 · nodejs/node

Conversation

@sgallagher

@sgallagher sgallagher commented Dec 6, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

When compiled with --with-intl=small and
--with-icu-default-data-dir=PATH, Node.js will use PATH as a
fallback location for the ICU data.

We will first perform an access check using fopen(PATH, 'r') to
ensure that the file is readable. If it is, we'll set the
icu_data_directory and proceed. There's a slight overhead for the
fopen() check, but it should be barely measurable.

This will be useful for Linux distribution packagers who want to
be able to ship a minimal node binary in a container image but
also be able to add on the full i18n support where needed. With
this patch, it becomes possible to ship the interpreter as
/usr/bin/node in one package for the distribution and to ship the
data files in another package (without a strict dependency
between the two). This means that users of the distribution will
not need to explicitly direct Node.js to locate the ICU data. It
also means that in environments where full internationalization is
not required, they do not need to carry the extra content (with
the associated storage costs).

Related: #3460

Signed-off-by: Stephen Gallagher [email protected]

Attn: @srl295

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. c++ Issues and PRs that require attention from people who are familiar with C++. v12.x labels Dec 6, 2019
srl295
srl295 requested changes Dec 6, 2019
View reviewed changes

@srl295 srl295 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor change, but the shape of this looks great to me.

  • It might be helpful to somewhere document the scenario as you did in your comment on the other issue. This could just be in the PR for now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread configure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread node.gypi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Dec 7, 2019
View reviewed changes
Comment thread configure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sgallagher
sgallagher force-pushed the i18n-default-dir branch from b97c862 to 8d43603 Compare December 9, 2019 14:44
@sgallagher sgallagher changed the title Auto-load ICU data from --with-icu-default-data-dir build: Auto-load ICU data from --with-icu-default-data-dir Dec 9, 2019
@sgallagher

sgallagher commented Dec 9, 2019

Copy link
Copy Markdown
Contributor Author

I updated the patch with the code review recommendations. I also changed the commit message and the first comment on this PR to match it and provide more detail on the problem this is solving.

Thank you very much for the review!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau

richardlau commented Dec 9, 2019

Copy link
Copy Markdown
Member

Shouldn't this target master?

sam-github reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sgallagher
sgallagher force-pushed the i18n-default-dir branch from 8d43603 to 288502a Compare December 9, 2019 15:49
@sgallagher
sgallagher changed the base branch from v12.x to master December 9, 2019 16:29
@sgallagher
sgallagher force-pushed the i18n-default-dir branch from 288502a to 46bf401 Compare December 9, 2019 16:29
@sgallagher

sgallagher commented Dec 9, 2019

Copy link
Copy Markdown
Contributor Author

Rebased it to master. I was working on it against v12 originally because a) that's what we have in Fedora and b) the master branch wasn't compiling successfully for me, but that's been fixed in the interim it seems.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sgallagher
sgallagher force-pushed the i18n-default-dir branch from 46bf401 to e40a677 Compare December 9, 2019 17:26
srl295
srl295 approved these changes Dec 10, 2019
View reviewed changes

@srl295 srl295 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@srl295 srl295 added the i18n-api Issues and PRs related to Node.js internationalization support. label Dec 10, 2019
@srl295

srl295 commented Dec 10, 2019

Copy link
Copy Markdown
Member

fyi @nodejs/intl

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis approved these changes Dec 12, 2019
View reviewed changes
Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sgallagher
build: auto-load ICU data from --with-icu-default-data-dir
e610b98
When compiled with `--with-intl=small` and
`--with-icu-default-data-dir=PATH`, Node.js will use PATH as a
fallback location for the ICU data.

We will first perform an access check using fopen(PATH, 'r') to
ensure that the file is readable. If it is, we'll set the
icu_data_directory and proceed. There's a slight overhead for the
fopen() check, but it should be barely measurable.

This will be useful for Linux distribution packagers who want to
be able to ship a minimal node binary in a container image but
also be able to add on the full i18n support where needed. With
this patch, it becomes possible to ship the interpreter as
/usr/bin/node in one package for the distribution and to ship the
data files in another package (without a strict dependency
between the two). This means that users of the distribution will
not need to explicitly direct Node.js to locate the ICU data. It
also means that in environments where full internationalization is
not required, they do not need to carry the extra content (with
the associated storage costs).

Refs: nodejs#3460

Signed-off-by: Stephen Gallagher <[email protected]>
@sgallagher
sgallagher force-pushed the i18n-default-dir branch from e40a677 to e610b98 Compare December 12, 2019 13:07
@sgallagher

sgallagher commented Dec 12, 2019

Copy link
Copy Markdown
Contributor Author

Rebased atop the latest master and made the two minor changes @bnoordhuis requested.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Dec 12, 2019

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/27594/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis bnoordhuis added author ready PRs with CI started, the required approvals, and no outstanding review comments. and removed v12.x labels Dec 12, 2019
@nodejs-github-bot

nodejs-github-bot commented Dec 13, 2019

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/27602/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

richardlau
richardlau approved these changes Dec 13, 2019
View reviewed changes
Trott
Trott approved these changes Dec 13, 2019
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Dec 13, 2019

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/27649/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Dec 14, 2019

Copy link
Copy Markdown
Member

Landed in d502b83

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott closed this Dec 14, 2019
Trott pushed a commit that referenced this pull request Dec 14, 2019
@sgallagher @Trott
build: auto-load ICU data from --with-icu-default-data-dir
d502b83
When compiled with `--with-intl=small` and
`--with-icu-default-data-dir=PATH`, Node.js will use PATH as a
fallback location for the ICU data.

We will first perform an access check using fopen(PATH, 'r') to
ensure that the file is readable. If it is, we'll set the
icu_data_directory and proceed. There's a slight overhead for the
fopen() check, but it should be barely measurable.

This will be useful for Linux distribution packagers who want to
be able to ship a minimal node binary in a container image but
also be able to add on the full i18n support where needed. With
this patch, it becomes possible to ship the interpreter as
/usr/bin/node in one package for the distribution and to ship the
data files in another package (without a strict dependency
between the two). This means that users of the distribution will
not need to explicitly direct Node.js to locate the ICU data. It
also means that in environments where full internationalization is
not required, they do not need to carry the extra content (with
the associated storage costs).

Refs: #3460

Signed-off-by: Stephen Gallagher <[email protected]>

PR-URL: #30825
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 17, 2019
@sgallagher @MylesBorins
build: auto-load ICU data from --with-icu-default-data-dir
00cbf5b
When compiled with `--with-intl=small` and
`--with-icu-default-data-dir=PATH`, Node.js will use PATH as a
fallback location for the ICU data.

We will first perform an access check using fopen(PATH, 'r') to
ensure that the file is readable. If it is, we'll set the
icu_data_directory and proceed. There's a slight overhead for the
fopen() check, but it should be barely measurable.

This will be useful for Linux distribution packagers who want to
be able to ship a minimal node binary in a container image but
also be able to add on the full i18n support where needed. With
this patch, it becomes possible to ship the interpreter as
/usr/bin/node in one package for the distribution and to ship the
data files in another package (without a strict dependency
between the two). This means that users of the distribution will
not need to explicitly direct Node.js to locate the ICU data. It
also means that in environments where full internationalization is
not required, they do not need to carry the extra content (with
the associated storage costs).

Refs: #3460

Signed-off-by: Stephen Gallagher <[email protected]>

PR-URL: #30825
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 17, 2019
v13.5.0 proposal #31010
Merged
targos pushed a commit that referenced this pull request Jan 14, 2020
@sgallagher @targos
build: auto-load ICU data from --with-icu-default-data-dir
67a2a47
When compiled with `--with-intl=small` and
`--with-icu-default-data-dir=PATH`, Node.js will use PATH as a
fallback location for the ICU data.

We will first perform an access check using fopen(PATH, 'r') to
ensure that the file is readable. If it is, we'll set the
icu_data_directory and proceed. There's a slight overhead for the
fopen() check, but it should be barely measurable.

This will be useful for Linux distribution packagers who want to
be able to ship a minimal node binary in a container image but
also be able to add on the full i18n support where needed. With
this patch, it becomes possible to ship the interpreter as
/usr/bin/node in one package for the distribution and to ship the
data files in another package (without a strict dependency
between the two). This means that users of the distribution will
not need to explicitly direct Node.js to locate the ICU data. It
also means that in environments where full internationalization is
not required, they do not need to carry the extra content (with
the associated storage costs).

Refs: #3460

Signed-off-by: Stephen Gallagher <[email protected]>

PR-URL: #30825
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@targos targos mentioned this pull request Jan 15, 2020
v12.15.0 release proposal #31368
Closed
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
@sgallagher @BethGriggs
build: auto-load ICU data from --with-icu-default-data-dir
ada7624
When compiled with `--with-intl=small` and
`--with-icu-default-data-dir=PATH`, Node.js will use PATH as a
fallback location for the ICU data.

We will first perform an access check using fopen(PATH, 'r') to
ensure that the file is readable. If it is, we'll set the
icu_data_directory and proceed. There's a slight overhead for the
fopen() check, but it should be barely measurable.

This will be useful for Linux distribution packagers who want to
be able to ship a minimal node binary in a container image but
also be able to add on the full i18n support where needed. With
this patch, it becomes possible to ship the interpreter as
/usr/bin/node in one package for the distribution and to ship the
data files in another package (without a strict dependency
between the two). This means that users of the distribution will
not need to explicitly direct Node.js to locate the ICU data. It
also means that in environments where full internationalization is
not required, they do not need to carry the extra content (with
the associated storage costs).

Refs: #3460

Signed-off-by: Stephen Gallagher <[email protected]>

PR-URL: #30825
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 8, 2020
v12.16.0 proposal #31691
Merged
@sgallagher
sgallagher deleted the i18n-default-dir branch February 14, 2020 14:55
@srl295 srl295 mentioned this pull request Mar 24, 2020
Retry on failed ICU data load, ignoring NODE_ICU_DATA or --icu-data-dir #32466
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
@Trott Trott Trott approved these changes
@srl295 srl295 srl295 approved these changes
@richardlau richardlau richardlau approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. build Issues and PRs related to Node.js builds or CI infrastructure. c++ Issues and PRs that require attention from people who are familiar with C++. i18n-api Issues and PRs related to Node.js internationalization support.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@sgallagher @richardlau @srl295 @nodejs-github-bot @Trott @bnoordhuis
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.