Skip to content

[BUG] CC="ccache gcc" stopped working for C++ builds since setuptools-60.0.0 #126

@bjodah

Description

@bjodah

setuptools version

setuptools>=60.0.0

Python version

CPython 3.9

OS

Ubuntu 20.04 LTS

Additional environment information

Description

Running setup.py build_ext with CC set to "ccache gcc-11" causes this to happen when building a c++ extension module:

g++-11 gcc-11 -shared -Wl,-rpath=/opt/cpython-3.9-debug/lib -Wl,--disable-new-dtags -Wl,-rpath,/opt/sundials-5.7.0-noklu-nolapack-dbg/lib -L/opt/sundials-5.7.0-noklu-nolapack-dbg/lib -isystem /opt/sundials-5.7.0-noklu-nolapack-dbg/include build/temp.linux-x86_64-3.9-pydebug/pyodeint/_odeint.o -L/opt/cpython-3.9-debug/lib -o build/lib.linux-x86_64-3.9-pydebug/pyodeint/_odeint.cpython-39d-x86_64-linux-gnu.so
/usr/bin/ld: cannot find gcc-11: No such file or directory

Setting SETUPTOOLS_USE_DISTUTILS=stdlib yields the expected linkline:

g++-11 -pthread -shared -Wl,-rpath=/opt/cpython-3.9-debug/lib -Wl,--disable-new-dtags -Wl,-rpath,/opt/sundials-5.7.0-noklu-nolapack-dbg/lib -L/opt/sundials-5.7.0-noklu-nolapack-dbg/lib -isystem /opt/sundials-5.7
.0-noklu-nolapack-dbg/include build/temp.linux-x86_64-3.9-pydebug/pyodeint/_odeint.o -L/opt/cpython-3.9-debug/lib -o build/lib.linux-x86_64-3.9-pydebug/pyodeint/_odeint.cpython-39d-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.9-pydebug/pyodeint/_odeint.cpython-39d-x86_64-linux-gnu.so -> pyodeint

The compile comands look alright though:
ccache gcc-11 -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -g -Og -Wall -Og -g3 -Og -g3 -isystem /opt/sundials-5.7.0-noklu-nolapack-dbg/include -fPIC -DANYODE_NO_LAPACK=1 -DNDEBUG -DBOOST_UB LAS_TYPE_CHECK=0 -Ipyodeint/include -I/opt/cpython-3.9-debug/lib/python3.9/site-packages/numpy/core/include -Iexternal/anyode/include -I/opt/cpython-3.9-debug/include/python3.9d -c pyodeint/_odeint.cpp -o build/ temp.linux-x86_64-3.9-pydebug/pyodeint/_odeint.o -std=c++20

Perhaps the space between ccache and g++ is unaccounted for in setuptools (own?) distutils?

Expected behavior

How to Reproduce

Output

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions