-
Notifications
You must be signed in to change notification settings - Fork 897
Description
There are longstanding issues with like #4125 #4377 #771 #341 #340 etc where users have had a lot of pain caused by the requirement to set extension-module as a feature.
The functionality provided by this feature is to turn off linking against libpython. This is only relevant when building an extension module for distribution on PyPI where it's possible that the extension module may be installed and run against a statically-linked Python.
The problem with this feature is that turning off linking breaks everything else; executables can't finish building without the symbols being available.
I would like to propose we deprecate the feature and instead provide an environment variable PYO3_BUILD_EXTENSION_MODULE to trigger the same behaviour.
maturin and setuptools-rust would be expected to set this automatically if building an extension module; other users building manually would also need to do the same.
I'm going to draft a PR to demonstrate this idea; even within our own repository this feature makes it rather awkward for us to build and test our own examples (leading to e.g. #4524).
cc @messense