Skip to content

Commit

Permalink
reformat with one sentence per line
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Joseph committed Apr 24, 2023
1 parent d7326de commit 9d3d7a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/stdenv/meta.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,20 @@ Attribute Set `lib.platforms` defines [various common lists](https://github.com/

### `badPlatforms` {#var-meta-badPlatforms}

The list of Nix platform types on which the package is known not to be buildable. Hydra will never create prebuilt binaries for these platform types, even if they are in `meta.platforms`. In general it is preferable to set `meta.platforms = lib.platforms.all` and then exclude any platforms on which the package is known not to build. For example, a package which requires dynamic linking and cannot be linked statically could use this:
The list of Nix platform types on which the package is known not to be buildable.
Hydra will never create prebuilt binaries for these platform types, even if they are in `meta.platforms`.
In general it is preferable to set `meta.platforms = lib.platforms.all` and then exclude any platforms on which the package is known not to build.
For example, a package which requires dynamic linking and cannot be linked statically could use this:

```nix
meta.platforms = lib.platforms.all;
meta.badPlatforms = [ lib.systems.inspect.patterns.isStatic ];
```

The `lib.meta.availableOn` function can be used to test whether or not a package is available (i.e. buildable) on a given platform. Some packages use this to automatically detect the maximum set of features with which they can be built. For example, `systemd` requires dynamic linking, and has a `meta.badPlatforms` setting similar to the one above. Packages which can be built with or without `systemd` support will use `lib.meta.availableOn` to detect whether or not `systemd` is available on the `hostPlatform` for which they are being built; if it is not available (e.g. due to a statically-linked host platform like `pkgsStatic`) this support will be disabled by default.
The `lib.meta.availableOn` function can be used to test whether or not a package is available (i.e. buildable) on a given platform.
Some packages use this to automatically detect the maximum set of features with which they can be built.
For example, `systemd` requires dynamic linking, and has a `meta.badPlatforms` setting similar to the one above.
Packages which can be built with or without `systemd` support will use `lib.meta.availableOn` to detect whether or not `systemd` is available on the `hostPlatform` for which they are being built; if it is not available (e.g. due to a statically-linked host platform like `pkgsStatic`) this support will be disabled by default.

### `tests` {#var-meta-tests}

Expand Down

0 comments on commit 9d3d7a3

Please sign in to comment.