unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#64179] [PATCH] gnu: Add wasm-micro-runtime.
@ 2023-06-19 21:56 Felix Lechner via Guix-patches via
  2023-09-06 13:55 ` Maxim Cournoyer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-06-19 21:56 UTC (permalink / raw)
  To: 64179; +Cc: Felix Lechner

* gnu/packages/web.scm (wasm-micro-runtime): New variable.
---
 gnu/packages/web.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index f5b6c8cd2f..cfd3ae2d30 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -62,6 +62,7 @@
 ;;; Copyright © 2023 Paul A. Patience <paul@apatience.com>
 ;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
 ;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
+;;; Copyright © 2023 Felix Lechner <felix.lechner@lease-up.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -111,6 +112,7 @@ (define-module (gnu packages web)
   #:use-module (gnu packages bittorrent)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages build-tools)
+  #:use-module (gnu packages ccache)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
@@ -1640,6 +1642,42 @@ (define-public wasm3
     (description "WASM3 is a fast WebAssembly interpreter.")
     (license license:expat)))
 
+(define-public wasm-micro-runtime
+  (package
+    (name "wasm-micro-runtime")
+    (version "1.2.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/bytecodealliance/wasm-micro-runtime")
+                    (commit (string-append "WAMR-" version))))
+              (file-name (git-file-name "WAMR" version))
+              (sha256
+               (base32
+                "1mbwaj25798ilhg02447k3c2813xvxd70dwdlr4ha73xxbdgi54f"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'check)
+          (replace 'configure
+            (lambda _
+              (chdir "product-mini/platforms/linux")
+              (mkdir-p "build")
+              (chdir "build")
+              (invoke "cmake" "--install-prefix" #$output ".."))))))
+    (native-inputs (list
+                    ccache
+                    gcc))
+    (home-page "https://bytecodealliance.github.io/wamr.dev")
+    (synopsis "WebAssembly Micro Runtime")
+    (description "WebAssembly Micro Runtime (WAMR) is a lightweight standalone
+WebAssembly (Wasm) runtime with small footprint, high performance and highly
+configurable features for applications cross from embedded, IoT, edge to Trusted
+Execution Environment (TEE), smart contract, cloud native and other features.")
+    (license license:asl2.0)))
+
 (define-public websocketpp
   (package
     (name "websocketpp")

base-commit: d884fc9e2efecfba09af4694f5a13ad7fc6f704f
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#64179] [PATCH] gnu: Add wasm-micro-runtime.
  2023-06-19 21:56 [bug#64179] [PATCH] gnu: Add wasm-micro-runtime Felix Lechner via Guix-patches via
@ 2023-09-06 13:55 ` Maxim Cournoyer
  2023-09-06 21:23 ` [bug#64179] [PATCH v2] " Felix Lechner via Guix-patches via
  2023-09-20 14:39 ` bug#64179: [PATCH] " Ricardo Wurmus
  2 siblings, 0 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2023-09-06 13:55 UTC (permalink / raw)
  To: Felix Lechner; +Cc: 64179

Hi Felix,

Felix Lechner <felix.lechner@lease-up.com> writes:

> * gnu/packages/web.scm (wasm-micro-runtime): New variable.

[...]

