Skip to content

[v20.x] deps: V8: backport build fixes for Xcode 16.3 #58342

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

Closed
wants to merge 3 commits into from

Conversation

Bo98
Copy link

@Bo98 Bo98 commented May 15, 2025

Node 20.19.2 currently fails to build from source since Xcode 16.3 (and LLVM Clang 18). This pull request backports three v8 commits that fix the issue:

All of the above commits are already included in Node 22 and later, hence the 20.x-only PR.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. v8 engine Issues and PRs related to the V8 dependency. labels May 15, 2025
@marco-ippolito
Copy link
Member

marco-ippolito commented May 16, 2025

I confirm this PR fixes the compilation on my machine:

marcoippolito@marcos-MacBook-Pro-3 node % clang -v
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.4.0
Thread model: posix

Currently the CI for v20.x is broken so errors are unrelated

@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 4, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 4, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Bo98
Copy link
Author

Bo98 commented Jun 4, 2025

CI probably needs a cherry-pick of 996a774

@nodejs-github-bot
Copy link
Collaborator

@Bo98
Copy link
Author

Bo98 commented Jun 5, 2025

(and 8287f67 - I initially missed that there's two tests failing)

@marco-ippolito
Copy link
Member

marco-ippolito commented Jun 5, 2025

please rebase from v20.x-staging

zmodem and others added 3 commits June 5, 2025 08:07
Original commit message:

    [zlib][build] Remove fdopen #defines in zutil.h.

    The latest version of Clang changed what macros it predefines on Apple
    targets, causing errors about predefined macros in zlib.

    See:
    madler/zlib@4bd9a71

    Bug: 1519899
    Change-Id: Ie75ef4078f2c86d89ba6c036ddd13e768a40ccbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237020
    Reviewed-by: Adenilson Cavalcanti <[email protected]>
    Commit-Queue: Hans Wennborg <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1253252}
    NOKEYCHECK=True
    GitOrigin-RevId: 2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9

Refs: https://chromium.googlesource.com/chromium/src/third_party/zlib/+/646b7f569718921d7d4b5b8e22572ff6c76f2596
Original commit message:

    Define UChar as char16_t

    We used to have UChar defined as uint16_t which does not go along
    with STL these days if you try to have an std::basic_string<> of it,
    as there are no standard std::char_traits<> specialization for uint16_t.

    This switches UChar to char16_t where practical, introducing a few
    compatibility shims to keep CL size small, as (1) this would likely
    have to be back-ported and (2) crdtp extensively uses uint16_t for
    wide chars.

    Bug: b:296390693
    Change-Id: I66a32d8f0050915225b187de56896c26dd76163d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4789966
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Commit-Queue: Jaroslav Sevcik <[email protected]>
    Auto-Submit: Andrey Kosyakov <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89559}

Refs: v8/v8@182d9c0
Original commit message:

    Fix build issue, remove unneeded include uchar.h.

    Follow the conversation on:
    https://groups.google.com/g/v8-dev/c/nsbshwlmP3c.

    The `uchar.h` include is not necessary.
    It was added to get the definition of char16_t but that's an intrinsic
    type in C++.

    Change-Id: I0aaa11dba0be3ccad15b9e421f8bae71450d443b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4823404
    Reviewed-by: Omer Katz <[email protected]>
    Commit-Queue: Eric Leese <[email protected]>
    Reviewed-by: Eric Leese <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89787}

Refs: v8/v8@1a3ecc2
PR-URL: nodejs#49639
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
@Bo98 Bo98 force-pushed the v20.x-xcode16.3 branch from 42c8a36 to 7b59afa Compare June 5, 2025 07:07
@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 5, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 5, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    [zlib][build] Remove fdopen #defines in zutil.h.

    The latest version of Clang changed what macros it predefines on Apple
    targets, causing errors about predefined macros in zlib.

    See:
    madler/zlib@4bd9a71

    Bug: 1519899
    Change-Id: Ie75ef4078f2c86d89ba6c036ddd13e768a40ccbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237020
    Reviewed-by: Adenilson Cavalcanti <[email protected]>
    Commit-Queue: Hans Wennborg <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1253252}
    NOKEYCHECK=True
    GitOrigin-RevId: 2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9

Refs: https://chromium.googlesource.com/chromium/src/third_party/zlib/+/646b7f569718921d7d4b5b8e22572ff6c76f2596
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    Define UChar as char16_t

    We used to have UChar defined as uint16_t which does not go along
    with STL these days if you try to have an std::basic_string<> of it,
    as there are no standard std::char_traits<> specialization for uint16_t.

    This switches UChar to char16_t where practical, introducing a few
    compatibility shims to keep CL size small, as (1) this would likely
    have to be back-ported and (2) crdtp extensively uses uint16_t for
    wide chars.

    Bug: b:296390693
    Change-Id: I66a32d8f0050915225b187de56896c26dd76163d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4789966
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Commit-Queue: Jaroslav Sevcik <[email protected]>
    Auto-Submit: Andrey Kosyakov <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89559}

