From c78676a1de147cebad6266fa4f3d27905e41191c Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Sat, 26 Jul 2025 06:49:50 -0400 Subject: [PATCH] Sometimes build nix-manual when cross compiling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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]: (cherry picked from commit 5e407e6abb5738f72b8b5aeeaa003728fe584c2f) --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 49adf9832..842f329e5 100644 --- a/meson.build +++ b/meson.build @@ -25,7 +25,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