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 — [v20.x backport] src: move package_json_reader cache to c++ by joyeecheung · Pull Request #56590 · nodejs/node

Conversation

@joyeecheung

@joyeecheung joyeecheung commented Jan 13, 2025

Copy link
Copy Markdown
Member

This is a retry of #53502, which backports #50322 - retrying because it would help reducing conflicts for backporting require(esm) to 20.x

Sorry, something went wrong.

Uh oh!

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

JakobJingleheimer and patak-cat reacted with heart emoji
All reactions
  • ❤️ 2 reactions
anonrig and others added 3 commits January 13, 2025 17:56
@anonrig @joyeecheung
deps: add simdjson
7845d55
PR-URL: nodejs#50322
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
@anonrig @lemire @joyeecheung
src: move package resolver to c++
6e50795
Co-authored-by: Daniel Lemire <[email protected]>
PR-URL: nodejs#50322
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
@anonrig @joyeecheung
module: merge config with package_json_reader
1b5abae
PR-URL: nodejs#50322
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
@nodejs-github-bot

nodejs-github-bot commented Jan 13, 2025

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/actions
  • @nodejs/gyp
  • @nodejs/loaders
  • @nodejs/security-wg
  • @nodejs/startup
  • @nodejs/tsc
  • @nodejs/url
All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. v20.x labels Jan 13, 2025
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 13, 2025
@marco-ippolito

marco-ippolito commented Jan 13, 2025

Copy link
Copy Markdown
Member

Ping @nodejs/releasers for visibility as this the backport of a semver minor into an LTS maintainance.

All reactions

Sorry, something went wrong.

Uh oh!

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

@joyeecheung

joyeecheung commented Jan 13, 2025

Copy link
Copy Markdown
Member Author

#50322 is only semver-minor because it adds a new dependency, by the way, which I don't think we expose, so it's technically internal.

anonrig 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.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 13, 2025
@nodejs-github-bot

nodejs-github-bot commented Jan 13, 2025

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

anonrig
anonrig approved these changes Jan 13, 2025
View reviewed changes
JakobJingleheimer
JakobJingleheimer approved these changes Jan 13, 2025
View reviewed changes
Comment thread lib/internal/modules/run_main.js Resolved

Uh oh!

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

Comment thread test/fixtures/node_modules/pkgexports-number/package.json Resolved

Uh oh!

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

@joyeecheung

joyeecheung commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

simdjson cannot compile on fedora-last-latest-x64 https://ci.nodejs.org/job/node-test-commit-linux/62561/nodes=fedora-last-latest-x64/console

19:26:53 ../deps/simdjson/simdjson.cpp:16637:49: error: inlining failed in call to ‘always_inline’ ‘simdjson::error_code simdjson::fallback::{anonymous}::stage2::json_iterator::walk_document(V&) noexcept [with bool STREAMING = false; V = simdjson::fallback::{anonymous}::stage2::tape_builder]’: target specific option mismatch
19:26:53 16637 | simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
19:26:53       |                                                 ^~~~~~~~~~~~~
19:26:53 ../deps/simdjson/simdjson.cpp:17074:39: note: called from here
19:26:53 17074 |   return iter.walk_document<STREAMING>(builder);
19:26:53       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
19:26:53 ../deps/simdjson/simdjson.cpp:16637:49: error: inlining failed in call to ‘always_inline’ ‘simdjson::error_code simdjson::fallback::{anonymous}::stage2::json_iterator::walk_document(V&) noexcept [with bool STREAMING = false; V = simdjson::fallback::{anonymous}::stage2::tape_builder]’: target specific option mismatch
19:26:53 16637 | simdjson_warn_unused simdjson_inline error_code json_iterator::walk_document(V &visitor) noexcept {
19:26:53       |                                                 ^~~~~~~~~~~~~
19:26:53 ../deps/simdjson/simdjson.cpp:17074:39: note: called from here
19:26:53 17074 |   return iter.walk_document<STREAMING>(builder);
19:26:53       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

I think this is likely due to the fact that we are still using gnu++17 for v20.x. I am not particularly confident in changing it to gnu++20 without breaking ABI. Another possible fix is to pretend that there's no optimization for GCC and not use always_inline, if that doesn't work, I feel that the best course of action is to not bother backporting this and just rewrite other commits to deal with the package json reader conflicts instead.

marco-ippolito and richardlau reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@anonrig

anonrig commented Jan 14, 2025

Copy link
Copy Markdown
Member

cc @lemire can you look?

All reactions

Sorry, something went wrong.

Uh oh!

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

joyeecheung added 2 commits January 14, 2025 16:40
@joyeecheung
fixup! deps: add simdjson
f78b464
@joyeecheung
fixup! src: move package resolver to c++
5f9c573
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 14, 2025
@joyeecheung

joyeecheung commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

Using inline instead of forcing it to always_inline in specific places seems to at least fix it for test-digitalocean-fedora40-x64-1, there could be a gcc bug somewhere but then we aren't in a position to update the toolchain, so it's better to just patch the source.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 14, 2025
@nodejs-github-bot

nodejs-github-bot commented Jan 14, 2025

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@joyeecheung

joyeecheung commented Jan 15, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

AIX is failing with


  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected

    Comparison {
  +   code: 'ERR_INVALID_PACKAGE_CONFIG',
  +   message: 'Invalid package config /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/packages/is-dir/package.json.'
  -   code: 'MODULE_NOT_FOUND',
  -   message: /Cannot find module '\.\.\/fixtures\/packages\/is-dir'/
    }
      at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/parallel/test-module-loading-error.js:87:8)
      at Module._compile (node:internal/modules/cjs/loader:1468:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1547:10)
      at Module.load (node:internal/modules/cjs/loader:1287:32)
      at Module._load (node:internal/modules/cjs/loader:1103:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:180:12)
      at node:internal/main/run_main_module:28:49

