Skip to content

Commit

Permalink
Testing nix-build using type -p
Browse files Browse the repository at this point in the history
Using the `type -p` bash builtin instead of `nix-build --version` to
test whether nix-build is in `$PATH`. This results in a ~x4 speedup
while still compatible with windows, darwin and linux.
  • Loading branch information
picnoir committed Jan 28, 2019
1 parent df821c3 commit f27220b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ nixpkgs_local_repository = repository_rule(
)

def _is_supported_platform(repository_ctx):
return repository_ctx.execute(["nix-build","--version"]).return_code == 0
return repository_ctx.execute(["bash", "-c", "type -p nix-build"]).return_code == 0

def _nixpkgs_package_impl(repository_ctx):
repository = repository_ctx.attr.repository
Expand Down

0 comments on commit f27220b

Please sign in to comment.