Sometimes build nix-manual when cross compiling#13557
Merged
xokdvium merged 1 commit intoNixOS:masterfrom Jul 26, 2025
Jayman2000:sometimes-build-manual-when-cross-compiling
Merged
Sometimes build nix-manual when cross compiling#13557xokdvium merged 1 commit intoNixOS:masterfrom Jayman2000:sometimes-build-manual-when-cross-compiling
nix-manual when cross compiling#13557xokdvium merged 1 commit intoNixOS:masterfrom
Jayman2000:sometimes-build-manual-when-cross-compiling
Conversation
Before this change, if you were cross compiling Nix, then the nix-manual subproject would never get built. In some situations, it makes sense to not build the nix-manual subproject when cross compiling. For example, if the build system is x86_64 and the host system is riscv64, then it makes sense to not build the manual. Building the manual requires executing certain build artifacts, and you can’t run x86_64 executables on riscv64 systems. That being said, there are some situations where it does make sense to build the nix-manual subproject when cross compiling. For example, if the build system is x86_64 and the host system is i686, then it doesn’t make sense to not build the manual. You can run i686 executables on x86_64 systems just fine. This change makes it so that the nix-manual subproject will sometimes get built when cross compiling. Specifically, the nix-manual subproject will get built as long as the doc-gen option is enabled and the build system is capable of running host binaries. --- The main motivation behind this change is to fix this Nixpkgs issue [1]. Building pkgs.nixStatic counts as cross compiling Nix, and pkgs.nixStatic is supposed to produce a man output. Building pkgs.nixStatic currently fails because it isn’t actually producing a man output. That issue will go away once this commit gets backported to Nix 2.28.x. [1]: <NixOS/nixpkgs#426410>
nix-manual when cross compiling
Contributor
|
@Jayman2000, thanks! The fix makes sense. It's now clear why this affected only the monolithic build of 2.28 - the top-level meson file isn't used in componentized builds. |
xokdvium
added a commit
that referenced
this pull request
Jul 26, 2025
…3557 Sometimes build `nix-manual` when cross compiling (backport #13557)
13 tasks
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.
Motivation
At the moment, the
nix-manualMeson subproject won’t be built if you’re cross compiling. This pull request makes it so that thenix-manualMeson subproject will be built if you’re cross compiling Nix and the build system is capable of executing host system binaries. (See the commit message for additional details).Context
The main motivation behind this change is to deal with this Nixpkgs issue. Building
pkgs.nixStaticcounts as cross compiling Nix, andpkgs.nixStaticis supposed to produce amanoutput. Buildingpkgs.nixStaticcurrently fails because it isn’t actually producing amanoutput. That issue will go away once this pull request gets backported to Nix 2.28.x.You can verify that this pull request fixes that Nixpkgs issue by doing the following:
Create a file named
nix-static.nixthat contains this Nix expression:Build that expression by running this command:
Make sure that the build fails with exactly one error. The
upstreamVersionattribute should fail to build with an error about the builder not creating amanoutput. TheversionFromThisPRattribute should build successfully.Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.