From de96547c20e786742f9647b0f2b1f36c8e22c543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 9 Apr 2025 07:50:37 +0200 Subject: [PATCH 1/2] docs: update cross compilation section from autotools to meson fixes https://github.com/NixOS/nix/issues/12934 --- doc/manual/source/development/building.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/doc/manual/source/development/building.md b/doc/manual/source/development/building.md index da465d090..748432e52 100644 --- a/doc/manual/source/development/building.md +++ b/doc/manual/source/development/building.md @@ -195,28 +195,14 @@ Nix uses a string with the following format to identify the *system type* or *pl -[-] ``` -It is set when Nix is compiled for the given system, and based on the output of [`config.guess`](https://github.com/nixos/nix/blob/master/config/config.guess) ([upstream](https://git.savannah.gnu.org/cgit/config.git/tree/config.guess)): +It is set when Nix is compiled for the given system, and based on the output of meson's [host_machine information](https://mesonbuild.com/Reference-manual_builtin_host_machine.html)> ``` --[][-] ``` -When Nix is built such that `./configure` is passed any of the `--host`, `--build`, `--target` options, the value is based on the output of [`config.sub`](https://github.com/nixos/nix/blob/master/config/config.sub) ([upstream](https://git.savannah.gnu.org/cgit/config.git/tree/config.sub)): +When cross-compiling Nix with Meson, you need to specify a [cross-file](https://mesonbuild.com/Cross-compilation.html) using the `--cross-file` option. Cross-files define the target architecture and toolchain. -``` --[-]- -``` - -For historic reasons and backward-compatibility, some CPU and OS identifiers are translated from the GNU Autotools naming convention in [`configure.ac`](https://github.com/nixos/nix/blob/master/configure.ac) as follows: - -| `config.guess` | Nix | -|----------------------------|---------------------| -| `amd64` | `x86_64` | -| `i*86` | `i686` | -| `arm6` | `arm6l` | -| `arm7` | `arm7l` | -| `linux-gnu*` | `linux` | -| `linux-musl*` | `linux` | ## Compilation environments From dd8b578ce247220df8e66d62c8c4d7ec6f35eb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 9 Apr 2025 07:50:57 +0200 Subject: [PATCH 2/2] docs/building: fix attribute for nix-cli-ccacheStdenv --- doc/manual/source/development/building.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/manual/source/development/building.md b/doc/manual/source/development/building.md index 748432e52..bf37ff0c4 100644 --- a/doc/manual/source/development/building.md +++ b/doc/manual/source/development/building.md @@ -216,18 +216,18 @@ Nix can be compiled using multiple environments: To build with one of those environments, you can use ```console -$ nix build .#nix-ccacheStdenv +$ nix build .#nix-cli-ccacheStdenv ``` for flake-enabled Nix, or ```console -$ nix-build --attr nix-ccacheStdenv +$ nix-build --attr nix-cli-ccacheStdenv ``` for classic Nix. -You can use any of the other supported environments in place of `nix-ccacheStdenv`. +You can use any of the other supported environments in place of `nix-cli-ccacheStdenv`. ## Editor integration