Repository navigation
Build fixes for nix + a rust check error - #9423
Merged
Merged
Conversation
5 tasks done
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
nepet
force-pushed
the
nifty/python-build-fix
branch
from
October 26, 2026 15:22
0e05bc1 to
6f01e33
Compare
nepet
approved these changes
Oct 27, 2026
nepet
left a comment
Member
There was a problem hiding this comment.
Tested ACK 6f01e33
Thanks @niftynei!
nix build .#clnsucceeds on aarch64-darwin (nix sandbox off) and aarch64-linux (nixos/nixcontainer, sandbox on).lightningd --versionreports v26.06.6 and all 22 plugins are installed, includingcln-grpcandclnrest.test_amount_{add,sub}_overflowpass under crane'scargo test --releaseon both.- With #8950 on top,
nix develop+./configure && makeworks on Linux.configurenow picksPYTHON=python3through the new fallback (d835a5a), where on master it ends up empty.
Non-blocking suggestion for 6f01e33: nixpkgs already ships this as lowdown-unsandboxed (built with enableDarwinSandbox = false). nixpkgs' own nix package uses it on darwin, it's in cache.nixos.org for both darwin archs (so no local lowdown rebuild), and on Linux it's the same store path as lowdown. The lowdownForBuild block could become:
# lowdown calls sandbox_init() on darwin, which fails inside a nix build.
lowdown-unsandboxedThat also drops the --replace-fail against lowdown's main.c, which will break on a future lowdown bump.
FYI on 2e3d221: for downstream users of the cln-rpc crate, an Amount overflow now panics in release builds instead of silently wrapping, and checked_add/checked_sub become public API. I think both are right.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handful of bugfixes:
uvrunner), you run into issues with the python scripts we use for building. By falling back to a python type in the absence ofuv, we can fix this error. We were masking over it in the built-in nix builds.lowdownattempting 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 .#defaultunearthed an issue with the Rust tests masking overflow errors.