Skip to content

Commit

Permalink
Add quiet attribute
Browse files Browse the repository at this point in the history
`nixpkgs_package` can now optionally be quiet, like it is in v0.6.
This is useful for users of Bazel older than v3.0 who pipe the output
of `bazel query` to scripts and don't want workspace rules to pollute
the output of the query.

Closes tweag#85
  • Loading branch information
mboes authored and mergify-bot committed Apr 15, 2020
1 parent fcd60e9 commit 0680553
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _nixpkgs_package_impl(repository_ctx):
failure_message = "Cannot build Nix attribute '{}'.".format(
repository_ctx.attr.attribute_path,
),
quiet = False,
quiet = repository_ctx.attr.quiet,
timeout = timeout,
)
output_path = exec_result.stdout.splitlines()[-1]
Expand Down Expand Up @@ -202,6 +202,7 @@ _nixpkgs_package = repository_rule(
"build_file": attr.label(),
"build_file_content": attr.string(),
"nixopts": attr.string_list(),
"quiet": attr.bool(),
"fail_not_supported": attr.bool(default = True, doc = """
If set to True (default) this rule will fail on platforms which do not support Nix (e.g. Windows). If set to False calling this rule will succeed but no output will be generated.
"""),
Expand Down

0 comments on commit 0680553

Please sign in to comment.