Bug 1810627 - Allow to build without a wasi sysroot. r?build
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 14 Jan 2023 22:08:44 +0000 (07:08 +0900)
committerMike Hommey <glandium@debian.org>
Tue, 17 Jan 2023 20:33:36 +0000 (20:33 +0000)
On e.g. Debian unstable, the wasi SDK is available via packages in a
multiarch fashion, which doesn't require the --sysroot flag being passed
to the compiler.

Differential Revision: https://phabricator.services.mozilla.com/D166978

Gbp-Pq: Topic fixes
Gbp-Pq: Name Bug-1810627-Allow-to-build-without-a-wasi-sysroot.-r.patch

toolkit/moz.configure

index 4c356e61b2f9341897ac71dd6694d2363e22d604..33048062893e8b8df9e11314631f1b88711eff97 100644 (file)
@@ -2412,21 +2412,10 @@ with only_when(requires_wasm_sandboxing & compile_environment):
     @depends(
         "--with-wasi-sysroot",
         bootstrap_path("sysroot-wasm32-wasi", when=bootstrap_wasi_sysroot),
-        "--with-wasm-sandboxed-libraries",
     )
     @imports("os")
-    def wasi_sysroot(wasi_sysroot, bootstrapped_sysroot, sandboxed_libs):
+    def wasi_sysroot(wasi_sysroot, bootstrapped_sysroot):
         if not wasi_sysroot:
-            if not bootstrapped_sysroot:
-                suggest_disable = ""
-                if sandboxed_libs.origin == "default":
-                    suggest_disable = (
-                        " Or build with --without-wasm-sandboxed-libraries."
-                    )
-                die(
-                    "Cannot find a wasi sysroot. Please give its location with "
-                    "--with-wasi-sysroot." + suggest_disable
-                )
             return bootstrapped_sysroot
 
         wasi_sysroot = wasi_sysroot[0]
@@ -2439,8 +2428,10 @@ with only_when(requires_wasm_sandboxing & compile_environment):
 
     @depends(wasi_sysroot)
     def wasi_sysroot_flags(wasi_sysroot):
-        log.info("Using wasi sysroot in %s", wasi_sysroot)
-        return ["--sysroot=%s" % wasi_sysroot]
+        if wasi_sysroot:
+            log.info("Using wasi sysroot in %s", wasi_sysroot)
+            return ["--sysroot=%s" % wasi_sysroot]
+        return []
 
     set_config("WASI_SYSROOT", wasi_sysroot)