Skip to content

Commit 3b9e6d9

Browse files
committed
Context arguments should come first, since this is the argument common to most functions.
cc @Profpatsch
1 parent 54470e1 commit 3b9e6d9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nixpkgs/nixpkgs.bzl

+6-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def _nixpkgs_package_impl(repository_ctx):
8686
fail(strFailureImplicitNixpkgs)
8787

8888
nix_build_path = _executable_path(
89-
"nix-build", repository_ctx,
89+
repository_ctx,
90+
"nix-build",
9091
extra_msg = "See: https://nixos.org/nix/"
9192
)
9293
nix_build = [nix_build_path] + expr_args
@@ -106,7 +107,7 @@ def _nixpkgs_package_impl(repository_ctx):
106107

107108
# Build a forest of symlinks (like new_local_package() does) to the
108109
# Nix store.
109-
_symlink_children(output_path, repository_ctx)
110+
_symlink_children(repository_ctx, output_path)
110111

111112

112113
_nixpkgs_package = repository_rule(
@@ -141,11 +142,11 @@ def nixpkgs_package(*args, **kwargs):
141142
else:
142143
_nixpkgs_package(*args, **kwargs)
143144

144-
def _symlink_children(target_dir, repository_ctx):
145+
def _symlink_children(repository_ctx, target_dir):
145146
"""Create a symlink to all children of `target_dir` in the current
146147
build directory."""
147148
find_args = [
148-
_executable_path("find", repository_ctx),
149+
_executable_path(repository_ctx, "find"),
149150
target_dir,
150151
"-maxdepth", "1",
151152
# otherwise the directory is printed as well
@@ -162,7 +163,7 @@ def _symlink_children(target_dir, repository_ctx):
162163
_execute_error(find_res)
163164

164165

165-
def _executable_path(exe_name, repository_ctx, extra_msg=""):
166+
def _executable_path(repository_ctx, exe_name, extra_msg=""):
166167
"""Try to find the executable, fail with an error."""
167168
path = repository_ctx.which(exe_name)
168169
if path == None:

0 commit comments

Comments
 (0)