Skip to content

Commit

Permalink
callCabal2nix: Fix filtering for non-cleanSourceable sources.
Browse files Browse the repository at this point in the history
What was here before wasn't correct anyway, and now it works in
restricted mode.

Fixes #35207
  • Loading branch information
shlevy committed Feb 28, 2018
1 parent edf0a76 commit 7f623cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
14 changes: 0 additions & 14 deletions pkgs/build-support/safe-discard-string-context.nix

This file was deleted.

15 changes: 7 additions & 8 deletions pkgs/development/haskell-modules/make-package-set.nix
Expand Up @@ -148,14 +148,13 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
callCabal2nix = name: src: args:
overrideCabal (self.callPackage (haskellSrc2nix {
inherit name;
src = pkgs.lib.cleanSourceWith
{ src = if pkgs.lib.canCleanSource src
then src
else pkgs.safeDiscardStringContext src;
filter = path: type:
pkgs.lib.hasSuffix "${name}.cabal" path ||
pkgs.lib.hasSuffix "package.yaml" path;
};
src =
let filter = path: type:
pkgs.lib.hasSuffix "${name}.cabal" path ||
baseNameOf path == "package.yaml";
in if pkgs.lib.canCleanSource src
then pkgs.lib.cleanSourceWith { inherit src filter; }
else src;
}) args) (_: { inherit src; });

# : { root : Path
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -20842,8 +20842,6 @@ with pkgs;

tlwg = callPackage ../data/fonts/tlwg { };

safeDiscardStringContext = callPackage ../build-support/safe-discard-string-context.nix { };

simplehttp2server = callPackage ../servers/simplehttp2server { };

diceware = callPackage ../tools/security/diceware { };
Expand Down

0 comments on commit 7f623cf

Please sign in to comment.