Try and fix sandboxing.

This commit is contained in:
David Given
2025-10-05 21:02:17 +02:00
parent 3949971546
commit 6026dcd86d
2 changed files with 11 additions and 6 deletions

View File

@@ -8,17 +8,21 @@ ifeq ($(BUILDTYPE),)
endif
export BUILDTYPE
OPTFLAGS = -g -O3
ifeq ($(BUILDTYPE),windows)
MINGW = x86_64-w64-mingw32-
CC = $(MINGW)gcc
CXX = $(MINGW)g++
CFLAGS += -g -O3 \
CFLAGS += \
$(OPTFLAGS) \
-ffunction-sections \
-fdata-sections \
-Wno-attributes \
-Wa,-mbig-obj \
-static
CXXFLAGS += \
$(OPTFLAGS) \
-std=c++23 \
-Wno-deprecated-enum-float-conversion \
-Wno-deprecated-enum-enum-conversion \
@@ -35,16 +39,17 @@ ifeq ($(BUILDTYPE),windows)
PROTOC_SEPARATOR = ;
EXT = .exe
AB_NO_SANDBOX = yes
AB_SANDBOX = no
else
CC = clang
CXX = clang++
CFLAGS = -g -O3 \
CFLAGS = \
$(OPTFLAGS) \
-I/opt/homebrew/include -I/usr/local/include \
-Wno-unknown-warning-option
CXXFLAGS = \
$(OPTFLAGS) \
-std=c++23 \
-g -O3 \
-fexperimental-library \
-I/opt/homebrew/include -I/usr/local/include \
-Wformat \

View File

@@ -55,7 +55,7 @@ class Environment(types.SimpleNamespace):
G = Environment()
G.setdefault("AB_NO_SANDBOX", "")
G.setdefault("AB_SANDBOX", "yes")
class PathFinderImpl(PathFinder):
@@ -559,7 +559,7 @@ def emit_rule(self, ins, outs, cmds=[], label=None):
os.makedirs(self.dir, exist_ok=True)
rule = []
if not G.AB_NO_SANDBOX:
if G.AB_SANDBOX == "yes":
sandbox = join(self.dir, "sandbox")
emit(f"rm -rf {sandbox}", into=rule)
emit(