From b3df96c835d2404b2c0348b1536b99a40239c2de Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Mon, 6 Dec 2021 01:19:58 -0500 Subject: [PATCH] mzbuild: fix building from a subdirectory of the repo --- misc/python/materialize/mzbuild.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/misc/python/materialize/mzbuild.py b/misc/python/materialize/mzbuild.py index ade7843d9351c..6932e8ac57138 100644 --- a/misc/python/materialize/mzbuild.py +++ b/misc/python/materialize/mzbuild.py @@ -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 @@ -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("{"):