> +(define-public wasm-micro-runtime
> +  (package
> +    (name "wasm-micro-runtime")
> +    (version "1.2.2")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/bytecodealliance/wasm-micro-runtime")
> +                    (commit (string-append "WAMR-" version))))
> +              (file-name (git-file-name "WAMR" version))
> +              (sha256
> +               (base32
> +                "1mbwaj25798ilhg02447k3c2813xvxd70dwdlr4ha73xxbdgi54f"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     (list
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (delete 'check)

Instead of deleting the check phase, uses #:tests? #f with an
appropriate comment (e.g.: ';no test suite' if inline).

> +          (replace 'configure
> +            (lambda _
> +              (chdir "product-mini/platforms/linux")
> +              (mkdir-p "build")
> +              (chdir "build")
> +              (invoke "cmake" "--install-prefix" #$output ".."))))))

Instead of overriding configure, missing all the important CMake options
that the default configure phase would use, did you try toa add a phase
like

--8<---------------cut here---------------start------------->8---
            (add-after 'unpack 'chdir
             (lambda _
              (chdir "product-mini/platforms/linux")))
--8<---------------cut here---------------end--------------->8---

It looks like this should do it.

> +    (native-inputs (list
> +                    ccache
> +                    gcc))

I'm pretty sure gcc is not necessary since it's already provided by
cmake-build-system.  ccache seems useless since we always build from
scratch in a clean environment.

Could you try the above suggestions and send a v2?

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#64179] [PATCH v2] gnu: Add wasm-micro-runtime.
  2023-06-19 21:56 [bug#64179] [PATCH] gnu: Add wasm-micro-runtime Felix Lechner via Guix-patches via
  2023-09-06 13:55 ` Maxim Cournoyer
@ 2023-09-06 21:23 ` Felix Lechner via Guix-patches via
  2023-09-20 14:39 ` bug#64179: [PATCH] " Ricardo Wurmus
  2 siblings, 0 replies; 4+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-09-06 21:23 UTC (permalink / raw)
  To: 64179; +Cc: Felix Lechner

* gnu/packages/web.scm (wasm-micro-runtime): New variable.
---

Hi Maxim,

The pointers were great. Everything worked. I also updated the version
to 1.2.3. Thanks!

Kind regards
Felix

 gnu/packages/web.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 46a60b8b15..2379a68741 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -63,6 +63,7 @@
 ;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
 ;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
 ;;; Copyright © 2023 Christopher Howard <christopher@librehacker.com>
+;;; Copyright © 2023 Felix Lechner <felix.lechner@lease-up.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1709,6 +1710,36 @@ (define-public wasm3
     (description "WASM3 is a fast WebAssembly interpreter.")
     (license license:expat)))
 
+(define-public wasm-micro-runtime
+  (package
+    (name "wasm-micro-runtime")
+    (version "1.2.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/bytecodealliance/wasm-micro-runtime")
+                    (commit (string-append "WAMR-" version))))
+              (file-name (git-file-name "WAMR" version))
+              (sha256
+               (base32
+                "1s7r8vfxixf737jp12cf7as68fd63lrmqdxj7fiqdla2wk89ly3f"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir
+            (lambda _
+              (chdir "product-mini/platforms/linux"))))))
+    (home-page "https://bytecodealliance.github.io/wamr.dev")
+    (synopsis "WebAssembly Micro Runtime")
+    (description "WebAssembly Micro Runtime (WAMR) is a lightweight standalone
+WebAssembly (Wasm) runtime with small footprint, high performance and highly
+configurable features for applications cross from embedded, IoT, edge to Trusted
+Execution Environment (TEE), smart contract, cloud native and other features.")
+    (license license:asl2.0)))
+
 (define-public websocketpp
   (package
     (name "websocketpp")

base-commit: 65dcfb3f3865d08467da747041263fd22460d393
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#64179: [PATCH] gnu: Add wasm-micro-runtime.
  2023-06-19 21:56 [bug#64179] [PATCH] gnu: Add wasm-micro-runtime Felix Lechner via Guix-patches via
  2023-09-06 13:55 ` Maxim Cournoyer
  2023-09-06 21:23 ` [bug#64179] [PATCH v2] " Felix Lechner via Guix-patches via
@ 2023-09-20 14:39 ` Ricardo Wurmus
  2 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2023-09-20 14:39 UTC (permalink / raw)
  To: 64179-done

Thanks for the patch.  I pushed it to the master branch with commit
e05c225ffbc6decb8294d30dfb0776284025c19f.

I reflowed the description and tried to get the tests to run.  When I
decided to accept defeat I added a comment to explain why they are
disabled.

-- 
Ricardo




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-20 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 21:56 [bug#64179] [PATCH] gnu: Add wasm-micro-runtime Felix Lechner via Guix-patches via
2023-09-06 13:55 ` Maxim Cournoyer
2023-09-06 21:23 ` [bug#64179] [PATCH v2] " Felix Lechner via Guix-patches via
2023-09-20 14:39 ` bug#64179: [PATCH] " Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).