diff options
| author | sternenseemann <sternenseemann@systemli.org> | 2025-07-17 22:19:30 +0200 |
|---|---|---|
| committer | sternenseemann <sternenseemann@systemli.org> | 2025-07-18 00:07:14 +0200 |
| commit | e94e63f060fe0790a465c9afb2ad3c57629bf626 (patch) | |
| tree | b66da6755775d8331e4d1bfb21c7ec3e08f28049 /pkgs/development/python-modules/python-mapnik/python-mapnik_std_optional.patch | |
| parent | 77110a5187ce77aa4e8a3b751a08b8816ff9565f (diff) | |
tests.srcOnly: use equivalent input attrs instead of drvAttrs
The ability to use srcOnly on derivations and as a builder can be
formulated like this: Given a derivation `drv` with the expression:
stdenv.mkDerivation {
name = "drv";
…
}
We can transform it to
srcOnly {
stdenv = stdenv;
name = "drv";
…
}
and expect to get the same result as `srcOnly drv`.
This commit changes tests.srcOnly to test this assumption. The
arguments effectively passed to mkDerivation are computed using
getEquivAttrs which then also records the used stdenv for the benefit
of srcOnly.
This is better than using drvAttrs like before because there is actually
no guarantee that drvAttrs is the same as what was passed to
stdenv.mkDerivation. mkDerivation may transform arguments before passing
them on to builtins.derivation. For example, it performs extra
checks on `env` as well as consistency checks with the top level
argument. This can even lead to issues with srcOnly:
https://github.com/NixOS/nixpkgs/issues/269539
Furthermore, the drvAttrs check really only checks something that is
practically statically guaranteed by srcOnly internals before this
commit (assuming that drvAttrs doesn't contain an attribute also named
drvAttrs):
args = attrs.drvAttrs or attrs;
Diffstat (limited to 'pkgs/development/python-modules/python-mapnik/python-mapnik_std_optional.patch')
0 files changed, 0 insertions, 0 deletions
