| 
23 | 23 | BUILD_DIR = CROSS_BUILD_DIR / "build"  | 
24 | 24 | 
 
  | 
25 | 25 | LOCAL_SETUP = CHECKOUT / "Modules" / "Setup.local"  | 
26 |  | -LOCAL_SETUP_MARKER = "# Generated by Tools/wasm/wasi.py\n".encode("utf-8")  | 
 | 26 | +LOCAL_SETUP_MARKER = ("# Generated by Tools/wasm/wasi .\n"  | 
 | 27 | +                      "# Required to statically build extension modules.").encode("utf-8")  | 
27 | 28 | 
 
  | 
28 | 29 | WASMTIME_VAR_NAME = "WASMTIME"  | 
29 | 30 | WASMTIME_HOST_RUNNER_VAR = f"{{{WASMTIME_VAR_NAME}}}"  | 
@@ -141,9 +142,12 @@ def build_python_is_pydebug():  | 
141 | 142 | def configure_build_python(context, working_dir):  | 
142 | 143 |     """Configure the build/host Python."""  | 
143 | 144 |     if LOCAL_SETUP.exists():  | 
144 |  | -        print(f"👍 {LOCAL_SETUP} exists ...")  | 
 | 145 | +        if LOCAL_SETUP.read_bytes() == LOCAL_SETUP_MARKER:  | 
 | 146 | +            print(f"👍 {LOCAL_SETUP} exists ...")  | 
 | 147 | +        else:  | 
 | 148 | +            print(f"⚠️ {LOCAL_SETUP} exists, but has unexpected contents")  | 
145 | 149 |     else:  | 
146 |  | -        print(f"📝 Touching {LOCAL_SETUP} ...")  | 
 | 150 | +        print(f"📝 Creating {LOCAL_SETUP} ...")  | 
147 | 151 |         LOCAL_SETUP.write_bytes(LOCAL_SETUP_MARKER)  | 
148 | 152 | 
 
  | 
149 | 153 |     configure = [os.path.relpath(CHECKOUT / 'configure', working_dir)]  | 
@@ -297,9 +301,8 @@ def clean_contents(context):  | 
297 | 301 |         shutil.rmtree(CROSS_BUILD_DIR)  | 
298 | 302 | 
 
  | 
299 | 303 |     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} ...")  | 
 | 304 | +        if LOCAL_SETUP.read_bytes() == LOCAL_SETUP_MARKER:  | 
 | 305 | +            print(f"🧹 Deleting generated {LOCAL_SETUP} ...")  | 
303 | 306 | 
 
  | 
304 | 307 | 
 
  | 
305 | 308 | def main():  | 
 | 
0 commit comments