guix_mirror_bot pushed a commit to branch javascript-team in repository guix.
commit 4d3f719e30446da7c12184d91fba4f621641cac5 Author: Jelle Licht <[email protected]> AuthorDate: Thu Sep 3 10:24:22 2026 +0200 gnu: Add uvwasi. * gnu/packages/libevent.scm (uvwasi): New variable. * gnu/packages/patches/uvwasi-fix-assert-side-effects.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Modified-by: Maxim Cournoyer <[email protected]> --- gnu/local.mk | 1 + gnu/packages/libevent.scm | 26 ++++++++++++++ .../patches/uvwasi-fix-assert-side-effects.patch | 40 ++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/gnu/local.mk b/gnu/local.mk index 8c6bb0041d1..b0deee3e180 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2664,6 +2664,7 @@ dist_patch_DATA = \ %D%/packages/patches/unzip-32bit-zipbomb-fix.patch \ %D%/packages/patches/ustr-fix-build-with-gcc-5.patch \ %D%/packages/patches/util-linux-tests.patch \ + %D%/packages/patches/uvwasi-fix-assert-side-effects.patch \ %D%/packages/patches/vagrant-bin-vagrant-silence-warning-about-installer.patch \ %D%/packages/patches/vagrant-Support-system-installed-plugins.patch \ %D%/packages/patches/vagrant-Use-a-private-temporary-dir.patch \ diff --git a/gnu/packages/libevent.scm b/gnu/packages/libevent.scm index 2619b683b64..642cf25181d 100644 --- a/gnu/packages/libevent.scm +++ b/gnu/packages/libevent.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2019 Pierre Neidhardt <[email protected]> ;;; Copyright © 2022 Luis Henrique Gomes Higino <[email protected]> ;;; Copyright © 2023 Ricardo Wurmus <[email protected]> +;;; Copyright © 2026 Jelle Licht <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,6 +32,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) #:use-module (gnu packages autotools) @@ -330,3 +332,27 @@ and still be faster than other event loops currently supported in Perl.") (description "RPC::EPC::Service enables to connect the other process with the S-expression protocol, like the Swank protocol of the SLIME.") (license license:perl-license))) + +(define-public uvwasi + (package + (name "uvwasi") + (version "0.0.23") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nodejs/uvwasi") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 + "0xlffyl8j6c16dl5r4s7nrm2v1mxpmy9wf2ispak2i0i6flzzz7s")) + (patches (search-patches "uvwasi-fix-assert-side-effects.patch")))) + (build-system cmake-build-system) + (inputs (list libuv)) + (home-page "https://github.com/nodejs/uvwasi") + (synopsis "WASI syscall API built atop libuv") + (description "@code{uvwasi} implements the @acronym{WASI, WebAssembly +System Interface} system call API, so that WebAssembly runtimes can easily +implement WASI calls. Under the hood, @code{uvwasi} leverages @code{libuv} +where possible for maximum portability.") + (license license:expat))) diff --git a/gnu/packages/patches/uvwasi-fix-assert-side-effects.patch b/gnu/packages/patches/uvwasi-fix-assert-side-effects.patch new file mode 100644 index 00000000000..2f34f543bd0 --- /dev/null +++ b/gnu/packages/patches/uvwasi-fix-assert-side-effects.patch @@ -0,0 +1,40 @@ +From aad491596536c0d6c3386e8dd0cf6ff94ef86660 Mon Sep 17 00:00:00 2001 +From: Jelle Licht <[email protected]> +Date: Mon, 7 Sep 2026 20:59:28 +0200 +Subject: [PATCH] test: avoid side effects in assert, fixes behavior under + NDEBUG + +--- + test/test-multiple-wasi-destroys.c | 3 ++- + test/test-path-resolution.c | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/test/test-multiple-wasi-destroys.c b/test/test-multiple-wasi-destroys.c +index 563537f..9be51a5 100644 +--- a/test/test-multiple-wasi-destroys.c ++++ b/test/test-multiple-wasi-destroys.c +@@ -22,7 +22,8 @@ int main(void) { + assert(init_options.preopens == NULL); + assert(init_options.allocator == NULL); + +- assert(0 == uvwasi_init(&uvwasi, &init_options)); ++ int r = uvwasi_init(&uvwasi, &init_options); ++ assert(0 == r); + /* Calling uvwasi_destroy() multiple times should be fine. */ + uvwasi_destroy(&uvwasi); + uvwasi_destroy(&uvwasi); +diff --git a/test/test-path-resolution.c b/test/test-path-resolution.c +index 4c03e2e..40b0694 100644 +--- a/test/test-path-resolution.c ++++ b/test/test-path-resolution.c +@@ -143,7 +143,9 @@ static void create_symlink(char* src, char* real_dst) { + + int main(void) { + uvwasi_options_init(&init_options); +- assert(0 == uvwasi_init(&uvwasi, &init_options)); ++ ++ int r = uvwasi_init(&uvwasi, &init_options); ++ assert(0 == r); + + /* Arguments: input path, expected normalized path */ + check_normalize("", ".");
