-
Notifications
You must be signed in to change notification settings - Fork 72
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
Support pkgsrc variation #16
Comments
@0-wiz-0 I don't have a NetBSD environment. Can you inspect the CPython distutils code (ideally 3.9, or 3.8) and determine what's different about the stdlib distutils that it doesn't encounter the error you're getting with the Setuptools-hosted copy? Can you confirm the error is the same with Setuptools 50.0.1? |
Thanks for the idea of comparing to the CPython copy of distutils. There were no obvious differences, but pkgsrc has two patches for CPython's distutils: https://github.com/NetBSD/pkgsrc/blob/trunk/lang/python38/patches/patch-Lib_distutils_sysconfig.py 50.0.1 is broken in the same way as above, but when I apply these two patches to it, it builds fine. |
Thanks for confirming. I'm going to transfer this issue to the distutils project (which Setuptools 48 incorporates). My recommendation is that we reach out to the maintainers of those patches and ask them to devise a suitable replacement, something that achieves the differential behavior, but only when appropriate (for NetBSD or some other factor in NetBSD). How does that sound? |
Perhaps we should re-title this again. The patches referenced above are used to make the list of files that get installed the same on all these supported operating systems. Perhaps the correct solution is just carrying similar patches in the pkgsrc setuptools package. |
In #68, I'm working on a technique that would enable downstream packagers to monkeypatch. Perhaps that technique could also be applied to enable pkgsrc to include tweaks to the behavior.
I'd like to avoid that. Once Setuptools has successfully adopted distutils (can use it by default), the project plans to do some refactoring and clean up a lot of the duplication and monkeypatching that's going on. The project does not intend to keep a stable internal implementation suitable for patching. |
…orting the patches used by pkgsrc. Fixes #16.
…orting the patches used by pkgsrc. Fixes #16.
…orting the patches used by pkgsrc. Fixes #16.
In 6d7976c, I've drafted hooks that would allow a project like pkgsrc to provide a # _distutils_system_mod
import distutils.sysconfig
vars(distutils.sysconfig).update(
_makefile_tmpl='config-{python_ver}{build_flags}',
_sysconfig_name_tmpl='_sysconfigdata_{platform}',
) That would obviate the first patch for sysconfig. Looking at the patch for unixcompiler, it appears to me that patch is no longer relevant and the need for it was likely addressed in #55. |
@jaraco Thanks for the example |
You can put the module anywhere on |
distutils by default is installed by the python package, so I thought I'd have to modify that. But the version that's in python 3.9.9 does not have this code yet. |
I can see how my description was incomplete and led to the confusion. The goal of this hook is to allow system packagers to avoid having to monkeypatch distutils at all and to instead provide hooks to enable the platform-specific customizations. So, I would recommend that |
I put the file from above into
|
Oh, that's interesting. I suspect you've found a bug. But I don't yet understand it. Looking at |
Attempting to replicate the issue on my macOS machine, I find that it's working as expected:
I'll need to figure out what other factors are relevant. |
Aha. I was able to elicit a similar, but slightly different error by attempting to run
I should be able to use that to track down the cause. |
It seems the issue is that |
Please consider testing against https://github.com/pypa/setuptools/tree/bugfix/2906-distutils-race. In my testing, it addresses the issue. |
Setuptools 59.3.0 is releasing now and should contain the fix. |
I can confirm that 59.3.0 works for me with Thank you very much! |
Instead of guessing the filename just refer to the stdlib. This also removes the hook added in pypa#16, but 1) It was never implemented by the distro requesting it: https://github.com/NetBSD/pkgsrc/blob/586097714897b1b4d4a9e0a32c1658a1335442b7/devel/py-setuptools/Makefile#L28 2) The stdlib version should hopefully return a proper result Also adds a small test cehcking that the file exists on Unix platforms
Instead of guessing the filename just refer to the stdlib. This also removes the "_makefile_tmpl" hook added in pypa#16, but 1) It was never implemented by the distro requesting it from what I can see: https://github.com/NetBSD/pkgsrc/blob/586097714897b1b4d4a9e0a32c1658a1335442b7/devel/py-setuptools/Makefile#L28 2) The stdlib version should hopefully return a proper result Also adds a small test checking that the file exists on Unix platforms
Instead of guessing the filename just refer to the stdlib. This also removes the "_makefile_tmpl" hook added in pypa#16, but 1) It was never implemented by the distro requesting it from what I can see: https://github.com/NetBSD/pkgsrc/blob/586097714897b1b4d4a9/devel/py-setuptools/Makefile#L28 2) The stdlib version should return a proper result as it is patched by the distro requesting the change: https://github.com/NetBSD/pkgsrc/blob/6efa5763ec447864a7d4/lang/python38/patches/patch-Lib_sysconfig.py Also adds a small test checking that the file exists on Unix platforms
Instead of guessing the filename just refer to the stdlib. This also removes the "_makefile_tmpl" hook added in pypa#16, but 1) It was never implemented by the distro requesting it from what I can see: https://github.com/NetBSD/pkgsrc/blob/586097714897b1b4d4a9/devel/py-setuptools/Makefile#L28 2) The stdlib version should return a proper result as it is patched by the distro requesting the change: https://github.com/NetBSD/pkgsrc/blob/6efa5763ec447864a7d4/lang/python38/patches/patch-Lib_sysconfig.py Also adds a small test checking that the file exists on Unix platforms
The switch to the included distutils that happened in 48.0.0 broke the build on NetBSD, at least in the way setuptools is built from pkgsrc:
setuptools 47.3.2 works when built the same way.
The text was updated successfully, but these errors were encountered: