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

Fix cross-platform compilation using distutils._msvccompiler.MSVCCompiler #298

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Sep 14, 2024

Actually use the plat_name param in MSVCCompiler.initialize
Thanks @saschanaz #285 (comment)

Fixes pypa/setuptools#4648 (comment)

@Avasam Avasam force-pushed the MSVCCompiler-cross-platform-bug branch from 0039a79 to e9eb697 Compare September 14, 2024 22:53
@@ -28,6 +30,28 @@ def _find_vcvarsall(plat_spec):
'wont find this version',
)

@pytest.mark.skipif(
not sysconfig.get_platform().startswith("win"),
Copy link
Contributor Author

@Avasam Avasam Sep 14, 2024

Choose a reason for hiding this comment

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

Alternatively:

Suggested change
not sysconfig.get_platform().startswith("win"),
sysconfig.get_platform() not in _msvccompiler._vcvars_names,

or

Suggested change
not sysconfig.get_platform().startswith("win"),
get_platform() not in _msvccompiler._vcvars_names,

But that's starting to look a lot like tests following the implementation

…piler`

Actually use the `plat_name` param in `MSVCCompiler.initialize`
Added tests
@jaraco jaraco merged commit 47353c5 into pypa:main Sep 15, 2024
20 of 21 checks passed
@@ -0,0 +1 @@
Fix cross-platform compilation using ``distutils._msvccompiler.MSVCCompiler`` -- by :user:`saschanaz` and :user:`Avasam`
Copy link
Member

Choose a reason for hiding this comment

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

Oh, gosh. I'm realizing now that we can't use these news fragments. They refer to issues in this repository, which is merged into Setuptools, so adding them here will cause setuptools to render them as their own issues. I'll just delete it.

Copy link
Contributor Author

@Avasam Avasam Sep 15, 2024

Choose a reason for hiding this comment

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

Oh right!
Well you could still have newsfragments without issue # if it starts with + (for example: +distutils298.bugfix.rst)

In this case it could refer to the issue I opened on setuptools' repo.

Copy link
Member

Choose a reason for hiding this comment

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

Good idea. I'll aim to do things like that in the future.

@Avasam Avasam deleted the MSVCCompiler-cross-platform-bug branch September 15, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 74.0.0 broke x64 to ARM64 cross-compilation for pywin32
2 participants