Skip to content

strictDeps breaks libs in checkInputs #161570

@symphorien

Description

@symphorien

Describe the bug

checkInputs are added to nativeBuildInputs but not buildInputs when doCheck is set, so libs added to checkInputs cannot be found by compilers when strictDeps is true.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/make-derivation.nix#L150-L151

Steps To Reproduce

with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "whatever";
  checkInputs = [ zlib ];
  nativeBuildInputs = [ pkg-config ];
  doCheck = true;
  strictDeps = true;
  buildCommand = ''
    pkg-config --cflags zlib
    touch $out
  '';
}

When strictDeps is set, pkg-config fails to find zlib, whereas it finds it without strictDeps.

Note: needing libs in checkInputs is very common in ocamlPackages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions