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

feat: build binaries with node@16 #2508

Merged
5 commits merged into from
Jan 24, 2022
Merged

feat: build binaries with node@16 #2508

5 commits merged into from
Jan 24, 2022

Conversation

ghost
Copy link

@ghost ghost commented Dec 31, 2021

The original goal of this PR was to only migrate our CI and dev environment to node@16. However, I've squashed #2507 into this as our binaries need to use the same Node version as the build environment. So the main visible change in this PR is now the fact that we ship our binaries with node@16.

To Do

Future PR

These steps can be done later as #2599 will change how we current build binaries.

  • Add assertions to binary build scripts to enforce node and pkg-fetch version match.
  • Ensure the same Node 16 version is used for any automation and documentation.
    • Document this for future upgrades.

Node 16 Binaries

Node 16 is the latest LTS. We already have a Node 16 test pipeline and binaries are tested via production/smoke tests.

Node 16 in Dev and CI

We are currently using Node 14 in development. Let's upgrade to Node 16 LTS before we get left behind.

One major benefit is that darwin/arm64 is only support from Node 16 and above.

Node 14 will still be supported in development to avoid suddenly breaking contributors' environments. We should give people some time to migrate.

Node 16 ships with npm@8. npm@8 is not supported on Node 10. It doesn't fail hard, but does print warnings about it.

npm WARN npm npm does not support Node.js v10.24.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

So we'll either need to:

  • Downgrade to npm@7 for Node 16
  • Wait until we've deprecated and removed Node 10 from our pipelines.
  • Go forward with the warnings and work towards removing Node 10.

This PR is going for the last approach so that we're not left behind. Our pipeline still works even with the warnings so it's a matter of removing Node 10 before it stops working.

Failing "Unexpected Error" Tests

Because npx ts-node now prints the deprecation warning on Node 10, I had to change the unexpected errors test to use node -r ts-node/registry so it doesn't pollute stderr assertions. This picked up a minor bug in our error handling module which is fixed in its own commit. The bug wasn't picked up previously because ts-node polluted the process under test with its own error handling, making the test invalid.

Considering various tools may want to hook into error handling and the complexity involved in enforcing the limit, I've removed the handler limit. We can re-introduce the limit when we encounter problems related to not having one.

@ghost ghost force-pushed the chore/dev-node16 branch 6 times, most recently from f1aa86b to 7ef6c94 Compare December 31, 2021 18:41
@ghost ghost marked this pull request as ready for review December 31, 2021 20:06
@ghost ghost requested review from a team as code owners December 31, 2021 20:06
@ghost ghost requested review from danlucian, jk05 and ekbsnyk December 31, 2021 20:06
@ghost ghost mentioned this pull request Jan 4, 2022
@ghost ghost changed the title chore: support node@16 for development feat: build binaries with node@16 Jan 4, 2022
Jahed Ahmed added 3 commits January 24, 2022 12:14
npm@8's only breaking change is a lack of node@10 support.
It worked before because tests were using "npx ts-node" which adds a handler too.
Because of how various tooling may hook into error events, enforcing a limit is too naive and may cause further unexpected failure scenarios. Until such a scenario causes us problems, it's safer not to handle it.
@ghost ghost force-pushed the chore/dev-node16 branch 3 times, most recently from 186bc96 to c46ac98 Compare January 24, 2022 13:11
Jahed Ahmed added 2 commits January 24, 2022 13:43
Need to also default to node@16 and npm@8 in dev/ci as dependencies may contain native modules (.node) which need to be installed using the same node version for compatibilty in binaries.
@ghost ghost merged commit 9cd65c6 into master Jan 24, 2022
@ghost ghost deleted the chore/dev-node16 branch January 24, 2022 14:12
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant