Skip to content

Commit 4ae8f57

Browse files
Jonathon Belottimattem
andauthored
More verbose 'fail' msgs. Don't rely on executed tools err msg (#737)
* More verbose 'fail' msgs. Don't rely on executed tools err msg * run buildifier Co-authored-by: Matt Mackay <[email protected]>
1 parent 09457c7 commit 4ae8f57

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

python/repositories.bzl

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ def _python_repository_impl(rctx):
6666
working_directory = working_directory,
6767
)
6868
if make_result.return_code:
69-
fail(make_result.stderr)
69+
fail_msg = (
70+
"Failed to compile 'zstd' from source for use in Python interpreter extraction. " +
71+
"'make' error message: {}".format(make_result.stderr)
72+
)
73+
fail(fail_msg)
7074
zstd = "{working_directory}/zstd".format(working_directory = working_directory)
7175
unzstd = "./unzstd"
7276
rctx.symlink(zstd, unzstd)
@@ -79,7 +83,11 @@ def _python_repository_impl(rctx):
7983
"--file={}".format(release_filename),
8084
])
8185
if exec_result.return_code:
82-
fail(exec_result.stderr)
86+
fail_msg = (
87+
"Failed to extract Python interpreter from '{}'. ".format(release_filename) +
88+
"'tar' error message: {}".format(exec_result.stderr)
89+
)
90+
fail(fail_msg)
8391
else:
8492
rctx.download_and_extract(
8593
url = url,
@@ -101,7 +109,10 @@ def _python_repository_impl(rctx):
101109
if "windows" not in rctx.os.name:
102110
exec_result = rctx.execute(["chmod", "-R", "ugo-w", "lib"])
103111
if exec_result.return_code:
104-
fail(exec_result.stderr)
112+
fail_msg = "Failed to make interpreter installation read-only. 'chmod' error msg: {}".format(
113+
exec_result.stderr,
114+
)
115+
fail(fail_msg)
105116

106117
python_bin = "python.exe" if ("windows" in platform) else "bin/python3"
107118

0 commit comments

Comments
 (0)