New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outputHash can be null when outputHashAlgo is provided #1384

Closed
ryantrinkle opened this Issue May 12, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@ryantrinkle
Contributor

ryantrinkle commented May 12, 2017

As a result, fetchurl as currently provided by nixpkgs can be invoked impurely, e.g.: fetchurl { url = "http://www.time.gov/actualtime.cgi"; sha256 = null; }.

Thanks to @grahamc for putting together this example:

let
  pkgs = import <nixpkgs> {};
in pkgs.stdenv.mkDerivation {
  name = "hi";

  phases = [ "buildPhase" ];
  buildInputs = with pkgs; [
    curl
  ];
  buildPhase = ''
    curl http://icanhazip.com > $out
  '';

  outputHashAlgo = "sha256";
  outputHash = null;
  outputHashMode = "recursive";
}

Enabling sandboxing prevents the derivation from building, of course, which prevents the impurity.

@edolstra edolstra closed this in c05d9ae May 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment