-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Conversation
@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. |
There was a problem hiding this 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 😉
Tools/jit/_stencils.py
Outdated
@@ -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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(trampoline_mask): | |
if trampoline_mask: |
Or you could "{" + (", ".join(trampoline_mask) or "0") + "}"
.
Tools/jit/_writer.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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)}] = {{" |
There was a problem hiding this comment.
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.
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length Signed-off-by: Pablo Galindo <[email protected]>
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length Signed-off-by: Pablo Galindo <[email protected]>
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length Signed-off-by: Pablo Galindo <[email protected]>
Empty array initializers (
{}
) are not strictly standards compliant, and at least MSVC 1935 doesn't support them. This fixes those initializers to be{0}
.