buildEnv's builder.pl reads all inputs from environment variables,
which is incompatible with structuredAttrs (values go into a JSON file
instead). Document this known failure as a test.
Add derivations that actually build a buildEnv and verify the output tree.
Exposed as passthru.buildTests so they can be built individually or all at once.
- basic-symlinking: single package produces correct symlink structure
- pathsToLink: only specified subdirectories appear in output
- extraPrefix: output is rooted under the specified prefix
- postBuild: shell commands execute after the symlink tree
- ignoreCollisions: duplicate paths succeed when ignoreCollisions=true
Verify that:
- derivationArgs attributes reach the underlying mkDerivation (tested via allowSubstitutes overriding the default false)
- The backward-compat layer for top-level nativeBuildInputs still works (these are forwarded through compatArgs)
buildEnv merges passthru from three sources:
`{ inherit paths; } // derivationArgs.passthru // passthru`
Verify that:
- Auto-injected paths are present in passthru
- derivationArgs.passthru attributes are preserved
- Direct passthru attributes are preserved
- Direct passthru takes precedence over derivationArgs.passthru
Verify that overrideAttrs on a buildEnv result:
- Can modify passthru attributes
- Preserves the derivation name
- Produces a different derivation when a build-affecting attribute (postBuild) is changed
This is the core new capability of the PR: `buildEnv` now accepts a function `(finalAttrs: { ... })` enabling self-referencing attributes.
Verify that finalAttrs.name is accessible from within the argument function.
buildEnv stashes `paths` into `passthru.paths` (rather than passing it directly as a derivation attribute) to prevent unexpected string context pollution. Verify that:
- paths are accessible via passthru.paths
- passthru.paths can be overridden with overrideAttrs
Specify `extraPathsFrom` as a string using `lib.optionalString` instead of a singleton list using `lib.optional` to align with the current behavior of the Perl build script.
Verify that:
- `name` argument is used directly as the derivation name
- `pname` + `version` composes into the derivation name
- Omitting all three triggers the buildEnv-specific assertion
The assertion test uses `builtins.tryEval` + `builtins.seq` to force evaluation of .drvPath and confirm it throws.
Add an eval-time test harness for buildEnv following the pattern established by `tests.overriding`.
Uses `lib.runTests` to compare expr/expected pairs, and the buildCommand reports pass/fail.
No tests yet; subsequent commits add them individually.