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

Support Node 18 #6489

Closed
mhofman opened this issue Oct 21, 2022 · 15 comments
Closed

Support Node 18 #6489

mhofman opened this issue Oct 21, 2022 · 15 comments
Labels
enhancement New feature or request tooling repo-wide infrastructure vaults_triage DO NOT USE

Comments

@mhofman
Copy link
Member

mhofman commented Oct 21, 2022

What is the Problem Being Solved?

Node 18 is reaching LTS imminently. We should make sure everything works when using node 18.

Description of the Design

Setup a dev env with node 18 and see what breaks
Update CI to also run against node 18.

Security Considerations

None

Test Plan

Yes

@mhofman mhofman added enhancement New feature or request tooling repo-wide infrastructure labels Oct 21, 2022
@sigv
Copy link
Contributor

sigv commented Oct 29, 2022

When trying to run the pismoA tag with Node.js 18.x we are observing an initialization error:

launch-chain: Launching SwingSet kernel
portHandler threw (Error#1)
Error#1: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
  at async Promise.all (index 0)
  at async Promise.all (index 6)
  at async allValues (packages/SwingSet/src/controller/initializeSwingset.js:29:30)
  at async buildVatAndDeviceBundles (packages/SwingSet/src/controller/initializeSwingset.js:54:19)
  at async initializeSwingset (packages/SwingSet/src/controller/initializeSwingset.js:336:25)
  at async ensureSwingsetInitialized (packages/cosmic-swingset/src/launch-chain.js:113:5)
  at async buildSwingset (packages/cosmic-swingset/src/launch-chain.js:115:3)
  at async launch (packages/cosmic-swingset/src/launch-chain.js:264:52)
  at async launchAndInitializeSwingSet (packages/cosmic-swingset/src/chain-main.js:412:15)
  at async toSwingSet (packages/cosmic-swingset/src/chain-main.js:461:22)
  at async portHandlers.<computed> (packages/cosmic-swingset/src/chain-main.js:159:16)
Cannot initialize Controller Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
Error: exit status 1

This seems to be caused by mozilla/source-map#454, fixed with source-map@0.7.4.
source-map@0.7.3 is in place in repository:

$ npm ls source-map
@agoric/sdk@ /home/agoric/source/agoric-upgrade-8
└─┬ @agoric/cosmic-swingset@0.39.2 -> ./packages/cosmic-swingset
  ├─┬ @agoric/deploy-script-support@0.9.4 -> ./packages/deploy-script-support
  │ └─┬ @endo/bundle-source@2.3.1
  │   ├─┬ @agoric/babel-generator@7.17.6
  │   │ └── source-map@0.5.7
  │   └── source-map@0.7.3
  ├─┬ @agoric/xsnap@0.13.2 -> ./packages/xsnap
  │ └─┬ rollup-plugin-terser@5.3.1
  │   └─┬ terser@4.8.0
  │     ├─┬ source-map-support@0.5.21
  │     │ └── source-map@0.6.1 deduped
  │     └── source-map@0.6.1
  ├─┬ agoric@0.18.2 -> ./packages/agoric-cli
  │ └─┬ dd-trace@3.3.0
  │   └─┬ @datadog/pprof@1.0.2
  │     └── source-map@0.7.3
  └─┬ c8@7.11.0
    └─┬ v8-to-istanbul@8.1.1
      └── source-map@0.7.3

@mhofman
Copy link
Member Author

mhofman commented Oct 29, 2022

Thanks for the report. We had an internal report of a similar error. For now we recommend you use Node 16 LTS with pismoA. We may consider an intermediary patch release if we can guarantee the update is compatible with the current release.

@mhofman
Copy link
Member Author

mhofman commented Oct 31, 2022

@sigv according to the upgrade instructions, please use Node 16. We will not be supporting Node 18 for pismoA.

@sigv
Copy link
Contributor

sigv commented Oct 31, 2022

@sigv according to the upgrade instructions, please use Node 16. We will not be supporting Node 18 for pismoA.

Understandable. Looking forward to having Current LTS supported on the next version then 🤞🏻

@dckc

This comment was marked as duplicate.

@erights

This comment was marked as duplicate.

@erights
Copy link
Member

erights commented Nov 9, 2022

Curiously, in the experiment at #6549 , when I locally run the same

yarn test test/swingsetTests/makeKind/test-makeKind.js

under Node v18, it works.

sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 11, 2022
The `source-map@0.7.4` update is important for enabling Node.js v18
compatibility. Older versions use a `typeof fetch === 'function'`
check to enable browser-specific behavior. With this release however,
the browser check is moved to whether `window` is defined and matches
`this` value at check time. Node.js 18 has a `fetch` function, so
older `source-map` versions incorrectly flag it as 'browser'. None
of Node.js versions have a `this === window` situation going on.

This is a change on the path to Node.js 18 compatibility route,
in anticipation of Agoric#6489 offering official support down the line.
@sigv
Copy link
Contributor

sigv commented Nov 13, 2022

With #6560 (source-map@0.7.4) the mentioned test case from packages/zoe succeeds as well.

yarn run v1.22.19
$ ava --verbose test/swingsetTests/makeKind/test-makeKind.js

bundling: 6.556s kernel, 0.171s contracts, 1.731s vats, 8.458s total
  ✔ defineKind swingset (4.3s)
  ─

  1 test passed
Done in 14.00s.

sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 14, 2022
The `source-map@0.7.4` update is important for enabling Node.js v18
compatibility. Older versions use a `typeof fetch === 'function'`
check to enable browser-specific behavior. With this release however,
the browser check is moved to whether `window` is defined and matches
`this` value at check time. Node.js 18 has a `fetch` function, so
older `source-map` versions incorrectly flag it as 'browser'. None
of Node.js versions have a `this === window` situation going on.

This is a change on the path to Node.js 18 compatibility route,
in anticipation of Agoric#6489 offering official support down the line.
mergify bot pushed a commit that referenced this issue Nov 14, 2022
The `source-map@0.7.4` update is important for enabling Node.js v18
compatibility. Older versions use a `typeof fetch === 'function'`
check to enable browser-specific behavior. With this release however,
the browser check is moved to whether `window` is defined and matches
`this` value at check time. Node.js 18 has a `fetch` function, so
older `source-map` versions incorrectly flag it as 'browser'. None
of Node.js versions have a `this === window` situation going on.

This is a change on the path to Node.js 18 compatibility route,
in anticipation of #6489 offering official support down the line.
@erights
Copy link
Member

erights commented Nov 17, 2022

@mhofman
Now that #6560 has been merged, can we close this issue?

@mhofman
Copy link
Member Author

mhofman commented Nov 17, 2022

We need to add CI tests to ensure continuous Node 18 compatibility (and maybe a round of manual end to end testing on node 18)

sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 28, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
@sigv
Copy link
Contributor

sigv commented Nov 28, 2022

I understand this is of fairly low priority to the team, so to keep the ball moving #6599 is available with the test suite enabling Node.js 18.x. Further manual testing can be conducted at a later time as well.

sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 29, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 30, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 30, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 30, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
sigv added a commit to sigv/agoric-sdk that referenced this issue Nov 30, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
sigv added a commit to sigv/agoric-sdk that referenced this issue Dec 1, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
turadg pushed a commit to sigv/agoric-sdk that referenced this issue Dec 2, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of Agoric#6489, however manual testing of
compatibility should be conducted further before that.
@sigv
Copy link
Contributor

sigv commented Dec 2, 2022

@mhofman, do you prefer to update packages/deployment/Dockerfile.sdk to also build with node:18-bullseye instead of current node:16-buster?

That should be all the Node.js framework changes for pipelines/CI (until Node.js 14 is dropped off in roughly 5 months). Manual testing can be carried out to ensure compatibility, as mentioned in previous commit.

@mhofman
Copy link
Member Author

mhofman commented Dec 2, 2022

I think we should keep the recommended / default to 16 right now. This IPv6 default in 18 has me worried about subtle breakage, especially with Docker.

@sigv
Copy link
Contributor

sigv commented Dec 2, 2022

Makes sense. Then it's just a question of running manual testing before deciding to officially claim Node.js 18 as compatible. Again - thank you! 🤞🏻

gibson042 pushed a commit that referenced this issue Dec 5, 2022
Node.js 14.x is retained as the default, just as it was before,
considering it is Maintenance LTS set to EOL next year (2023-04-30).

This change adds Node.js 18.x in all the places where workflows
previously were building with Node.js 16.x - either as addition
to it where multiple version are provided, or as an upgrade where
only one version is used.

This finishes up the bulk of #6489, however manual testing of
compatibility should be conducted further before that.
@otoole-brendan otoole-brendan added the vaults_triage DO NOT USE label Jan 3, 2023
@dckc
Copy link
Member

dckc commented Apr 27, 2023

fixed in #7073 / 711059c

@dckc dckc closed this as completed Apr 27, 2023
mhofman pushed a commit that referenced this issue Jun 6, 2023
The `source-map@0.7.4` update is important for enabling Node.js v18
compatibility. Older versions use a `typeof fetch === 'function'`
check to enable browser-specific behavior. With this release however,
the browser check is moved to whether `window` is defined and matches
`this` value at check time. Node.js 18 has a `fetch` function, so
older `source-map` versions incorrectly flag it as 'browser'. None
of Node.js versions have a `this === window` situation going on.

This is a change on the path to Node.js 18 compatibility route,
in anticipation of #6489 offering official support down the line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tooling repo-wide infrastructure vaults_triage DO NOT USE
Projects
None yet
Development

No branches or pull requests

6 participants