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

Handle distutils without distutils.msvc9compiler.MSVCCompiler class #118

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

jameshilliard
Copy link
Contributor

Fixes #117.

@jameshilliard
Copy link
Contributor Author

Think someone could look at this and spin a new release? Without this change cffi is broken on Windows with the latest setuptools release.

@jameshilliard jameshilliard changed the title Prefer non-deprecated MSVCCompiler import Handle distutils without distutils.msvc9compiler.MSVCCompiler class Aug 29, 2024
@alex
Copy link
Contributor

alex commented Aug 29, 2024

I think this will solve the issue being experienced. I don't understand what monkey-patching _remove_visual_c_ref was intended to achieve, so I can't quite tell if this is correct.

nhusung added a commit to OxiDD/oxidd that referenced this pull request Aug 30, 2024
CFFI is currently broken with setuptools 74.0, see python-cffi/cffi#118
@arigo
Copy link
Contributor

arigo commented Sep 3, 2024

The patch of _remove_visual_c_ref appears to be for the embedding case. The tests pass here on github but I don't know what version of setuptools that is using. If that's the latest version, then apparently the patch is not needed any more with that version.

@nitzmahone
Copy link
Member

Our guess is that it's related to long-dead versions of the Microsoft toolchain that we have no ability to install/test- we didn't try to evaluate if it was actually useful when we shimmed distutils.

The PR looks good to me to get things working again (and this issue is also an excellent illustration of why we should be pinning setuptools upper bounds in our releases- it wouldn't have been possible to break this way).

We'll get that merged and kick off a release this week- thanks!

@nitzmahone nitzmahone enabled auto-merge (squash) September 4, 2024 17:30
@nitzmahone nitzmahone merged commit 5982be1 into python-cffi:main Sep 4, 2024
11 checks passed
nitzmahone pushed a commit that referenced this pull request Sep 4, 2024
…118)

* Handle distutils without distutils.msvc9compiler.MSVCCompiler class

* add explanatory comments

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
(cherry picked from commit 5982be1)
@MarkCallow
Copy link

I see release 1.17.1 has been made that includes this fix. The Releases section only shows the source code. Has the release been uploaded to pypl.org for pip to find?

@nitzmahone
Copy link
Member

Yep, immediately after the release was tagged: https://pypi.org/project/cffi/1.17.1/#files

@jameshilliard jameshilliard deleted the fix-msvccompiler branch September 7, 2024 21:34
@viblo
Copy link

viblo commented Sep 8, 2024

Not sure if its more fitting to ask in the Pypy tracker, but could you also update the version used by Pypy to use the updated cffi?

@saschanaz
Copy link

saschanaz commented Sep 8, 2024

That seems pypy/pypy#5027 and is already done by pypy/pypy@87024e9

(And yes it should be asked in the pypy tracker)

@viblo
Copy link

viblo commented Sep 8, 2024

Ah of course. Great, thanks!

@larsoner
Copy link

larsoner commented Sep 16, 2024

Seems like we're getting a new failure in python-rtmixer:

spatialaudio/python-rtmixer#60
https://github.com/spatialaudio/python-rtmixer/actions/runs/10882693787/job/30194263112?pr=60#step:4:14395

I haven't investigated why, but at least the same build last month worked, and we didn't change any code (though it's always possible the windows-latest image updated or something):

https://github.com/spatialaudio/python-rtmixer/actions/runs/10249497029/job/28353006823

@alex
Copy link
Contributor

alex commented Sep 16, 2024 via email

@arigo
Copy link
Contributor

arigo commented Sep 16, 2024

If this runs with a newer version of PyPy than the previous run, then you might need to report that as an issue on the PyPy issue tracker to make sure they are aware that something broke.

@alex
Copy link
Contributor

alex commented Sep 16, 2024 via email

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.

cffi relies on deprecated (now removed) distutils.msvc9compiler module
8 participants