goodbyekansas / nedryland

Nedryland is a collection of utilities and a build system for declaring, building and deploying microservice solutions.
https://goodbyekansas.github.io/nedryland/
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

`doCheck = false;` does not actually turn checks off. #285

Closed simonrainerson closed 1 year ago

simonrainerson commented 2 years ago

This tried to address this: https://github.com/goodbyekansas/nedryland/commit/af4a8a02b63d8733f3b6c0a5db69d5bb3bf6de34 but it had the unintended consequence that checks could not be turned on.

The problem is that we can never hit the or case in drv.doCheck or false. A component that looks like this

{ stdenv }:
let
  pkg = stdenv.mkDerivation {
    name = "example";
    builder = builtins.toFile "builder.sh" ''
      source $stdenv/setup
      mkdir $out
    '';
  };
{
    name = "example";
    package = builtins.trace (pkg.doCheck || pkg.drvAttrs.doCheck) pkg;
}

Will print trace: false Probably because of https://github.com/NixOS/nixpkgs/blob/826c20dcae34f7e3be4d1a638b07fb7d95570ba0/pkgs/stdenv/generic/make-derivation.nix#L201 and https://github.com/NixOS/nixpkgs/blob/826c20dcae34f7e3be4d1a638b07fb7d95570ba0/pkgs/stdenv/generic/make-derivation.nix#L335

Random note: a comment in there mentions doCheck to be "old semantics" and is going away.