Refs: v8/v8@182d9c0
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    Fix build issue, remove unneeded include uchar.h.

    Follow the conversation on:
    https://groups.google.com/g/v8-dev/c/nsbshwlmP3c.

    The `uchar.h` include is not necessary.
    It was added to get the definition of char16_t but that's an intrinsic
    type in C++.

    Change-Id: I0aaa11dba0be3ccad15b9e421f8bae71450d443b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4823404
    Reviewed-by: Omer Katz <[email protected]>
    Commit-Queue: Eric Leese <[email protected]>
    Reviewed-by: Eric Leese <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89787}

Refs: v8/v8@1a3ecc2
PR-URL: #49639
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
@marco-ippolito
Copy link
Member

Landed in ff210ca...7b14289

marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    [zlib][build] Remove fdopen #defines in zutil.h.

    The latest version of Clang changed what macros it predefines on Apple
    targets, causing errors about predefined macros in zlib.

    See:
    madler/zlib@4bd9a71

    Bug: 1519899
    Change-Id: Ie75ef4078f2c86d89ba6c036ddd13e768a40ccbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237020
    Reviewed-by: Adenilson Cavalcanti <[email protected]>
    Commit-Queue: Hans Wennborg <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1253252}
    NOKEYCHECK=True
    GitOrigin-RevId: 2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9

Refs: https://chromium.googlesource.com/chromium/src/third_party/zlib/+/646b7f569718921d7d4b5b8e22572ff6c76f2596
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    Define UChar as char16_t

    We used to have UChar defined as uint16_t which does not go along
    with STL these days if you try to have an std::basic_string<> of it,
    as there are no standard std::char_traits<> specialization for uint16_t.

    This switches UChar to char16_t where practical, introducing a few
    compatibility shims to keep CL size small, as (1) this would likely
    have to be back-ported and (2) crdtp extensively uses uint16_t for
    wide chars.

    Bug: b:296390693
    Change-Id: I66a32d8f0050915225b187de56896c26dd76163d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4789966
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Commit-Queue: Jaroslav Sevcik <[email protected]>
    Auto-Submit: Andrey Kosyakov <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89559}

Refs: v8/v8@182d9c0
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    Fix build issue, remove unneeded include uchar.h.

    Follow the conversation on:
    https://groups.google.com/g/v8-dev/c/nsbshwlmP3c.

    The `uchar.h` include is not necessary.
    It was added to get the definition of char16_t but that's an intrinsic
    type in C++.

    Change-Id: I0aaa11dba0be3ccad15b9e421f8bae71450d443b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4823404
    Reviewed-by: Omer Katz <[email protected]>
    Commit-Queue: Eric Leese <[email protected]>
    Reviewed-by: Eric Leese <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89787}

Refs: v8/v8@1a3ecc2
PR-URL: #49639
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    [zlib][build] Remove fdopen #defines in zutil.h.

    The latest version of Clang changed what macros it predefines on Apple
    targets, causing errors about predefined macros in zlib.

    See:
    madler/zlib@4bd9a71

    Bug: 1519899
    Change-Id: Ie75ef4078f2c86d89ba6c036ddd13e768a40ccbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237020
    Reviewed-by: Adenilson Cavalcanti <[email protected]>
    Commit-Queue: Hans Wennborg <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1253252}
    NOKEYCHECK=True
    GitOrigin-RevId: 2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9

Refs: https://chromium.googlesource.com/chromium/src/third_party/zlib/+/646b7f569718921d7d4b5b8e22572ff6c76f2596
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    Define UChar as char16_t

    We used to have UChar defined as uint16_t which does not go along
    with STL these days if you try to have an std::basic_string<> of it,
    as there are no standard std::char_traits<> specialization for uint16_t.

    This switches UChar to char16_t where practical, introducing a few
    compatibility shims to keep CL size small, as (1) this would likely
    have to be back-ported and (2) crdtp extensively uses uint16_t for
    wide chars.

    Bug: b:296390693
    Change-Id: I66a32d8f0050915225b187de56896c26dd76163d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4789966
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Commit-Queue: Jaroslav Sevcik <[email protected]>
    Auto-Submit: Andrey Kosyakov <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89559}

Refs: v8/v8@182d9c0
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 5, 2025
Original commit message:

    Fix build issue, remove unneeded include uchar.h.

    Follow the conversation on:
    https://groups.google.com/g/v8-dev/c/nsbshwlmP3c.

    The `uchar.h` include is not necessary.
    It was added to get the definition of char16_t but that's an intrinsic
    type in C++.

    Change-Id: I0aaa11dba0be3ccad15b9e421f8bae71450d443b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4823404
    Reviewed-by: Omer Katz <[email protected]>
    Commit-Queue: Eric Leese <[email protected]>
    Reviewed-by: Eric Leese <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89787}

