Skip to content

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

Merged
jaraco merged 3 commits intopypa:mainfrom
Avasam:MSVCCompiler-cross-platform-bug
Sep 15, 2024
Merged

Fix cross-platform compilation using distutils._msvccompiler.MSVCCompiler#298
jaraco merged 3 commits intopypa:mainfrom
Avasam:MSVCCompiler-cross-platform-bug

Conversation

@Avasam
Copy link
Copy Markdown
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
)

@pytest.mark.skipif(
not sysconfig.get_platform().startswith("win"),
Copy link
Copy Markdown
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
@@ -0,0 +1 @@
Fix cross-platform compilation using ``distutils._msvccompiler.MSVCCompiler`` -- by :user:`saschanaz` and :user:`Avasam`
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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