Skip to content

Commit

Permalink
mzbuild: fix building from a subdirectory of the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
benesch committed Dec 6, 2021
1 parent 1d51a74 commit b3df96c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions misc/python/materialize/mzbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ def build(self) -> None:
# down CI, since we're packaging these binaries up into Docker
# images and shipping them around. A bit unfortunate, since it'd be
# nice to have useful backtraces if the binary crashes.
spawn.runv([*self.rd.tool("strip"), "--strip-debug", self.path / self.bin])
spawn.runv(
[*self.rd.tool("strip"), "--strip-debug", self.path / self.bin],
cwd=self.rd.root,
)
else:
# Even if we've been asked not to strip the binary, remove the
# `.debug_pubnames` and `.debug_pubtypes` sections. These are just
Expand All @@ -267,11 +270,14 @@ def build(self) -> None:
"-R",
".debug_pubtypes",
self.path / self.bin,
]
],
cwd=self.rd.root,
)
if self.extract:
output = spawn.capture(
cargo_build + ["--message-format=json"], unicode=True
cargo_build + ["--message-format=json"],
unicode=True,
cwd=self.rd.root,
)
for line in output.split("\n"):
if line.strip() == "" or not line.startswith("{"):
Expand Down

0 comments on commit b3df96c

Please sign in to comment.