1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Sometimes build nix-manual when cross compiling

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]: <https://github.com/NixOS/nixpkgs/issues/426410>
This commit is contained in:
Jason Yundt 2025-07-26 06:49:50 -04:00
parent 7f4acb9f10
commit 5e407e6abb

View file

@ -29,7 +29,7 @@ subproject('nix')
if get_option('doc-gen')
subproject('internal-api-docs')
subproject('external-api-docs')
if not meson.is_cross_build()
if meson.can_run_host_binaries()
subproject('nix-manual')
endif
endif