Failure to install polars: cmake not installed

The Problem

I get build errors when trying to use python3Packages.polars


last 10 log lines:
       >   thread 'main' panicked at '
       >   failed to execute command: No such file or directory (os error 2)
       >   is `cmake` not installed?
       >   build script failed, must exit now', /build/polars-0.13.19-vendor.tar.gz/cmake/src/
       >   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       > warning: build failed, waiting for other jobs to finish...
       > 💥 maturin failed
       >   Caused by: Failed to build a native library through cargo
       >   Caused by: Cargo build finished with "exit status: 101": `cargo rustc --message-format json --manifest-path Cargo.toml -j 16 --frozen --target x86_64-unknown-linux-gnu --release --lib -- -C link-arg=-s`

Steps to reproduce

EDIT: simpler way to reproduce

nix shell nixpkgs#python310Packages.polars

Original example

  • nix flake new -t templates#python ./reproduce-polars-build-failure
  • cd reproduce-polars-build-failure
  • edit flake.nix to add python3Packages.polars just below python3Packages.poetry (line 14)
  • nix develop


  • What am I doing wrong?

It looks like the current version in nixpkgs does not include cmake at all.

Could it be that it was only tested on the developer’s machine, where cmake was globally available?

In trying to explore a fix, I’m attempting to add the package as an overlay in my flake. I know how to make overlays that add or modify top-level items, but this one needs to go into python<N>Packages, and I don’t know how to do that.

I just stumbled over this issue as well and created a github issue:

I will add a reference to this discussion as well.

Did you find a solution?

Higher priority tasks have kept me from being able to dedicate any time to this, so I’ve made no progress at all. Sorry.