-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Docs: fix "building" documentation w.r.t. meson #12977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -195,28 +195,14 @@ Nix uses a string with the following format to identify the *system type* or *pl | |||||||
<cpu>-<os>[-<abi>] | ||||||||
``` | ||||||||
|
||||||||
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)> | ||||||||
|
||||||||
``` | ||||||||
<cpu>-<vendor>-<os>[<version>][-<abi>] | ||||||||
``` | ||||||||
|
||||||||
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. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section isn't really about cross compiling, so I'm not sure that we need to be entirely specific in this particular place, but it'd be good to catch a somewhat lost reader here. Doing all this is quite the detour if you're not doing it for local dev. |
||||||||
|
||||||||
``` | ||||||||
<cpu>-<vendor>[-<kernel>]-<os> | ||||||||
``` | ||||||||
|
||||||||
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` | | ||||||||
Comment on lines
-206
to
-219
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should document how the host_machine.cpu_family() + '-' + host_machine.system() currently, but I recall there was an issue pointing out this cases a regression with Power CPUs, and responded that a PR making a special case would be welcome. That is the sort of thing we'd document here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #12769 this is the issue I was thinking of. |
||||||||
|
||||||||
## Compilation environments | ||||||||
|
||||||||
|
@@ -230,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 | ||||||||
|
||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should point people to the cross flake outputs here (e.g.
nix build .#nix-everything-riscv64-unknown-linux-gnu
).