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 and platform requirements for Node.js 20 #47067

Closed
targos opened this issue Mar 13, 2023 · 16 comments
Closed

Build and platform requirements for Node.js 20 #47067

targos opened this issue Mar 13, 2023 · 16 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@targos
Copy link
Member

targos commented Mar 13, 2023

As discussed in the last Release WG meeting, we should soon agree on the set of platforms and build toolchains supported by v20.0.0.

Current tables are in https://github.com/nodejs/node/blob/c2e4b1fa9ad0b744616c4e4c13a5017772a630c4/BUILDING.md#supported-platforms

Main topics:

@nodejs/tsc @nodejs/build @nodejs/releasers

@targos targos added the build Issues and PRs related to build files or the CI. label Mar 13, 2023
@richardlau
Copy link
Member

For completeness, we've already landed #46806 to move gcc based builds to gcc 10.

@mhdawson
Copy link
Member

@UlisesGascon can you look at make recommendations for MacOS and Xcode version?

@UlisesGascon
Copy link
Member

Sure, I will do a little research 👍

@targos
Copy link
Member Author

targos commented Mar 18, 2023

For reference, v20.x EOL date will be 2026-04-30

@UlisesGascon
Copy link
Member

UlisesGascon commented Mar 18, 2023

Quick conclusions

The minimum version of MacOS required for our purposes would be MacOS 11.7.4 (released in February 2023) or any version of MacOS 11.x. However, MacOS 11.x is already being phased out and is speculated to reach its end of life (EOL) this year. This means that we will need to carry MacOS 11.x for an additional year in our infrastructure once Node 18 reaches its EOL (from April 30, 2025, to April 30, 2026).

On the other hand, we could support MacOS 12.x as the minimum version, as it is currently the minimum active version that Apple has at the time of our initial release for Node 20. This would help us to purge MacOS legacy versions (10.x and 11.x) from our infrastructure by April 30, 2025.

Regarding Xcode versions

Regarding C++ version

I have checked the C++20 language features, and the minimum version required is 8. Checking Homebrew, it seems that we can install it on Big Sur (11.x) and Monterey (12.x).

It would be great to run an experiment and check the compatibility of gcc, MacOS, and Xcode versions together before making a decision. I am not very confident just by checking the documentation.

Useful links

Side Note

I will create a separate issue in the Build Repo to discuss the infrastructure changes required to add machines for (Intel and ARM) for MacOS 12.x and 13.x. This will avoid polluting this conversation, which is also related to nodejs/build#3087.

Related issues

@targos
Copy link
Member Author

targos commented Mar 22, 2023

I have checked the C++20 language features, and the minimum version required is 8. Checking Homebrew, it seems that we can install it on Big Sur (11.x) and Monterey (12.x).

We don't support building with GCC on macOS. Only the XCode/Clang version matters.

@UlisesGascon
Copy link
Member

Thanks for the clarification, @targos!

Maybe this provide a better context, based on Wikipedia | Xcode -> Xcode 11.0 - 14.x (since SwiftUI framework)):

MacOS Xcode clang LLVM Release Notes
11.0 12.5 12.0.5 (clang-1205.0.22.9) 11.1.0 Release Notes
11.7.4 13.2 13.0.0 (clang-1300.0.29.30) 12.0.0 Release Notes
12.0 13.3 13.1.6 (clang-1316.0.21.2) 13.0.0 Release Notes

I believe that this table: C++20 core language features might help us to determine the minimum clang version that we need to support Node 20 based on the C++20 features that we are using.

I am not able to determine, but maybe you can help me 🙏

@targos
Copy link
Member Author

targos commented Mar 22, 2023

Looks like Apple Clang 13.1.6 is necessary for some features. I can't say if they are important.

@joaocgreis
Copy link
Member

Windows-related, the main thing we're looking forward to in v20 is support for ARM64 Windows. This will hopefully happen in v19, but would be great to see it stable and without issues in v20.

About Windows and VS, we have to keep using the current versions, mainly because we don't have anything newer in our infra that can be used now. @StefanStojanovic will start working on adding newer versions soon.

For the release machine:

  • Windows 2012R2 will be EOL this October so we'll have to replace it out of semver boundary, but this is not an issue on Windows.
  • VS2019 will be EOL in 2029 so while it's not optimal it's not a big issue. If needed we can replace it as well (we've done that for v6.8.0).

For running Node we support Windows 10 and 2016. For building addons we support VS2017.

I'm not looking forward to dropping x86, but won't object to it either.

@targos
Copy link
Member Author

targos commented Mar 30, 2023

@joaocgreis Thanks. What about C++20? Does VS2019 have decent enough support?

I see an error in #45427 (comment) that isn't reproduced with VS2022.

@gengjiawen
Copy link
Member

@joaocgreis Thanks. What about C++20? Does VS2019 have decent enough support?

I see an error in #45427 (comment) that isn't reproduced with VS2022.

Give me my past experience, only support VS2022 is the best option for us.

@richardlau
Copy link
Member

I've opened a PR to update our armv7l cross compiler: rvagg/rpi-newer-crosstools#2.

Unfortunately it looks like that, unlike glibc, the libstdc++ version is closely tied to the gcc version and binaries built with gcc 10 (libstdc++.so.6.0.28) will not run on Debian 10 (libstdc++.so.6.0.25). We don't have this problem with the binaries compiled on RHEL 8 and gcc-toolset-10 but unfortunately RHEL do not offer an armv7l distro (which is why we are still cross compiling for armv7l).

@targos
Copy link
Member Author

targos commented Mar 31, 2023

/cc @RafaelGSS This issue should be resolved before we lock v20.x for the release.

@joaocgreis
Copy link
Member

@targos I see only a handful of fixes (?) that are only available on 2022: https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170

The version of VS we use to compile node is not something we need to lock, we can change it anytime. For now, we simply don't have the machines in place to move to VS2022, but we will in the next few months (weeks if all goes well).

nodejs-github-bot pushed a commit that referenced this issue Apr 3, 2023
Update the table describing the platform and toolchain used to build
the official Node.js 20 binaries.

PR-URL: #47352
Refs: https://github.com/orgs/nodejs/discussions/45892
Refs: #47067
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
richardlau added a commit to nodejs/build that referenced this issue Apr 3, 2023
Update RHEL 8 container used for cross compiling for armv7.
Add logic to select gcc 10 toolchain for Node.js 20 onwards.
Install gcc-toolset-10 host compiler.

Refs: rvagg/rpi-newer-crosstools#2
Refs: https://github.com/orgs/nodejs/discussions/45892
Refs: nodejs/node#47067
targos pushed a commit to targos/nodejs-build that referenced this issue Apr 7, 2023
Update RHEL 8 container used for cross compiling for armv7.
Add logic to select gcc 10 toolchain for Node.js 20 onwards.
Install gcc-toolset-10 host compiler.

Refs: rvagg/rpi-newer-crosstools#2
Refs: https://github.com/orgs/nodejs/discussions/45892
Refs: nodejs/node#47067
targos added a commit to targos/node that referenced this issue Apr 13, 2023
nodejs-github-bot pushed a commit that referenced this issue Apr 14, 2023
Refs: #47067
PR-URL: #47546
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
targos added a commit that referenced this issue May 2, 2023
Refs: #47067
PR-URL: #47546
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
@UlisesGascon
Copy link
Member

@targos, can we close this issue? I think all the requirements were already defined 🤔

@targos
Copy link
Member Author

targos commented May 7, 2023

Node 20 is out so even if we forgot about something, it would be too late.

@targos targos closed this as completed May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

6 participants