I think that's probably caused by backporting #53502 without backporting #48605 and the test changes should just be reverted back to be AIX-specific again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@richardlau

richardlau commented Jan 15, 2025

Copy link
Copy Markdown
Member

AIX is failing with

I think that's probably caused by backporting #53502 without backporting #48605 and the test changes should just be reverted back to be non-AIX-specific again.

#48605 is semver-major. #48477 had to include some code paths to not break AIX -- I think they're missing from this backport (based on what #48605 removed -- I would expect to see the removed code from that PR in this backport).

The test failure is coming from an earlier, unchanged line in the test case, which implies that as it stand this backport would be breaking.

All reactions

Sorry, something went wrong.

Uh oh!

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

@joyeecheung

joyeecheung commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

Indeed, it seems #50322 was assuming that it could depend on code that already broke the special case for AIX and to backport it we need to bring that special case back. I am not quite sure how to rewrite the PR to bring back that special case, however... @anonrig @nodejs/platform-aix anyone knows?

All reactions

Sorry, something went wrong.

Uh oh!

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

@joyeecheung

joyeecheung commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

Actually looking at libuv/libuv#2025 I think I know now - just checks if it's a directory for AIX and return exist: false in that case.

richardlau 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.

@joyeecheung
fixup! src: move package resolver to c++
7c94000
@joyeecheung
joyeecheung force-pushed the backport-json-reader branch from aff90b3 to 7c94000 Compare January 15, 2025 22:32
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 15, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 15, 2025
@anonrig

anonrig commented Jan 16, 2025

Copy link
Copy Markdown
Member

Actually looking at libuv/libuv#2025 I think I know now - just checks if it's a directory for AIX and return exist: false in that case.

I just had the chance to look. It seems your last commit is the correct approach. Thank you for following up and backporting this @joyeecheung

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 Jan 21, 2025

Copy link
Copy Markdown
Collaborator

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

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 Jan 21, 2025

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@joyeecheung

joyeecheung commented Jan 21, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Only parallel/test-buffer-tostring-range fails on SmartOS, though it has been failing on v20.x-staging for some time...for example, yesterday's daily build on v20.x-staging: https://ci.nodejs.org/job/node-test-commit-smartos/58708/ and a month ago it was probably also failing there https://ci.nodejs.org/job/node-daily-v20.x-staging/414/ (SmartOS data was already cleaned up)

(By the way the state of v20.x-staging's CI doesn't look great either https://ci.nodejs.org/job/node-daily-v20.x-staging/445/)

All reactions

Sorry, something went wrong.

Uh oh!

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

@anonrig

anonrig commented Jan 22, 2025

Copy link
Copy Markdown
Member

Only parallel/test-buffer-tostring-range fails on SmartOS, though it has been failing on v20.x-staging for some time...for example, yesterday's daily build on v20.x-staging: https://ci.nodejs.org/job/node-test-commit-smartos/58708/ and a month ago it was probably also failing there https://ci.nodejs.org/job/node-daily-v20.x-staging/414/ (SmartOS data was already cleaned up)

(By the way the state of v20.x-staging's CI doesn't look great either https://ci.nodejs.org/job/node-daily-v20.x-staging/445/)

@nodejs/platform-smartos

All reactions

Sorry, something went wrong.

Uh oh!

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

@anonrig anonrig mentioned this pull request Jan 22, 2025
Node.js Technical Steering Committee (TSC) Meeting 2025-01-22 nodejs/TSC#1676
Closed
@jclulow

jclulow commented Jan 22, 2025

Copy link
Copy Markdown

Thanks for the heads up! I'm trying to create an issue in nodejs/node to specifically track looking into parallel.test-buffer-tostring-range failures on illumos, and assign myself and @bahamat, but for whatever reason I don't seem to able to use either Assignees or Labels in the UI, despite being a member of the @nodejs/platform-smartos group. How does one get that ability?

All reactions

Sorry, something went wrong.

Uh oh!

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

@marco-ippolito
marco-ippolito force-pushed the v20.x-staging branch from 983a7d4 to bc445a0 Compare January 22, 2025 11:20
@marco-ippolito

marco-ippolito commented Jan 22, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I'd like to include these commits in the release, we might need to include a fix for smartos but thats independent from this PR, so I'll go ahead and backport it.

All reactions

Sorry, something went wrong.

Uh oh!

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

marco-ippolito pushed a commit that referenced this pull request Jan 22, 2025
@anonrig @marco-ippolito
deps: add simdjson
e954ef6
PR-URL: #50322
Backport-PR-URL: #56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jan 22, 2025
@anonrig @lemire @marco-ippolito
src: move package resolver to c++
eb5f757
Co-authored-by: Daniel Lemire <[email protected]>
PR-URL: #50322
Backport-PR-URL: #56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jan 22, 2025
@anonrig @marco-ippolito
module: merge config with package_json_reader
5bf61c5
PR-URL: #50322
Backport-PR-URL: #56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
@marco-ippolito

This comment was marked as outdated.

Sign in to view
@marco-ippolito marco-ippolito closed this Jan 22, 2025
@joyeecheung joyeecheung mentioned this pull request Jan 22, 2025
module: eliminate performance cost of ESM syntax detection for CommonJS entry points #52093
Merged
@marco-ippolito marco-ippolito mentioned this pull request Jan 23, 2025
v20.18.3 proposal #56699
Merged
marco-ippolito pushed a commit that referenced this pull request Jan 23, 2025
@anonrig @marco-ippolito
deps: add simdjson
b83675f
PR-URL: #50322
Backport-PR-URL: #56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jan 23, 2025
@anonrig @lemire @marco-ippolito
src: move package resolver to c++
9e3ed9d
Co-authored-by: Daniel Lemire <[email protected]>
PR-URL: #50322
Backport-PR-URL: #56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jan 23, 2025
@anonrig @marco-ippolito
module: merge config with package_json_reader
fa4ca5d
PR-URL: #50322
Backport-PR-URL: #56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
@marco-ippolito marco-ippolito reopened this Jan 23, 2025
@marco-ippolito

marco-ippolito commented Jan 23, 2025

Copy link
Copy Markdown
Member

reopening as I'm going to delay this backport and remove it from staging

All reactions

Sorry, something went wrong.

Uh oh!

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

@marco-ippolito
marco-ippolito force-pushed the v20.x-staging branch from 416c658 to cc7d1a7 Compare January 23, 2025 15:37
joyeecheung pushed a commit to joyeecheung/node that referenced this pull request Jan 23, 2025
@anonrig @joyeecheung
deps: add simdjson
94fe872
PR-URL: nodejs#50322
Backport-PR-URL: nodejs#56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
joyeecheung pushed a commit to joyeecheung/node that referenced this pull request Jan 23, 2025
@anonrig @lemire @joyeecheung
src: move package resolver to c++
50ad869
Co-authored-by: Daniel Lemire <[email protected]>
PR-URL: nodejs#50322
Backport-PR-URL: nodejs#56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
joyeecheung pushed a commit to joyeecheung/node that referenced this pull request Jan 23, 2025
@anonrig @joyeecheung
module: merge config with package_json_reader
40034af
PR-URL: nodejs#50322
Backport-PR-URL: nodejs#56590
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
@joyeecheung

joyeecheung commented Jan 23, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Actually it was good that this is not going into v20.x alone, because the original PR caused some regressions and the fixes should also be backported:

#51269
#55777
#51097

-> #53294 this then leads to backporting #52135 which also caused a series of regressions, one of them fixed by #54224 which is semver-major. Another seems to be still present on the main branch #54367

I am now in a bind - if this is not backported, then all the subsequent commits related to require(esm) would be very prone to conflicts because of the scale of changes introduced by the original PR. But if this is backported it feels very hard to track down all the regressions and their fixes (I am also not very confident that they are all already fixed on main?)

All reactions

Sorry, something went wrong.

Uh oh!

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

@marco-ippolito
marco-ippolito force-pushed the v20.x-staging branch from cc7d1a7 to f78508c Compare January 24, 2025 21:19
@joyeecheung joyeecheung mentioned this pull request Jan 24, 2025
[v20.x] backport unflagging of require(esm), part 1 (of 4?) #56730
Closed
@joyeecheung

joyeecheung commented Jan 24, 2025

Copy link
Copy Markdown
Member Author

I looked into the regressions caused by the original PR and the regressions caused by the commits that the fixes depend on, and I don't feel confident enough at this point to backport all of them to v20.x without destabilizing v20.x (it seems some regressions in the chain are still unfixed on the main branch?). So I'll go with another route of backporting as few commits as possible for require(esm) as that seems less risky.

bjohansebas reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@joyeecheung joyeecheung closed this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JakobJingleheimer JakobJingleheimer JakobJingleheimer approved these changes
@anonrig anonrig anonrig approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

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.

7 participants

@joyeecheung @nodejs-github-bot @marco-ippolito @anonrig @richardlau @jclulow @JakobJingleheimer
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.