Skip to content

builds: sccache / ccache are inserted twice into the compiler path #100

@paultiq

Description

@paultiq

What happens?

Per discussion duckdb/duckdb#19149, figuring out how to use sccache with duckdb-python builds was quite frustrating. I mentioned it also here: #59.

Problem

The issue is that "ccache" or "sccache" are detected and prepending in the compiler command twice: first by duckdb-python compiler_launcher.cmake and then by external/duckdb/CMakeLists.txt.

If someone has sccache installed and tries to build, compilation will fail due to the duplicate sccache's. It'll fail due to duplicate sccache's in the command: sccache sccache c++ .... ccache tolerates: ccache ccache clang++ ... altho that's not ideal.

I wrestled this a bit when setting up sccache in GHA's. Took me a while to land on the hacky workaround:

export CMAKE_C_COMPILER_LAUNCHER=""
export CMAKE_CXX_COMPILER_LAUNCHER=""

Solution

The fix appears to be to just remove / comment out compiler_launcher.cmake's detection... it's unnecessary since the external CMakeLists.txt does the same detection. Or, perhaps more cleanly, modify the duckdb CMakeLists.txt to add a flag that suppresses detection.

To Reproduce

Reproduction is fairly straightforward:

  • install sccache
  • make sure it's in the PATH (and make sure ccache is not)
  • Clean build dir
  • launch a build with uv sync --no-build-isolation -v --reinstall

* it helps to set build.tool-args = ["-v", "-d", "stats"] in [tool.scikit-build] to see the exact compile commands.

OS:

Windows & Linux

DuckDB Package Version:

1.5.x

Python Version:

3.13/ all

Full Name:

Paul T

Affiliation:

Iqmo

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a source build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions