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

refactor: provide more detailed error message when wheel installer fails #1724

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion python/pip_install/pip_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,21 @@ def _whl_library_impl(rctx):
timeout = rctx.attr.timeout,
)
if result.return_code:
fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code))
fail((
"whl_library '{name}' wheel_installer failed:\n" +
" command: {cmd}\n" +
" environment:\n{env}\n" +
" return code: {return_code}\n" +
"===== stdout start ====\n{stdout}\n===== stdout end===\n" +
"===== stderr start ====\n{stderr}\n===== stderr end===\n"
).format(
name = rctx.attr.name,
cmd = " ".join([str(a) for a in args]),
env = "\n".join(["{}={}".format(k, v) for k, v in environment.items()]),
return_code = result.return_code,
stdout = result.stdout,
stderr = result.stderr,
))

whl_path = rctx.path(json.decode(rctx.read("whl_file.json"))["whl_file"])
if not rctx.delete("whl_file.json"):
Expand Down
Loading