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

Should distutils rely on sysconfig for LDSHARED etc? #40

Open
jmroot opened this issue Apr 25, 2021 · 2 comments
Open

Should distutils rely on sysconfig for LDSHARED etc? #40

jmroot opened this issue Apr 25, 2021 · 2 comments
Labels
deferred Deferred until distutils adoption is established enhancement New feature or request

Comments

@jmroot
Copy link
Contributor

jmroot commented Apr 25, 2021

#36 raises a design question: should distutils-as-an-independent-module be relying on the Python interpreter's sysconfigdata variables to know how to compile and link extensions? In the specific case of #36, there's no real reason why distutils couldn't decide at runtime, based on MACOSX_DEPLOYMENT_TARGET, whether to use -undefined dynamic_lookup or link against the framework explicitly, rather than erroring when the sysconfig and runtime targets differ.

Bringing in an equivalent of the checks cpython does at configure time to figure out the right values for all the relevant variables on each platform is of course going to be a much more daunting task. But it might ultimately be a better approach? I don't know what the right answer is here, but I think it's something that needs to be thought about.

@jaraco
Copy link
Member

jaraco commented Dec 12, 2021

I don't have an opinion on the matter, but I do have some preferences on how to approach it:

  • distutils is in a somewhat frozen state until Setuptools' users are generally relying on it. Until then, I'm pushing back on substantial changes to the implementation that might introduce issues that would be masked until mass adoption can occur.
  • distutils as an independent module is expected to go away as Setuptools adopts and absorbs the distutils functionality, so this issue might better be implemented in Setuptools subesquent to the adoption. For now, it's okay to leave this request here.

Therefore, I'm going to defer this effort until after distutils is stably adopted into Setuptools as the default.

I'm all for enhanced functionality, especially if it doesn't add a lot of complexity. I agree that

Bringing in an equivalent of [cpython configure is] ... a much more daunting task.

I'd advise to seek an approach that doesn't require that complexity, if possible, or to devise a layer that encapsulates that complexity into its own package/protocol.

@jaraco jaraco added deferred Deferred until distutils adoption is established enhancement New feature or request labels Dec 12, 2021
@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 16, 2022

Related: Various downstream packagers have provided misconfigured Pythons that leak compiler flags such as -I, -L, -Werror into user packages via sysconfig->distutils, see python/cpython#90539 and references within

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred Deferred until distutils adoption is established enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants