Skip to content

Commit

Permalink
Merge pull request #514 from messense/setup-debug
Browse files Browse the repository at this point in the history
Show `cargo rustc` output when `pip install maturin` from sdist failed
  • Loading branch information
konstin authored Apr 26, 2021
2 parents 8cf3a46 + 6da0470 commit 9f5afe0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def run(self):

cargo_args.extend(["--", "-C", "link-arg=-s"])

metadata = json.loads(subprocess.check_output(cargo_args).splitlines()[-2])
try:
metadata = json.loads(
subprocess.check_output(cargo_args).splitlines()[-2]
)
except subprocess.CalledProcessError as exc:
raise RuntimeError("build maturin failed:\n" + exc.output.decode())
print(metadata)
assert metadata["target"]["name"] == "maturin"
source = metadata["filenames"][0]
Expand Down

0 comments on commit 9f5afe0

Please sign in to comment.