Skip to content

Commit

Permalink
Flip back to verbose output in nixpkgs_package
Browse files Browse the repository at this point in the history
Historically, the user was able to see the output of `nix-build` in
real-time. This was useful, because building derivations can take
a long time. Even if the binary cache can be used for all derivations,
downloading can take a long time. Then tweag#77 came along, which made
`nix-build` quiet as a side-effect. Later, tweag#86 subsumed tweag#77 with
a simpler implementation. However, people argued in tweag#82 that being
quiet is the right thing to do, because otherwise workspace rule
output can garble the output of `bazel query` and break scripts. So we
stuck to quiet output and this was called out in the v0.6 changelog.

It turns out that the problem affects other rule authors too (see
bazel-contrib/rules_nodejs#583). This led to bazelbuild/bazel#10611,
which fixes the problem for everyone, and shipped in Bazel 3.0. Now,
all workspace rule output goes to `stderr`, so scripts calling `bazel
query` shouldn't be affected.

Given this upstream change, my position is that being verbose is now
the right thing to do. If tweag#85 is implemented, then being verbose
should remain the default, at least for users of Bazel 3.0 onwards.
Because even small packages may have a large set of dependencies that
must be downloaded first. It's nigh impossible for the author of the
workspace file to anticipate the state of the user's cache.
  • Loading branch information
mboes authored and mergify-bot committed Apr 15, 2020
1 parent a539282 commit fcd60e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def _nixpkgs_package_impl(repository_ctx):
failure_message = "Cannot build Nix attribute '{}'.".format(
repository_ctx.attr.attribute_path,
),
quiet = False,
timeout = timeout,
)
output_path = exec_result.stdout.splitlines()[-1]
Expand Down

0 comments on commit fcd60e9

Please sign in to comment.