Skip to content

Build fixes for nix + a rust check error - #9423

Open
niftynei wants to merge 3 commits into
ElementsProject:masterfrom
niftynei:nifty/python-build-fix
Open

Build fixes for nix + a rust check error#9423
niftynei wants to merge 3 commits into
ElementsProject:masterfrom
niftynei:nifty/python-build-fix

Conversation

@niftynei

Copy link
Copy Markdown
Collaborator

Handful of bugfixes:

  • When building CLN on NixOS (outside of the uv runner), you run into issues with the python scripts we use for building. By falling back to a python type in the absence of uv, we can fix this error. We were masking over it in the built-in nix builds.
  • Getting the nix builds running on MacOS unearthed an issue with lowdown attempting to spawn a sandbox within a sandbox. We resolve this by telling lowdown not to spawn a sandbox when it's running in a nixos build.
  • nix build .#default unearthed an issue with the Rust tests masking overflow errors.

Builds on NixOS are failing due to lack of python configuration

> PYTHONPATH=contrib/msggen  contrib/msggen/msggen/__main__.py bundle doc/schemas
       > /nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash: line 1: contrib/msggen/msggen/__main__.py: Permission denied
              > make: *** [contrib/msggen/Makefile:15: contrib/msggen/msggen/schema.json] Error 126

We can: fail if not configured and use the local python3 path
if/when `uv` doesn't work.

We also add an error when PYTHON isn't configured, and remove the
local override for the nix setup (since it should be fixed now).

Changelog-Fixed: nix-builds: correctly set PYTHON in case where `uv` is not present
When running `nix build .#default -L` I came across two failures:

> failures:
>
> ---- primitives::test::test_amount_add_overflow stdout ----
> note: test did not panic as expected at cln-rpc/src/primitives.rs:1064:8
> ---- primitives::test::test_amount_sub_overflow stdout ----
> note: test did not panic as expected at cln-rpc/src/primitives.rs:1057:8
>
> failures:
>     primitives::test::test_amount_add_overflow
>     primitives::test::test_amount_sub_overflow
>
> test result: FAILED(B. 36 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

Rather than wrapping silently, we now error.

Changelog-Fixed: rust: Amounts that overflow fail, don't silently ignore in release builds
We're already in a sandbox when you're running `nix build`.
MacOS explicitly disallows nested sandboxes. If on Darwin and
running in a nix sandbox, we explicitly disable the `lowdown` sandbox

Changelog-Fixed: macos: builds with lowdown succeed, as we no longer attempt to spawn a nested sandbox
@niftynei
niftynei requested a review from cdecker as a code owner August 15, 2026 22:40
@niftynei niftynei changed the title Nifty/python build fix Build fixes for nix + a rust check error Aug 15, 2026
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.

1 participant