Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up crate_universe output printing #727

Merged
merged 2 commits into from
May 10, 2021

Conversation

illicitonion
Copy link
Collaborator

This avoids a weird double-printing of errors we used to get.

This avoids a weird double-printing of errors we used to get.
@@ -139,11 +139,10 @@ def _crate_universe_resolve_impl(repository_ctx):
"RUSTC": str(rustc_path),
"RUST_LOG": "info",
},
quiet = False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this make more info print? What does the output look like now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, crate_universe_resolver is a nice quiet binary - it doesn't print anything in the case of successful execution at standard log levels. So if RUST_LOG is set to its default info, the output looks exactly the same.

If you turn up RUST_LOG you'll get unprefixed output like:

INFO: Invocation ID: e2c06156-6684-4403-b42a-b64f112fe233
[2021-05-10T10:08:16Z DEBUG globset] glob converted to regex: Glob { glob: "src/not/a/dir/*", re: "(?-u)^src/not/a/dir/[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([Literal('s'), Literal('r'), Literal('c'), Literal('/'), Literal('n'), Literal('o'), Literal('t'), Literal('/'), Literal('a'), Literal('/'), Literal('d'), Literal('i'), Literal('r'), Literal('/'), ZeroOrMore]) }
[2021-05-10T10:08:16Z DEBUG globset] built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 1 regexes
INFO: Analyzed target //rust/example:example (4 packages loaded, 143 targets configured).

If you get an error, you'll see output like:

INFO: Invocation ID: dccd2236-8d6e-4466-bcd6-ee8d9125b861
Error: Error parsing "/<redacted>/Cargo.toml"

Caused by:
    expected an equals, found a newline at line 12 column 9
INFO: Repository example instantiated at:
  /<redacted>/WORKSPACE:10:15: in <toplevel>
  /<redacted>/workspace.bzl:27:20: in crate_universe
Repository rule crate_universe defined at:
  /<redacted>/crate_universe/defs.bzl:152:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'example':
   Traceback (most recent call last):
	File "/<redacted>/crate_universe/defs.bzl", line 148, column 13, in _crate_universe_resolve_impl
		fail("Error resolving crate_universe deps - see above output for more information")
Error in fail: Error resolving crate_universe deps - see above output for more information
ERROR: Error fetching repository: Traceback (most recent call last):
	File "/<redacted>/crate_universe/defs.bzl", line 148, column 13, in _crate_universe_resolve_impl
		fail("Error resolving crate_universe deps - see above output for more information")
Error in fail: Error resolving crate_universe deps - see above output for more information

@UebelAndre UebelAndre merged commit fdc04e1 into bazelbuild:main May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants