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

build: Auto-load ICU data from --with-icu-default-data-dir #30825

Closed
wants to merge 1 commit into from

Commits on Dec 12, 2019

  1. build: auto-load ICU data from --with-icu-default-data-dir

    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 <sgallagh@redhat.com>
    sgallagher committed Dec 12, 2019
    Copy the full SHA
    e610b98 View commit details
    Browse the repository at this point in the history