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-107585: fix the stable API .lib file name in debug builds on MSVC #107761

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FFY00
Copy link
Member

@FFY00 FFY00 commented Aug 8, 2023

… MSVC

Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
@zooba
Copy link
Member

zooba commented Aug 8, 2023

Would it be simpler just to enumerate all the cases and stick with complete strings? Rather than doing the concatenation tricks and potentially invading the macro namespace?

At the very least, we should use _PY_... macro names, as these are public header files that may impact user code.

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.

Definitely don't want to use preprocessor variables without a _Py_ prefix.

It might be possible to use a single multiline #pragma comment to avoid having to create variables at all, though that'll make it harder to search for this bit of code (which I know people do when they hit link errors).

Also, this code has changed recently for nogil, so it'll need reworking to account for the extra set of names.

@@ -307,13 +307,19 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* So MSVC users need not specify the .lib
file in their Makefile (other compilers are
generally taken care of by distutils.) */
# if defined(Py_LIMITED_API)
# define PINNED_VER "3"
Copy link
Member

Choose a reason for hiding this comment

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

_Py_ prefixes on the variables, please.

# if defined(Py_LIMITED_API)
# define PINNED_VER "3"
# else
# define PINNED_VER "313"
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure exactly how the release manager finds these variables to update them, but we might need to update some of their docs/tools for this change.

@bedevere-app
Copy link

bedevere-app bot commented Jan 31, 2024

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

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.

None yet

3 participants