Skip to content

detect conda gcc for -Wno-unused-but-set-variable as well #11112

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 1 commit into from
Sep 21, 2021

Conversation

mr-c
Copy link
Contributor

@mr-c mr-c commented Sep 15, 2021

Description

Allows mypyc to recognize a conda gcc compiler, so that -Wno-unused-but-set-variable may be set so that compilation does not fail.

On arm64, the conda compiler is named aarch64-conda-linux-gnu-cc and on x86_65 the conda compiler is named x86_64-conda-linux-gnu-cc

$ python -c 'from distutils import sysconfig, ccompiler; compiler = ccompiler.new_compiler(); sysconfig.customize_compiler(compiler); print(compiler.compiler[0])'

x86_64-linux-gnu-gcc

$ conda activate

(base) $ python -c 'from distutils import sysconfig, ccompiler; compiler = ccompiler.new_compiler(); sysconfig.customize_compiler(compiler); print(compiler.compiler[0])'

/home/michael/miniconda3/bin/x86_64-conda-linux-gnu-cc
# note the lack of "gcc" in the compiler name

See line 947 of https://cloud.drone.io/conda-forge/schema-salad-feedstock/6/4/2 for an example of how this issue caused a build failure

Test Plan

If desired, I can refactor the gcc testing code to its own function, and then add some unit tests.

@hauntsaninja hauntsaninja merged commit fab534b into python:master Sep 21, 2021
@hauntsaninja
Copy link
Collaborator

Thanks!

@mr-c mr-c deleted the conda_gcc branch September 21, 2021 09:33
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.

2 participants