Repository navigation
Nix/darwin followups - #9677
Open
nepet wants to merge 8 commits into
Open
Nix/darwin followups#9677nepet wants to merge 8 commits into
nepet wants to merge 8 commits into
Conversation
Changelog-Added: nix: development shells now include `uv` for Python dependency and command execution.
Update paths in configure + Makefile so that nix develop works on a MacOS machine Changelog-Fixed: nix: `nix develop` now configures and builds correctly on macOS without injecting Homebrew paths into the Nix toolchain.
We use `eatmydata` in the contrib/startup_regtest.sh shell script. This automatically adds it to the nix development shell so it's available Changelog-Added: nix: development shells now include `eatmydata` for `contrib/startup_regtest.sh`.
If you're running any startup_regtest daemons in the shell, this will attempt to stop them on exit from the development shell. Changelog-Added: nix: development shells now stop `startup_regtest.sh` daemons when the shell exits.
Add shellcheck to nix develop to complete checks without requiring a separate host installation. Changelog-Added: nix: development shells now include `shellcheck`.
On macOS, configure and the Makefile used /opt/homebrew on arm64 (and /usr/local otherwise) whether or not Homebrew is installed. The nix dev shell skips them through IN_NIX_SHELL, but `nix build` doesn't set it. Darwin builds run without the nix sandbox by default, so on a Mac with Homebrew the package compiled with -I/opt/homebrew/include ahead of nix's -isystem paths: it used Homebrew's sodium.h and gmp.h while linking nix's libsodium. Ask `brew --prefix` instead, and use nothing from Homebrew when brew isn't found. A nix build's PATH only holds the build's inputs, so it gets no Homebrew paths, and neither does a Mac without Homebrew. Changelog-Fixed: build: on macOS, Homebrew's headers and libraries are only used when Homebrew is installed, and no longer leak into `nix build`.
The Makefile runs `openssl version` and `git ls-files` while it is being parsed. Where they are missing, as in a nix build, every make invocation printed "openssl: command not found", "test: -ge: unary operator expected" and "not a git repository" errors. Silence them; the fuzz targets are still only included with OpenSSL >= 3. Changelog-None
nixpkgs already ships lowdown built without its darwin sandbox (enableDarwinSandbox = false) as lowdown-unsandboxed, and its own nix package uses it on darwin for the same reason. It's in cache.nixos.org, so darwin builds no longer compile lowdown locally, and the --replace-fail on lowdown's main.c can't break on a future lowdown update. On Linux it's the same package as lowdown. Changelog-None
nepet
force-pushed
the
nix/darwin-followups
branch
from
October 29, 2026 08:43
3c74377 to
6f5d9e9
Compare
This branch has not been deployed
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.
Important
26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.
RC1 is scheduled on August 17th
The final release is scheduled for September 7th.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgradeBuilds on #9456. Only the last three commits are new.
On macOS,
configureand theMakefileuse/opt/homebrewon arm64 (and/usr/localotherwise), whether or not Homebrew is installed.#9456 skips them in nix dev shells through
IN_NIX_SHELL, butnix builddoesn't set it. Darwin builds run without the nix sandbox by default, so on a Mac with Homebrew the package compiles with-I/opt/homebrew/includeahead of nix's-isystempaths: it uses Homebrew'ssodium.handgmp.hwhile linking nix'slibsodium, which only works while the versions happen to match.This PR changes to ask for Homebrew's prefix instead of hardcoding it. When
brewisn't found, nothing from Homebrew is added. Not in a nix build, and not on a Mac without Homebrew. TheIN_NIX_SHELLguard and theCPATH/LIBRARY_PATHoverrides stay as they are.This also fixes the Makefile in this case: don't print errors when
opensslorgitare missing. In a nix build, everymakeinvocation printedopenssl: command not foundetc. Only stderr is silenced, the fuzz targets are still only included with OpenSSL >= 3.Also, this switches to use nixpkgs
lowdown-unsandboxedinstead of patchinglowdown. Nixpkgs already ships lowdown without its darwin sandbox and it's ownnixpackage uses it on darwin. On Linux it's the same store path aslowdown.