GNU bug report logs - #77653
[PATCH 0/4] Add WASM toolchain, wasi-libc, and browser WASM sandbox support

Previous Next

Package: guix-patches;

Reported by: Ian Eure <ian <at> retrospec.tv>

Date: Tue, 8 Apr 2025 19:58:02 UTC

Severity: normal

Tags: patch

Full log


Message #35 received at 77653 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ian Eure <ian <at> retrospec.tv>
Cc: 77653 <at> debbugs.gnu.org
Subject: Re: [bug#77653] [PATCH 2/4] gnu: Add wasm32-wasi-clang-runtime.
Date: Fri, 25 Apr 2025 17:05:52 +0900
Hi,

Ian Eure <ian <at> retrospec.tv> writes:

> * gnu/packages/wasm.scm (wasm32-wasi-clang-runtime): New variable.

[...]

> +(define-public wasm32-wasi-clang-runtime
> +  (package (inherit clang-runtime-16)

This reminds me that this should be documented, but when creating
variants (packages issued from the same source but with different build
flags, say), you must use package/inherit for the grafts machinery to
work correctly.

> +    (native-inputs
> +     (list clang-16
> +           wasi-libc))

I'd format these on one line, like you did below, since there are less
than 5 and it fits.

> +    (inputs (list llvm-16))
> +    (arguments
> +     (list
> +      #:build-type "Release"
> +      #:tests? #f

Need an explanatory comment, e.g.:   ;no test suite

> +      ;; Stripping binaries breaks wasm linking, resulting in the following
> +      ;; error: "archive has no index; run ranlib to add one".
> +      #:strip-binaries? #f
> +      #:configure-flags
> +      #~(list "-DCMAKE_C_COMPILER=clang"
> +              "-DCMAKE_C_COMPILER_TARGET=wasm32-wasi"
> +              (string-append
> +               "-DCMAKE_SYSROOT=" #$wasi-libc "/wasm32-wasi")
> +              (string-append
> +               "-DCMAKE_C_FLAGS=-I " #$wasi-libc "/wasm32-wasi/include")

As Z572 mentioned, this shouldn't reference the packages directly, to be
input-rewrite friendly.

-- 
Thanks,
Maxim




This bug report was last modified 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.