Skip to content

Commit a7733c2

Browse files
committed
GH-137049: Stop creating an empty Modules/Setup.local when doing WASI builds
1 parent 777159f commit a7733c2

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Stop creating an empty Modules/Setup.local when doing WASI builds as it's
2+
unnecessary.

Tools/wasm/wasi/__main__.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
CROSS_BUILD_DIR = CHECKOUT / "cross-build"
2323
BUILD_DIR = CROSS_BUILD_DIR / "build"
2424

25-
LOCAL_SETUP = CHECKOUT / "Modules" / "Setup.local"
26-
LOCAL_SETUP_MARKER = "# Generated by Tools/wasm/wasi.py\n".encode("utf-8")
27-
2825
WASMTIME_VAR_NAME = "WASMTIME"
2926
WASMTIME_HOST_RUNNER_VAR = f"{{{WASMTIME_VAR_NAME}}}"
3027

@@ -140,12 +137,6 @@ def build_python_is_pydebug():
140137
@subdir(BUILD_DIR, clean_ok=True)
141138
def configure_build_python(context, working_dir):
142139
"""Configure the build/host Python."""
143-
if LOCAL_SETUP.exists():
144-
print(f"👍 {LOCAL_SETUP} exists ...")
145-
else:
146-
print(f"📝 Touching {LOCAL_SETUP} ...")
147-
LOCAL_SETUP.write_bytes(LOCAL_SETUP_MARKER)
148-
149140
configure = [os.path.relpath(CHECKOUT / 'configure', working_dir)]
150141
if context.args:
151142
configure.extend(context.args)
@@ -215,6 +206,10 @@ def configure_wasi_python(context, working_dir):
215206
"https://github.com/WebAssembly/wasi-sdk and/or "
216207
"specify via $WASI_SDK_PATH or --wasi-sdk")
217208

209+
setup_local = CHECKOUT / "Modules" / "Setup.local"
210+
if setup_local.exists():
211+
print(f"⚠️ {setup_local.relative_to(CHECKOUT)} exists")
212+
218213
config_site = os.fsdecode(CHECKOUT / "Tools" / "wasm" / "wasi" / "config.site-wasm32-wasi")
219214

220215
wasi_build_dir = working_dir.relative_to(CHECKOUT)
@@ -296,11 +291,6 @@ def clean_contents(context):
296291
print(f"🧹 Deleting {CROSS_BUILD_DIR} ...")
297292
shutil.rmtree(CROSS_BUILD_DIR)
298293

299-
if LOCAL_SETUP.exists():
300-
with LOCAL_SETUP.open("rb") as file:
301-
if file.read(len(LOCAL_SETUP_MARKER)) == LOCAL_SETUP_MARKER:
302-
print(f"🧹 Deleting generated {LOCAL_SETUP} ...")
303-
304294

305295
def main():
306296
default_host_runner = (f"{WASMTIME_HOST_RUNNER_VAR} run "

0 commit comments

Comments
 (0)