diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index 678f5a3fe9e6..1f77edf86cb6 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -84,6 +84,10 @@ sub checkCollision { sub findFiles { my ($relName, $target, $baseName, $ignoreCollisions, $checkCollisionContents, $priority) = @_; + if (-f $target) { + die "Path $target is a file and can't be merged into an environment using pkgs.buildEnv!"; + } + # Urgh, hacky... return if $relName eq "/propagated-build-inputs" ||