NixOS / ofborg

@ofborg tooling automation https://monitoring.ofborg.org/dashboard/db/ofborg

Home Page:https://ofborg.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evaluation check does not consider `passthru` and thus `passthru.tests`

FRidh opened this issue · comments

The evaluation check does not evaluate the passthru of derivations. Therefore, if there are for example tests, but the derivations don't get build, any evaluation error in the tests is not seen either.

In this PR there was a force push in which a certain parameter nixosTests was forgotten.

I just hit this pain for passthru.updateScript having evaluation failures that were causing r-ryantm to not run any updatescript updates :(

NixOS/nixpkgs#217968

Instead of assigning meaning to passthru, which is still an implementation detail, we should assign meaning to specific package attributes, such as pkg.meta, pkg.tests and pkg.updateScript.
This passthru business is going to look very silly as soon as we normalize packages that aren't tied to a single top-ish derivation, whether that's because of RFC 92, separate documentation derivations or good engineering practices.
I'll tolerate the use of the term, but maybe call them passthru package attributes? That distances the concept passthru from the code passthru a bit and eases us into the more sensible package attribute term.

commented

I don't think renaming passthru will change something. The average nixpkgs contributor does not really care if it is an implementation detail or not. It works and is the defacto standard. Moving updateScripts and tests one level higher sounds like a good idea but it should not trigger a rebuild of the package.

We don't need to rename or move anything. passthru is an ok name for the mkDerivation behavior that we need. It's not pretty, sure, but it gets the job done. We should not move updateScripts anywhere. It is already in the correct place in the mkDerivation arguments, because as you say, it should not trigger a rebuild, and it is also already in the correct place in the output, in the package attributes.
All I'm really trying to say is that we should ignore the passthru attribute in the returned package, or in other words, we should define pkg = mkDerivation { passthru.updateScript = ...; }, but read pkg.updateScript.