From f2f81d133f29a70130bc206fb297d5bd878d5091 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:29:40 -0500 Subject: [PATCH 1/2] deps: V8: cherry-pick 8ec2651fbdd8 Original commit message: fix: EmbeddedTargetOs on IBM i with Python 3.9 For some context, Python 3.9 on IBM i returns "os400" for sys.platform instead of "aix". We used to build with Python 3.6 which returned "aix" as the platform When attempting to build Node.js with python 3.9 on IBM i we run into a build error. Ref: https://github.com/nodejs/node/pull/48056 Ref: https://github.com/nodejs/node/pull/48056#issuecomment-1553719508 I'm not quite sure where target_os is being passed down to the function ToEmbeddedTargetOs. It seems as though target_os is being generated from sys.platform or similar call from python as we started running into this issue after building with Python 3.9. This PR supersedes initial changes proposed in: https://chromium-review.googlesource.com/c/v8/v8/+/4259330 This PR contains the minimal changes to successfully build Node.js (builds v8 as an internal dep) on IBM i with Python 3.9. Change-Id: I32d43197bce994a72a0d85091e91f80eeea4482d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4846413 Commit-Queue: Jakob Linke Reviewed-by: Michael Achenbach Reviewed-by: Jakob Linke Cr-Commit-Position: refs/heads/main@{#89981} Refs: https://github.com/v8/v8/commit/8ec2651fbdd8adf054397ee832031c9ff7aa16ac --- .../snapshot/embedded/platform-embedded-file-writer-base.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc index e0602edc7e1c6a..e4ca7bfdacb11c 100644 --- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc +++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-base.cc @@ -130,7 +130,8 @@ EmbeddedTargetOs ToEmbeddedTargetOs(const char* s) { } std::string string(s); - if (string == "aix") { + // Python 3.9+ on IBM i returns os400 as sys.platform instead of aix + if (string == "aix" || string == "os400") { return EmbeddedTargetOs::kAIX; } else if (string == "chromeos") { return EmbeddedTargetOs::kChromeOS; From 6a3bcee863412e64acf80171dd26254935d53da4 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:13:22 -0500 Subject: [PATCH 2/2] fixup! deps: V8: cherry-pick 8ec2651fbdd8 --- common.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 14f05fcf9ccb8d..909d09934a1b25 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.18', + 'v8_embedder_string': '-node.19', ##### V8 defaults for Node.js #####