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

gh-125207: Fix MSVC 1935 build with JIT #125209

Merged
merged 4 commits into from
Oct 18, 2024

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Oct 9, 2024

Empty array initializers ({}) are not strictly standards compliant, and at least MSVC 1935 doesn't support them. This fixes those initializers to be {0}.

@mdboom mdboom added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 18, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @mdboom for commit 383f97a 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 18, 2024
@mdboom
Copy link
Contributor Author

mdboom commented Oct 18, 2024

@zooba: What do you think about this PR? Upgrading MSVC did resolve it, but IIUC the minimum required version of MSVC is 14.0, which would certainly require this change.

@mdboom mdboom requested a review from zooba October 18, 2024 13:30
Copy link
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The choice is either to make a trivial change to keep building, or to go through and declare (and detect and warn) that specific compilers are no longer permitted.

I suspect you'll prefer to just take this trivial change 😉

@@ -339,7 +339,10 @@ def _get_trampoline_mask(self) -> str:
word = bitmask & ((1 << 32) - 1)
trampoline_mask.append(f"{word:#04x}")
bitmask >>= 32
return "{" + ", ".join(trampoline_mask) + "}"
if len(trampoline_mask):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if len(trampoline_mask):
if trampoline_mask:

Or you could "{" + (", ".join(trampoline_mask) or "0") + "}".

@@ -32,8 +32,11 @@ def _dump_footer(
yield "};"
yield ""
yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{"
for symbol, ordinal in symbols.items():
yield f" [{ordinal}] = &{symbol},"
if len(symbols):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@@ -32,8 +32,11 @@ def _dump_footer(
yield "};"
yield ""
yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this, there shouldn't be a need for the length in here? And while I believe it's okay, it could be affected by this change.

@mdboom mdboom requested a review from zooba October 18, 2024 14:59
@mdboom mdboom merged commit c8fd4b1 into python:main Oct 18, 2024
63 checks passed
pablogsal pushed a commit to pablogsal/cpython that referenced this pull request Oct 18, 2024
* pythongh-125207: Use {0} array initializers

* Simplify, as suggested in PR

* Revert change to explicitly specify length

Signed-off-by: Pablo Galindo <[email protected]>
pablogsal pushed a commit to pablogsal/cpython that referenced this pull request Oct 21, 2024
* pythongh-125207: Use {0} array initializers

* Simplify, as suggested in PR

* Revert change to explicitly specify length

Signed-off-by: Pablo Galindo <[email protected]>
pablogsal pushed a commit to pablogsal/cpython that referenced this pull request Oct 21, 2024
* pythongh-125207: Use {0} array initializers

* Simplify, as suggested in PR

* Revert change to explicitly specify length

Signed-off-by: Pablo Galindo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants