Repository navigation
libpython: drop the unused C++ compiler - #949
Conversation
The shared library links no C++ runtime (libpython3.15.so.1.0 needs only libc, libm, libgcc_s and friends; the macOS dylib only libSystem), but the compiler's run-exports made every libpython build require libstdcxx >=15 on Linux and libcxx on macOS. Environments capped below libstdcxx 15 (e.g. Julia 1.10 and 1.12 via CondaPkg) therefore cannot install libpython, nor python 3.13/3.14 builds that pin it exactly. Co-authored-by: Miles Cranmer <[email protected]>
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( I do have some suggestions for making it better though... For recipe/meta.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/38184242911. Examine the logs at this URL for more detail. |
|
Hi all, just confirming a human is behind this PR. I ran into this through PythonCall.jl, which embeds Python in Julia and so is one of the rare users that needs libpython. (I maintain the pyjuliapkg and pyjuliacall feedstocks.) My understanding of the core issue:
I believe this PR fixes that. @isuruf since you opened #843 and merged #894, could you take a look at this as a follow-up? cc @h-vetinari |
|
@conda-forge-admin, please rerender |
2096134 to
06baaf8
Compare
Why
Every
libpythonbuild depends onlibstdcxx >=15on Linux (andlibcxxon macOS), but the library never links a C++ runtime:The dependency is a run-export of
{{ compiler('cxx') }}in thelibpythonoutput's build requirements. Thepythonoutput already drops the same run-export withignore_run_exports_from;libpythondoes not, yet its build compiles no C++:install_shared.shonly copies the library and, on macOS, calls$CCto makelibpython3.dylib.This blocks environments that cap the C++ runtime. CondaPkg.jl caps
libstdcxxat the version bundled with Julia, which is below 15 for Julia 1.10 and 1.12. Under that cap:python+libpythonis unsolvable (libpython 3.11.16 | ... | 3.15.0 would require libstdcxx >=15);python 3.13.16and3.14.8are unsolvable, since they pinlibpythonexactly;python 3.15is unusable for embedding, because it no longer pulls inlibpython(Move libpython.so to another output #843).PythonCall.jl needs to depend on
libpythonexplicitly for 3.15 (JuliaPy/PythonCall.jl#838), and it can only do so oncelibpythonstops requiringlibstdcxx >=15.Scope
Removes
{{ compiler('cxx') }}from thelibpythonoutput's build requirements and bumps the build number. The C++ compiler stays in the test requirements, where cmake needs it. #950 on the3.14branch makes the same change for 3.14.x builds. The3.11,3.12and3.13branches have the same line; I'm happy to open those too.Tradeoffs
None that I can find: nothing in the
libpythonbuild compiles C++.Blast Radius
Only the
libpythonoutput's run requirements change.conda renderof the linux-64 release config, before vs after, differs only ingxxleaving that output's build environment andlibstdcxx >=15leaving its run requirements; thepython,libpython-staticand other outputs keep the same requirements apart from ordering.Verification
conda render recipe -m .ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml:libpythonrun requirements go from__glibc, libgcc >=15, libstdcxx >=15, python ...to__glibc, libgcc >=15, python ....libstdcxx <15was checked with pixi on linux-64.