Skip to content

Add compilers to conda environment #28352

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jun 6, 2024

PR summary

This fixes issues with libstdc++.so when using a system with a newer compiler. In such cases, the compiler will create links to new symbols, but the shared library available at runtime from conda-forge will not have them available.

This results in errors such as:

ImportError: /home/elliott/micromamba/envs/mpl-dev/bin/../lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /home/elliott/code/matplotlib/build/cp39/src/_c_internal_utils.cpython-39-x86_64-linux-gnu.so)

I'm fairly certain we have seen similar issues here or on Gitter, but am not aware of one at the moment.

@jakirkham also suggested adding python even if we don't pin it just to be explicit.

PR checklist

@tacaswell tacaswell added this to the v3.10.0 milestone Jun 7, 2024
@tacaswell
Copy link
Member

Anyone can merge when green.

@jakirkham
Copy link

jakirkham commented Jun 10, 2024

Are CodeCov or AppVeyor relevant here? Mentioning as those appear to be the only failures

@tacaswell
Copy link
Member

Unfortunately, yes. We use the environment file on appveyor

@jakirkham
Copy link

jakirkham commented Jun 11, 2024

The error on AppVeyor suggests the compiler is not on the path

..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['cl.exe']]
  The following exception(s) were encountered:
  Running `cl.exe /?` gave "[WinError 2] The system cannot find the file specified"

Edit: When we used AppVeyor in conda-forge in the past, we would typically add a line like this to activate the compiler. Am not seeing that line in the AppVeyor configuration file in this repo, but maybe I'm missing it?

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

@QuLogic
Copy link
Member Author

QuLogic commented Jun 12, 2024

Originally, we told Meson to enable the MSVC environment automatically; this was because AppVeyor had Strawberry Perl with its totally broken compilers on the path first. It seems that adding compilers from conda-forge causes MSVC to be hidden entirely, but that's sort of what we want anyway.

I'll remove the --vsenv flag so that AppVeyor uses the conda compilers. We test MSVC on Azure, so we aren't losing anything by that change.

This fixes issues with `libstdc++.so` when using a system with a newer
compiler. In such cases, the compiler will create links to new symbols,
but the shared library available at runtime from conda-forge will not
have them available.

This results in errors such as:
```
ImportError: /home/elliott/micromamba/envs/mpl-dev/bin/../lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /home/elliott/code/matplotlib/build/cp39/src/_c_internal_utils.cpython-39-x86_64-linux-gnu.so)
```
@jakirkham
Copy link

FWIW we now have pikepdf in conda-forge (think we were just missing Windows before)

- pikepdf

xref: conda-forge/pikepdf-feedstock#119

@dstansby
Copy link
Member

All seems to be working now - just in case I'm missing something I'll let this sit for a few days, but if no-one objects after that I'll merge.

@tacaswell tacaswell merged commit 27cfc23 into matplotlib:main Mar 18, 2025
40 of 41 checks passed
@QuLogic QuLogic deleted the cf-compiler branch March 19, 2025 00:28
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.

6 participants