From 20ed781b6f800f1c6db6bfbdfc8da4e2af66a5d5 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sun, 15 Jan 2023 07:08:44 +0900 Subject: [PATCH] Bug 1810627 - Allow to build without a wasi sysroot. r?build 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 | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 4c356e61b2f..33048062893 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -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) -- 2.30.2