summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-04-08 00:33:11 -0700
committerAdam Joseph <adam@westernsemico.com>2023-04-11 13:21:51 -0700
commit19d48a925778a524a970ca06cabc45ade3f82474 (patch)
tree1256ffb5b208eb8f96443a8e18a8e6435dabb61b /doc
parent0d3d2a2231c762e59ac876b3920e569d5cf40646 (diff)
doc/stdenv/meta.chapter.md: explain difference between broken and badPlatforms
There has been a longstanding ambiguity between `broken` and
`badPlatforms`, which seem to serve overlapping purposes.

This commit adds to the documentation two examples of constraints
which cannot be expressed by `platforms` and `badPlatforms`.

This commit also mentions `NIXPKGS_ALLOW_BROKEN=1` for overriding
`broken`.
Diffstat (limited to 'doc')
-rw-r--r--doc/stdenv/meta.chapter.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/stdenv/meta.chapter.md b/doc/stdenv/meta.chapter.md
index 0b4777efdb8c9..f4e9a5d4f9b11 100644
--- a/doc/stdenv/meta.chapter.md
+++ b/doc/stdenv/meta.chapter.md
@@ -182,7 +182,9 @@ meta.hydraPlatforms = [];
 
 ### `broken` {#var-meta-broken}
 
-If set to `true`, the package is marked as "broken", meaning that it won’t show up in `nix-env -qa`, and cannot be built or installed. Such packages should be removed from Nixpkgs eventually unless they are fixed.
+If set to `true`, the package is marked as "broken", meaning that it won’t show up in `nix-env -qa`, and cannot be built or installed unless the environment variable `NIXPKGS_ALLOW_BROKEN` is set. Such unconditionally-broken packages should be removed from Nixpkgs eventually unless they are fixed.
+
+The value of this attribute can depend on a package's arguments, including `stdenv`.  This means that `broken` can be used to express constraints such as "does not cross compile" (`meta.broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)`) or "broken if all of a certain set of its dependencies are broken".  This makes `broken` strictly more powerful than `meta.badPlatforms`.  However `meta.availableOn` currently examines only `meta.platforms` and `meta.badPlatforms`, so `meta.broken` does not influence the default values for optional dependencies.
 
 ## Licenses {#sec-meta-license}