Refs: v8/v8@1a3ecc2
PR-URL: #49639
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 10, 2025
Original commit message:

    [zlib][build] Remove fdopen #defines in zutil.h.

    The latest version of Clang changed what macros it predefines on Apple
    targets, causing errors about predefined macros in zlib.

    See:
    madler/zlib@4bd9a71

    Bug: 1519899
    Change-Id: Ie75ef4078f2c86d89ba6c036ddd13e768a40ccbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237020
    Reviewed-by: Adenilson Cavalcanti <[email protected]>
    Commit-Queue: Hans Wennborg <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1253252}
    NOKEYCHECK=True
    GitOrigin-RevId: 2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9

Refs: https://chromium.googlesource.com/chromium/src/third_party/zlib/+/646b7f569718921d7d4b5b8e22572ff6c76f2596
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 10, 2025
Original commit message:

    Define UChar as char16_t

    We used to have UChar defined as uint16_t which does not go along
    with STL these days if you try to have an std::basic_string<> of it,
    as there are no standard std::char_traits<> specialization for uint16_t.

    This switches UChar to char16_t where practical, introducing a few
    compatibility shims to keep CL size small, as (1) this would likely
    have to be back-ported and (2) crdtp extensively uses uint16_t for
    wide chars.

    Bug: b:296390693
    Change-Id: I66a32d8f0050915225b187de56896c26dd76163d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4789966
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Commit-Queue: Jaroslav Sevcik <[email protected]>
    Auto-Submit: Andrey Kosyakov <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89559}

Refs: v8/v8@182d9c0
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 10, 2025
Original commit message:

    Fix build issue, remove unneeded include uchar.h.

    Follow the conversation on:
    https://groups.google.com/g/v8-dev/c/nsbshwlmP3c.

    The `uchar.h` include is not necessary.
    It was added to get the definition of char16_t but that's an intrinsic
    type in C++.

    Change-Id: I0aaa11dba0be3ccad15b9e421f8bae71450d443b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4823404
    Reviewed-by: Omer Katz <[email protected]>
    Commit-Queue: Eric Leese <[email protected]>
    Reviewed-by: Eric Leese <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89787}

Refs: v8/v8@1a3ecc2
PR-URL: #49639
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 11, 2025
Original commit message:

    [zlib][build] Remove fdopen #defines in zutil.h.

    The latest version of Clang changed what macros it predefines on Apple
    targets, causing errors about predefined macros in zlib.

    See:
    madler/zlib@4bd9a71

    Bug: 1519899
    Change-Id: Ie75ef4078f2c86d89ba6c036ddd13e768a40ccbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237020
    Reviewed-by: Adenilson Cavalcanti <[email protected]>
    Commit-Queue: Hans Wennborg <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#1253252}
    NOKEYCHECK=True
    GitOrigin-RevId: 2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9

Refs: https://chromium.googlesource.com/chromium/src/third_party/zlib/+/646b7f569718921d7d4b5b8e22572ff6c76f2596
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 11, 2025
Original commit message:

    Define UChar as char16_t

    We used to have UChar defined as uint16_t which does not go along
    with STL these days if you try to have an std::basic_string<> of it,
    as there are no standard std::char_traits<> specialization for uint16_t.

    This switches UChar to char16_t where practical, introducing a few
    compatibility shims to keep CL size small, as (1) this would likely
    have to be back-ported and (2) crdtp extensively uses uint16_t for
    wide chars.

    Bug: b:296390693
    Change-Id: I66a32d8f0050915225b187de56896c26dd76163d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4789966
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Commit-Queue: Jaroslav Sevcik <[email protected]>
    Auto-Submit: Andrey Kosyakov <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89559}

Refs: v8/v8@182d9c0
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Jun 11, 2025
Original commit message:

    Fix build issue, remove unneeded include uchar.h.

    Follow the conversation on:
    https://groups.google.com/g/v8-dev/c/nsbshwlmP3c.

    The `uchar.h` include is not necessary.
    It was added to get the definition of char16_t but that's an intrinsic
    type in C++.

    Change-Id: I0aaa11dba0be3ccad15b9e421f8bae71450d443b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4823404
    Reviewed-by: Omer Katz <[email protected]>
    Commit-Queue: Eric Leese <[email protected]>
    Reviewed-by: Eric Leese <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#89787}

Refs: v8/v8@1a3ecc2
PR-URL: #49639
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #58342
Reviewed-By: Marco Ippolito <[email protected]>
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. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. v20.x v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants