From patchwork Tue Apr 8 19:58:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 41466 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6892B27BC4B; Tue, 8 Apr 2025 20:59:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B4E9827BC49 for ; Tue, 8 Apr 2025 20:59:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2F6L-0007Pm-IH; Tue, 08 Apr 2025 15:59:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2F68-0007EU-VY for guix-patches@gnu.org; Tue, 08 Apr 2025 15:59:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2F67-0003Ru-A8 for guix-patches@gnu.org; Tue, 08 Apr 2025 15:59:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=+YzOMYgEd66FjCF+pM2fVAm11Tjatsfkycc89Wubzk4=; b=nTi2J6lvVxv4fr52eo/ApmXw6ll+sEQ3U0QeK9gYn2LxeSV66A0DDtFW6uWb1XJ3uODZzSJ2OhfOQCKLBGcBuwdfkvtchUTOEbXPUfG/6iw8H5QCyiOwg9QuLPQec7d2K86upi69j7WfRebRgXQAxTa1KJGF18w4gNKLZdQ8oyHwYIbML+wd9XEreE/QDpyp2vdZi+srSueOW4IZRPnxCOVat1BOKfUCJushsTsPuCgKnOX5z5wvp27S6qhjhve3Pfd8upTgomxZUrYvc39l2rIZWV/ginhSFLfWEEZfodzBIiP6uag3akyYzlfCMedCIjQu+zR1pPPqvnIGw69IrQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u2F67-0000N0-3t for guix-patches@gnu.org; Tue, 08 Apr 2025 15:59:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77653] [PATCH 1/4] gnu: Add wasi-libc. References: <20250408195720.2021-1-ian@retrospec.tv> In-Reply-To: <20250408195720.2021-1-ian@retrospec.tv> Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Apr 2025 19:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77653 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77653@debbugs.gnu.org Cc: Ian Eure Received: via spool by 77653-submit@debbugs.gnu.org id=B77653.17441423281364 (code B ref 77653); Tue, 08 Apr 2025 19:59:03 +0000 Received: (at 77653) by debbugs.gnu.org; 8 Apr 2025 19:58:48 +0000 Received: from localhost ([127.0.0.1]:35617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2F5s-0000Lv-1u for submit@debbugs.gnu.org; Tue, 08 Apr 2025 15:58:48 -0400 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]:56195) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2F5k-0000L8-Ej for 77653@debbugs.gnu.org; Tue, 08 Apr 2025 15:58:41 -0400 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id A81361140177; Tue, 8 Apr 2025 15:58:34 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 08 Apr 2025 15:58:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm1; t=1744142314; x=1744228714; bh=+Y zOMYgEd66FjCF+pM2fVAm11Tjatsfkycc89Wubzk4=; b=MdyQNx6jw/2Q1IJlXZ 2H6cagdc1yiNIjyzh6aOkYXs/Jky8deyboxBv4Et28fDcw6zJTT353ruYPTtYFCY 0KOjpDyELZLeK1p27Qk6pmzTQtgdIy5fdp6p5AmY3F2LHH7pV3aEpSpDcNOI6pzw 0ijSgIbZU41iD1MjANDQUnZtM61ROZvDMFZfBv8vJTlDvLVa9scGW2CDstKST1jo 6Uyor8qfN5sKZCR9zDVwAdBoFyKKb4JTptLOiIp8BdTAVgsPWGAWTJzspX0dZawT 63F5j1AyKboa9k7FXBjlnYoNYqyd3TfAcq6Uw7RmpNjSaRkRBWXersUizszqjigY BRXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1744142314; x=1744228714; bh=+YzOMYgEd66FjCF+pM2fVAm11Tja tsfkycc89Wubzk4=; b=HzH6MNcqxFQ1uhZUY9OC3fpo3aVmDVIda1As4+PwL9/R Eg+L0zKL5Yt8DXvhsWYIMKAZREt6DCzk+acSdXhx1x0m3Zx9dMn3hrCaZFF0yyvi VRqfrdUicdfy5ZX2+EQ/+p+nbDAhXEfoNw6wcGjSyR2cDhu6gUCsXqBKlS2Oh0E6 2naGnz7sH8R5AStJ5IBgvJlRFnWwx9MS8yUdC8s7uWXdmaSKZVbLTYiKXfR/CJEa iz60fuQm5mKgAvIAjH5HfZjJy84LpGSym41EW91FZrTY6Ya5n++nHiXVio2daZMw 4KgRgChb3nt1HvyELFFIsKXdwjN4dQ4BUQi6vXTLfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdefleelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf evufffkffogggtgfesthekredtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgr nhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpeduveefjeeijefgff efhffhveffleeffeejvdetgeegffevheejvddtvdeuheekveenucffohhmrghinhepghhn uhdrohhrghdpghhithhhuhgsrdgtohhmpdhmohiiihhllhgrrdhorhhgpdifrghsihdrug gvvhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehi rghnsehrvghtrhhoshhpvggtrdhtvhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmh htphhouhhtpdhrtghpthhtohepjeejieehfeesuggvsggsuhhgshdrghhnuhdrohhrghdp rhgtphhtthhopehirghnsehrvghtrhhoshhpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Apr 2025 15:58:33 -0400 (EDT) From: Ian Eure Date: Tue, 8 Apr 2025 12:58:26 -0700 Message-ID: <20250408195830.2084-1-ian@retrospec.tv> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/wasm.scm (wasi-libc): New variable. Change-Id: I1aefc4573424e19119d225904b5461b1bea0221e --- gnu/packages/wasm.scm | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 gnu/packages/wasm.scm diff --git a/gnu/packages/wasm.scm b/gnu/packages/wasm.scm new file mode 100644 index 0000000000..060e1e420f --- /dev/null +++ b/gnu/packages/wasm.scm @@ -0,0 +1,78 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022-2023 Pierre Langlois +;;; Copyright © 2023, 2024, 2025 Ian Eure +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages wasm) + #:use-module (gnu packages llvm) + #:use-module (guix base32) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public wasi-libc + (package + (name "wasi-libc") + (version "sdk-20") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/WebAssembly/wasi-libc") + (commit (string-append "wasi-" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0knm5ch499dksmv1k0kh7356pjd9n1gjn0p3vp9bw57mn478zp8z")))) + (build-system gnu-build-system) + (native-inputs (list clang-16)) + (arguments + (list #:tests? #f ;No test suite + ;; Firefox uses wasm2c to compile WebAssembly to C code, and it + ;; does not support the memory.copy opcode. + ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1773200#c4 + #:make-flags ''("BULK_MEMORY_SOURCES=") + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-sysroot-include + (lambda _ + (setenv "C_INCLUDE_PATH" + (string-append (getcwd) "/sysroot/include")))) + (add-before 'install 'set-install-dir + (lambda _ + (setenv "INSTALL_DIR" + (string-append #$output "/wasm32-wasi"))))))) + (home-page "https://wasi.dev") + (synopsis "WASI libc implementation for WebAssembly") + (description + "WASI Libc is a libc for WebAssembly programs built on top of WASI +system calls. It provides a wide array of POSIX-compatible C APIs, including +support for standard I/O, file I/O, filesystem manipulation, memory +management, time, string, environment variables, program startup, and many +other APIs.") + (license (list + ;; For wasi-libc, with LLVM exceptions + license:asl2.0 + ;; For malloc.c. + license:cc0 + ;; For cloudlibc. + license:bsd-2 + ;; For wasi-libc and musl-libc. + license:expat))))