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

src: remove icu based ToASCII and ToUnicode #55156

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Sep 28, 2024

We have been using Ada's ToASCII and ToUnicode implementations since Node 18. I think it's safe to assume we can remove this "unused" code.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. i18n-api Issues and PRs related to the i18n implementation. needs-ci PRs that need a full CI run. labels Sep 28, 2024
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.41%. Comparing base (0c68991) to head (41641f7).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #55156   +/-   ##
=======================================
  Coverage   88.40%   88.41%           
=======================================
  Files         653      653           
  Lines      187597   187502   -95     
  Branches    36112    36097   -15     
=======================================
- Hits       165850   165781   -69     
+ Misses      14967    14961    -6     
+ Partials     6780     6760   -20     
Files with missing lines Coverage Δ
src/node_i18n.cc 73.74% <ø> (+0.67%) ⬆️
src/node_i18n.h 81.25% <ø> (ø)

... and 43 files with indirect coverage changes

test/fixtures/url-idna.js Outdated Show resolved Hide resolved
@anonrig
Copy link
Member Author

anonrig commented Oct 7, 2024

cc @nodejs/cpp-reviewers can you review?

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 7, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 8, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau
Copy link
Member

This appears to have broken the build when Node.js is configured with --with-intl=small-icu.
e.g. https://ci.nodejs.org/job/node-test-commit-linux-containered/46896/nodes=ubuntu2204_sharedlibs_smallicu_x64/console

21:54:07 In file included from ../deps/icu-small/source/common/unicode/platform.h:25,
21:54:07                  from ../deps/icu-small/source/common/unicode/ptypes.h:46,
21:54:07                  from ../deps/icu-small/source/common/unicode/umachine.h:46,
21:54:07                  from ../deps/icu-small/source/common/unicode/utypes.h:38,
21:54:07                  from ../deps/icu-small/source/common/unicode/ucnv_err.h:88,
21:54:07                  from ../deps/icu-small/source/common/unicode/ucnv.h:51,
21:54:07                  from ../src/node_i18n.h:34,
21:54:07                  from ../src/node_i18n.cc:43:
21:54:07 ../src/node_i18n.cc: In function 'bool node::i18n::InitializeICUDirectory(const std::string&, std::string*)':
21:54:07 ../deps/icu-small/source/common/unicode/urename.h:900:54: error: 'udata_setCommonData_75' was not declared in this scope; did you mean 'udata_setCommonData'?
21:54:07   900 | #define udata_setCommonData U_ICU_ENTRY_POINT_RENAME(udata_setCommonData)
21:54:07       |                                                      ^~~~~~~~~~~~~~~~~~~
21:54:07 ../deps/icu-small/source/common/unicode/uvernum.h:121:50: note: in definition of macro 'U_DEF_ICU_ENTRY_POINT_RENAME'
21:54:07   121 | #       define U_DEF_ICU_ENTRY_POINT_RENAME(x,y) x ## y
21:54:07       |                                                  ^
21:54:07 ../deps/icu-small/source/common/unicode/uvernum.h:123:47: note: in expansion of macro 'U_DEF2_ICU_ENTRY_POINT_RENAME'
21:54:07   123 | #       define U_ICU_ENTRY_POINT_RENAME(x)    U_DEF2_ICU_ENTRY_POINT_RENAME(x,U_ICU_VERSION_SUFFIX)
21:54:07       |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:54:07 ../deps/icu-small/source/common/unicode/urename.h:900:29: note: in expansion of macro 'U_ICU_ENTRY_POINT_RENAME'
21:54:07   900 | #define udata_setCommonData U_ICU_ENTRY_POINT_RENAME(udata_setCommonData)
21:54:07       |                             ^~~~~~~~~~~~~~~~~~~~~~~~
21:54:07 ../src/node_i18n.cc:555:5: note: in expansion of macro 'udata_setCommonData'
21:54:07   555 |     udata_setCommonData(&SMALL_ICUDATA_ENTRY_POINT, &status);
21:54:07       |     ^~~~~~~~~~~~~~~~~~~
21:54:07 make[2]: *** [libnode.target.mk:527: /home/iojs/build/workspace/node-test-commit-linux-containered/out/Release/obj.target/libnode/src/node_i18n.o] Error 1

which is coming from the #ifdef NODE_HAVE_SMALL_ICU block in

node/src/node_i18n.cc

Lines 550 to 556 in 8e4ec9f

bool InitializeICUDirectory(const std::string& path, std::string* error) {
UErrorCode status = U_ZERO_ERROR;
if (path.empty()) {
#ifdef NODE_HAVE_SMALL_ICU
// install the 'small' data.
udata_setCommonData(&SMALL_ICUDATA_ENTRY_POINT, &status);
#else // !NODE_HAVE_SMALL_ICU

Copy link
Member

@mertcanaltin mertcanaltin left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@lemire lemire left a comment

Choose a reason for hiding this comment

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

wow

@anonrig anonrig added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Oct 18, 2024
@nodejs-github-bot
Copy link
Collaborator

@richardlau richardlau added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Oct 18, 2024
@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 18, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 18, 2024
@nodejs-github-bot nodejs-github-bot merged commit 9f5000e into nodejs:main Oct 18, 2024
63 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 9f5000e

aduh95 pushed a commit that referenced this pull request Oct 19, 2024
PR-URL: #55156
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Richard Lau <rlau@redhat.com>
@aduh95 aduh95 mentioned this pull request Oct 24, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
PR-URL: nodejs#55156
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Richard Lau <rlau@redhat.com>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
PR-URL: nodejs#55156
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Richard Lau <rlau@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. i18n-api Issues and PRs related to the i18n implementation. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants