Skip to content

Commit 902bf32

Browse files
committed
Allow bypassing the sandbox, as it makes msys sad.
1 parent d200633 commit 902bf32

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

build/ab.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def setdefault(self, name, value):
5555

5656

5757
G = Environment()
58+
G.setdefault("AB_NO_SANDBOX", "")
5859

5960

6061
class PathFinderImpl(PathFinder):
@@ -558,19 +559,23 @@ def emit_rule(self, ins, outs, cmds=[], label=None):
558559
os.makedirs(self.dir, exist_ok=True)
559560
rule = []
560561

561-
sandbox = join(self.dir, "sandbox")
562-
emit(f"rm -rf {sandbox}", into=rule)
563-
emit(
564-
f"{G.PYTHON} build/_sandbox.py --link -s", sandbox, *fins, into=rule
565-
)
566-
for c in cmds:
567-
emit(f"(cd {sandbox} &&", c, ")", into=rule)
568-
emit(
569-
f"{G.PYTHON} build/_sandbox.py --export -s",
570-
sandbox,
571-
*fouts,
572-
into=rule,
573-
)
562+
if G.AB_NO_SANDBOX:
563+
sandbox = join(self.dir, "sandbox")
564+
emit(f"rm -rf {sandbox}", into=rule)
565+
emit(
566+
f"{G.PYTHON} build/_sandbox.py --link -s", sandbox, *fins, into=rule
567+
)
568+
for c in cmds:
569+
emit(f"(cd {sandbox} &&", c, ")", into=rule)
570+
emit(
571+
f"{G.PYTHON} build/_sandbox.py --export -s",
572+
sandbox,
573+
*fouts,
574+
into=rule,
575+
)
576+
else:
577+
for c in cmds:
578+
emit(c, into=rule)
574579

575580
ruletext = "".join(rule)
576581
if len(ruletext) > 7000:

0 commit comments

Comments
 (0)