From patchwork Fri Jan 1 19:27:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 26161 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 3143D27BC09; Fri, 1 Jan 2021 19:28:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2064A27BC0A for ; Fri, 1 Jan 2021 19:28:16 +0000 (GMT) Received: from localhost ([::1]:49716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ5v-0003Jt-9B for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 14:28:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQ5i-0003Iw-Gv for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvQ5i-0006m6-75 for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvQ5i-00052W-3h for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45601] [PATCH 1/6] gnu: Add wyhash. References: <20210101192319.23494-1-rprior@protonmail.com> In-Reply-To: <20210101192319.23494-1-rprior@protonmail.com> Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45601@debbugs.gnu.org Received: via spool by 45601-submit@debbugs.gnu.org id=B45601.160952925919293 (code B ref 45601); Fri, 01 Jan 2021 19:28:02 +0000 Received: (at 45601) by debbugs.gnu.org; 1 Jan 2021 19:27:39 +0000 Received: from localhost ([127.0.0.1]:34900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5L-000515-1v for submit@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:39 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:56196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5I-00050R-TI for 45601@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:37 -0500 Date: Fri, 01 Jan 2021 19:27:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609529251; bh=JnUqPYbZkyePl8WXvw6RyeaE0Twld/xeNFZHiPZ5sm4=; h=Date:To:From:Reply-To:Subject:From; b=SU4RxoYf+C1tRQeofCwV6yZY8wI3HsAC/3BufKmfSkmVCqmh8Cnj+e1zukhES10Mo 1/zzyvLmoQUDTu/s0uVSdnAaCnCqnVbyI/+gRUsgiqe8uypYAuo/I1rzcpzFC3peAf GLu4fWIercKMUzhtKzok+hPYokQSua+KTBDLnK1M= Message-ID: <20210101192713.23655-1-rprior@protonmail.com> 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" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches * gnu/packages/datastructures.scm (wyhash): New variable. --- gnu/packages/datastructures.scm | 34 ++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm index 2911a0c550..49e363d09e 100644 --- a/gnu/packages/datastructures.scm +++ b/gnu/packages/datastructures.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2019, 2020 Efraim Flashner ;;; Copyright © 2020 Mark H Weaver ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2020 Ryan Prior ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,7 +34,38 @@ #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) - #:use-module (guix build-system meson)) + #:use-module (guix build-system meson) + #:use-module (guix build-system trivial)) + +(define-public wyhash + (package + (name "wyhash") + (version "5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wangyi-fudan/wyhash") + (commit (string-append "wyhash_v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "03ljs5iw9zrm3bydwggjvpwrcwmsd75h3dv1j4am4hw3h22cjdjc")))) + (build-system trivial-build-system) ;; source-only package + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((dest (string-append (assoc-ref %outputs "out") "/include"))) + (mkdir-p dest) + (chdir (assoc-ref %build-inputs "source")) + (install-file "wyhash.h" dest)) + #t))) + (home-page "https://github.com/wangyi-fudan/wyhash") + (synopsis "Embeddable hash function and random number generator.") + (description "This package provides a portable hash function and random +number generator suitable for use in data structures. Provided by default in +Zig, V, and Nim programming language standard libraries.") + (license license:unlicense))) (define-public gdsl (package From patchwork Fri Jan 1 19:27:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 26164 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 5A7D727BC09; Fri, 1 Jan 2021 19:28:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7B35D27BC08 for ; Fri, 1 Jan 2021 19:28:33 +0000 (GMT) Received: from localhost ([::1]:50322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ6B-0003an-9O for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 14:28:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQ5i-0003Iv-GW for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvQ5h-0006m5-Pw for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvQ5h-00052M-LP for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45601] [PATCH 2/6] gnu: vlang: Update to 0.2. Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 19:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45601@debbugs.gnu.org Received: via spool by 45601-submit@debbugs.gnu.org id=B45601.160952925819279 (code B ref 45601); Fri, 01 Jan 2021 19:28:01 +0000 Received: (at 45601) by debbugs.gnu.org; 1 Jan 2021 19:27:38 +0000 Received: from localhost ([127.0.0.1]:34897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5J-00050g-9l for submit@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:38 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:23190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5G-00050I-Vb for 45601@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:35 -0500 Date: Fri, 01 Jan 2021 19:27:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609529248; bh=xalKzcFUf3PHIoT+dDOZnQjP92sozjwRvHwVr/qrPug=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=ZSIjmKiUdS1lTsiaeXofB0Mbi75M7Fy8bBtnGsY61IlLwpklsr34iIqvr2mehlyRU X0L6djXzlx3s5mHcDJxWPxCHbWs6SOf7LhXB0pMm7zB0EAC17zgpw4I5rvhZyG2AIP gUEGTfo8q+FrKSGCs6qpPuV5adEQGRV/Dry6rv00= Message-ID: <20210101192713.23655-2-rprior@protonmail.com> In-Reply-To: <20210101192713.23655-1-rprior@protonmail.com> References: <20210101192713.23655-1-rprior@protonmail.com> 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" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches - Moves the cc-patching logic out of check into an explicit "patch-cc" stage. - Adds "build-tools" stage to pre-build the included tools. - Sets native-search-paths. - Fixes many tests. --- gnu/packages/vlang.scm | 84 +++++++++++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm index e0b2e7bcfc..212862cb1d 100644 --- a/gnu/packages/vlang.scm +++ b/gnu/packages/vlang.scm @@ -20,9 +20,13 @@ (define-module (gnu packages vlang) #:use-module (gnu packages glib) + #:use-module (gnu packages linux) #:use-module (gnu packages node) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) + #:use-module (gnu packages valgrind) + #:use-module (gnu packages version-control) + #:use-module (gnu packages javascript) #:use-module (gnu packages xorg) #:use-module (guix build-system gnu) #:use-module (guix git-download) @@ -30,10 +34,21 @@ #:use-module (guix utils) #:use-module (guix packages)) +(define markdown-origin + (let ((markdown-version "1ccfbcba945b649b61738b9c0455d31cf99564b2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/vlang/markdown") + (commit markdown-version))) + (file-name (git-file-name "vlang-markdown" markdown-version)) + (sha256 + (base32 "0s982qiwy4s9y07x9fsy4yn642schplhp9hrw2libg2bx4sw43as"))))) + (define-public vlang (package (name "vlang") - (version "0.1.29") + (version "0.2") (source (origin (method git-fetch) @@ -42,7 +57,7 @@ (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1rqi7cah5nq8aggrib9xvdpfjxq20li91svv0w9yny6nn1ag7snx")))) + (base32 "1x2sf2j6xl11kjvv0i0anjqwsfb1la11xr7yhdnbix9808442wm2")))) (build-system gnu-build-system) (arguments `(#:make-flags @@ -61,42 +76,60 @@ (lambda _ (substitute* "Makefile" (("rm -rf") "true") - (("v self") (string-append "v -cc " ,(cc-for-target) " cmd/v"))) + (("--branch") "")))) + (add-before 'build 'patch-cc + (lambda _ + (let* ((bin "tmp/bin") + (gcc (which "gcc"))) + (mkdir-p bin) + (symlink gcc (string-append bin "/cc")) + (setenv "PATH" (string-append bin ":" (getenv "PATH")))) + #t)) + (add-after 'build 'build-tools + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "vmodules/markdown") "vmodules/markdown") + (setenv "VMODULES" (string-append (getcwd) "/vmodules")) + (invoke "./v" "build-tools" "-v") #t)) - (add-before 'check 'delete-failing-tests - ;; XXX As always, these should eventually be fixed and run. + (add-before 'check 'fix-or-delete-failing-tests (lambda _ + ;; The x64 tests copy .vv files into the test directory and then + ;; write to them, so we need to make them writeable. + (for-each (lambda (vv) (chmod vv #o644)) + (find-files "vlib/v/gen/x64/tests/" "\\.vv$")) + ;; The process test explicitly calls "/bin/sleep" and "/bin/date" + (substitute* "vlib/os/process_test.v" + (("/bin/sleep") (which "sleep")) + (("/bin/date") (which "date"))) + ;; The valgrind test can't find `cc' even though it's on PATH, so + ;; we pass it as an explicit argument. + (substitute* "vlib/v/tests/valgrind/valgrind_test.v" + (("\\$vexe") "$vexe -cc gcc")) (for-each delete-file - '("vlib/v/gen/x64/tests/x64_test.v" - "vlib/v/tests/repl/repl_test.v" - "vlib/v/tests/valgrind/valgrind_test.v" - "vlib/v/tests/valgrind/strings_and_arrays.vv" + '(;; XXX As always, these should eventually be fixed and run. + "vlib/vweb/tests/vweb_test.v" "vlib/v/tests/live_test.v" - "vlib/net/websocket/ws_test.v")) + "vlib/v/tests/repl/repl_test.v")) #t)) (replace 'check (lambda* (#:key tests? #:allow-other-keys) - (let* ((bin "tmp/bin") - (gcc (which "gcc"))) - (when tests? - (mkdir-p bin) - (symlink gcc (string-append bin "/cc")) - (setenv "PATH" (string-append bin ":" (getenv "PATH"))) - (invoke "./v" "test-fixed"))) + (when tests? + (invoke "./v" "test-fixed")) #t)) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((bin (string-append (assoc-ref outputs "out") "/bin")) - (tools (string-append bin "/cmd/tools")) + (cmd (string-append bin "/cmd")) (thirdparty (string-append bin "/thirdparty")) (vlib (string-append bin "/vlib")) + (vmodules (string-append bin "/vmodules")) (vmod (string-append bin "/v.mod"))) (mkdir-p bin) (copy-file "./v" (string-append bin "/v")) ;; v requires as of 0.1.27 that these other components are in the ;; same directory. In a future release we may be able to move ;; these into other output folders. - (copy-recursively "cmd/tools" tools) + (copy-recursively "cmd" cmd) (copy-recursively "thirdparty" thirdparty) (copy-recursively "vlib" vlib) (copy-file "v.mod" vmod)) @@ -107,7 +140,7 @@ `(("vc" ;; Versions are not consistently tagged, but the matching commit will ;; probably have ‘v0.x.y’ in the commit message. - ,(let ((vc-version "b01d0fcda4b55861baa4be82e307cca4834b1641")) + ,(let ((vc-version "047460a4ae5f4a1ba8c31dc50ec5e50ebe80b7f6")) ;; v bootstraps from generated c source code from a dedicated ;; repository. It's readable, as generated source goes, and not at all ;; obfuscated, and it's about 15kb. The original source written in @@ -121,13 +154,20 @@ (commit vc-version))) (file-name (git-file-name "vc" vc-version)) (sha256 - (base32 "052gp5q2k31r3lci3rx4k0vy0vjdjva64xvrbbihn8lgmw63lc9f"))))) + (base32 "1wlr9yzxz4bc7pbzbplzhjjr9sz5mwy2k2z5d3vwsnz56g245146"))))) + ("vmodules/markdown" ,markdown-origin) ;; For the tests. ("libx11" ,libx11) ("node" ,node) ("openssl" ,openssl) - ("sqlite" ,sqlite))) + ("ps" ,procps) + ("sqlite" ,sqlite) + ("valgrind" ,valgrind))) + (native-search-paths + (list (search-path-specification + (variable "VMODULES") + (files '("bin/"))))) (home-page "https://vlang.io/") (synopsis "Compiler for the V programming language") (description From patchwork Fri Jan 1 19:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 26160 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 E0BAA27BC08; Fri, 1 Jan 2021 19:28:16 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F2CB627BC09 for ; Fri, 1 Jan 2021 19:28:15 +0000 (GMT) Received: from localhost ([::1]:49714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ5v-0003Jm-4E for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 14:28:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQ5k-0003JF-97 for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvQ5i-0006mG-In for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvQ5i-00052d-G4 for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45601] [PATCH 3/6] gnu: vlang: Use system tiny-bignum. Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45601@debbugs.gnu.org Received: via spool by 45601-submit@debbugs.gnu.org id=B45601.160952925919300 (code B ref 45601); Fri, 01 Jan 2021 19:28:02 +0000 Received: (at 45601) by debbugs.gnu.org; 1 Jan 2021 19:27:39 +0000 Received: from localhost ([127.0.0.1]:34902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5L-000518-C8 for submit@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:39 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:56231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5I-00050O-Rk for 45601@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:37 -0500 Date: Fri, 01 Jan 2021 19:27:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609529250; bh=A8agq+955CdOhLsuibBozFd85vjKt9vE/qPjnQFfp1A=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=Az8xs3uUlQ+rAriHfKHkfYJNDyBFBhurPEkqACJfCuR3Gm+jsCgy2LFDc0dMdW4vR mQPEC1WI4y4EnBJBVX96dhDqYtYP26k7P1Fw9rucPofWjqbUfyj5cErd4M980UGLrP KiyUOKN4ruiAynh5oaWz5cHsWoVlaUDm9IqwxlNw= Message-ID: <20210101192713.23655-3-rprior@protonmail.com> In-Reply-To: <20210101192713.23655-1-rprior@protonmail.com> References: <20210101192713.23655-1-rprior@protonmail.com> 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" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vlang.scm (vlang): Update to use system tiny-bignum. --- gnu/packages/vlang.scm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm index 212862cb1d..a2f6e93945 100644 --- a/gnu/packages/vlang.scm +++ b/gnu/packages/vlang.scm @@ -21,6 +21,7 @@ (define-module (gnu packages vlang) #:use-module (gnu packages glib) #:use-module (gnu packages linux) + #:use-module (gnu packages maths) #:use-module (gnu packages node) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) @@ -57,7 +58,12 @@ (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1x2sf2j6xl11kjvv0i0anjqwsfb1la11xr7yhdnbix9808442wm2")))) + (base32 "1x2sf2j6xl11kjvv0i0anjqwsfb1la11xr7yhdnbix9808442wm2")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Eventually remove the whole thirdparty directory. + (delete-file-recursively "thirdparty/bignum"))))) (build-system gnu-build-system) (arguments `(#:make-flags @@ -72,11 +78,14 @@ #:phases (modify-phases %standard-phases (delete 'configure) - (add-before 'build 'patch-makefile - (lambda _ + (add-before 'build 'patch-files + (lambda* (#:key inputs #:allow-other-keys) (substitute* "Makefile" (("rm -rf") "true") - (("--branch") "")))) + (("--branch") "")) + (substitute* "vlib/math/big/big.v" + (("@VROOT/thirdparty/bignum") + (string-append (assoc-ref inputs "tiny-bignum") "/share"))))) (add-before 'build 'patch-cc (lambda _ (let* ((bin "tmp/bin") @@ -135,7 +144,8 @@ (copy-file "v.mod" vmod)) #t))))) (inputs - `(("glib" ,glib))) + `(("glib" ,glib) + ("tiny-bignum" ,tiny-bignum))) (native-inputs `(("vc" ;; Versions are not consistently tagged, but the matching commit will From patchwork Fri Jan 1 19:27:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 26162 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 A63F527BC09; Fri, 1 Jan 2021 19:28:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9D47227BC08 for ; Fri, 1 Jan 2021 19:28:17 +0000 (GMT) Received: from localhost ([::1]:49804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ5w-0003Mt-R6 for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 14:28:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQ5k-0003JH-A2 for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvQ5i-0006mK-VP for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvQ5i-00052l-ST for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45601] [PATCH 4/6] gnu: vlang: Use system cJSON. Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45601@debbugs.gnu.org Received: via spool by 45601-submit@debbugs.gnu.org id=B45601.160952926019306 (code B ref 45601); Fri, 01 Jan 2021 19:28:02 +0000 Received: (at 45601) by debbugs.gnu.org; 1 Jan 2021 19:27:40 +0000 Received: from localhost ([127.0.0.1]:34904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5L-00051F-LQ for submit@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:39 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:24973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5J-00050T-Ox for 45601@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:38 -0500 Date: Fri, 01 Jan 2021 19:27:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609529251; bh=Ltrw3pImFVK0tOsk5myX5Li+/CADaVFpreqkhOd8GcQ=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=iBRav1ybvxz20YbVhOFSjyRCkPo0QRfq7dPr09qAGVh0iU2eqI3lGeZoalJAJphut +C98CnmTNPnwJfwJQI1DeC4ZgBIDjzXEGI3/FRfQL1bhi9zoIQeBgS66I45HtyxX8j ucswmzyEdMicKoXBM6F3+zSwotvwkbYz8A1sezps= Message-ID: <20210101192713.23655-4-rprior@protonmail.com> In-Reply-To: <20210101192713.23655-1-rprior@protonmail.com> References: <20210101192713.23655-1-rprior@protonmail.com> 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" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vlang.scm (vlang): Use system cJSON. --- gnu/packages/vlang.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm index a2f6e93945..db7438d7f7 100644 --- a/gnu/packages/vlang.scm +++ b/gnu/packages/vlang.scm @@ -63,7 +63,8 @@ (snippet '(begin ;; Eventually remove the whole thirdparty directory. - (delete-file-recursively "thirdparty/bignum"))))) + (delete-file-recursively "thirdparty/bignum") + (delete-file-recursively "thirdparty/cJSON"))))) (build-system gnu-build-system) (arguments `(#:make-flags @@ -85,7 +86,10 @@ (("--branch") "")) (substitute* "vlib/math/big/big.v" (("@VROOT/thirdparty/bignum") - (string-append (assoc-ref inputs "tiny-bignum") "/share"))))) + (string-append (assoc-ref inputs "tiny-bignum") "/share"))) + (substitute* "vlib/json/json_primitives.v" + (("@VROOT/thirdparty/cJSON") + (assoc-ref inputs "cJSON"))))) (add-before 'build 'patch-cc (lambda _ (let* ((bin "tmp/bin") @@ -145,7 +149,8 @@ #t))))) (inputs `(("glib" ,glib) - ("tiny-bignum" ,tiny-bignum))) + ("tiny-bignum" ,tiny-bignum) + ("cJSON" ,(package-source cjson)))) (native-inputs `(("vc" ;; Versions are not consistently tagged, but the matching commit will From patchwork Fri Jan 1 19:27:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 26163 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 5733627BC0A; Fri, 1 Jan 2021 19:28:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 89E8827BC09 for ; Fri, 1 Jan 2021 19:28:27 +0000 (GMT) Received: from localhost ([::1]:50312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ66-0003ad-PL for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 14:28:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQ5k-0003JJ-AS for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvQ5j-0006mv-Rm for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvQ5j-000530-Os for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45601] [PATCH 5/6] gnu: vlang: Use system wyhash. Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 19:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45601@debbugs.gnu.org Received: via spool by 45601-submit@debbugs.gnu.org id=B45601.160952926419337 (code B ref 45601); Fri, 01 Jan 2021 19:28:03 +0000 Received: (at 45601) by debbugs.gnu.org; 1 Jan 2021 19:27:44 +0000 Received: from localhost ([127.0.0.1]:34910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5Q-00051k-AH for submit@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:44 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:59875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5O-00050h-In for 45601@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:42 -0500 Date: Fri, 01 Jan 2021 19:27:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609529256; bh=imAHnLi8kKL0gWUFqFXKvUCbpANseUAZQHB1Mrg6y0s=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=G5TCLSYFDaRndDuzQPPucFNA6UUc5cHykdYWkiLILZx9C0+IG08x8UEyobG4Gmikj IpNMkIbkgF2IPrbMr5j3jsGC2fEEVLLMI4gP8Pq7CBOIBDblvq46i3UOPBUfeO8F/R YUwhwwinaPMJXltKAr8px7lxLxtydxLzRBW9gklo= Message-ID: <20210101192713.23655-5-rprior@protonmail.com> In-Reply-To: <20210101192713.23655-1-rprior@protonmail.com> References: <20210101192713.23655-1-rprior@protonmail.com> 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" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vlang.scm (vlang) Use system wyhash. --- gnu/packages/vlang.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm index db7438d7f7..92d178a3e1 100644 --- a/gnu/packages/vlang.scm +++ b/gnu/packages/vlang.scm @@ -19,6 +19,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages vlang) + #:use-module (gnu packages datastructures) #:use-module (gnu packages glib) #:use-module (gnu packages linux) #:use-module (gnu packages maths) @@ -63,8 +64,10 @@ (snippet '(begin ;; Eventually remove the whole thirdparty directory. - (delete-file-recursively "thirdparty/bignum") - (delete-file-recursively "thirdparty/cJSON"))))) + (for-each delete-file-recursively + '("thirdparty/bignum" + "thirdparty/cJSON" + "thirdparty/wyhash")))))) (build-system gnu-build-system) (arguments `(#:make-flags @@ -89,7 +92,10 @@ (string-append (assoc-ref inputs "tiny-bignum") "/share"))) (substitute* "vlib/json/json_primitives.v" (("@VROOT/thirdparty/cJSON") - (assoc-ref inputs "cJSON"))))) + (assoc-ref inputs "cJSON"))) + (substitute* "vlib/hash/wyhash.c.v" + (("@VROOT/thirdparty/wyhash") + (string-append (assoc-ref inputs "wyhash") "/include"))))) (add-before 'build 'patch-cc (lambda _ (let* ((bin "tmp/bin") @@ -150,7 +156,8 @@ (inputs `(("glib" ,glib) ("tiny-bignum" ,tiny-bignum) - ("cJSON" ,(package-source cjson)))) + ("cJSON" ,(package-source cjson)) + ("wyhash" ,wyhash))) (native-inputs `(("vc" ;; Versions are not consistently tagged, but the matching commit will From patchwork Fri Jan 1 19:27:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 26165 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 6184127BC09; Fri, 1 Jan 2021 19:28:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B6EE227BC08 for ; Fri, 1 Jan 2021 19:28:39 +0000 (GMT) Received: from localhost ([::1]:50430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ6I-0003dX-Tb for patchwork@mira.cbaines.net; Fri, 01 Jan 2021 14:28:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQ5k-0003JI-A2 for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvQ5j-0006mR-FU for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvQ5j-00052s-Br for guix-patches@gnu.org; Fri, 01 Jan 2021 14:28:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45601] [PATCH 6/6] gnu: vlang: Fix v tools. Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Jan 2021 19:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45601@debbugs.gnu.org Received: via spool by 45601-submit@debbugs.gnu.org id=B45601.160952926419331 (code B ref 45601); Fri, 01 Jan 2021 19:28:03 +0000 Received: (at 45601) by debbugs.gnu.org; 1 Jan 2021 19:27:44 +0000 Received: from localhost ([127.0.0.1]:34908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5P-00051i-UQ for submit@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:44 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:37191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvQ5O-00050e-8L for 45601@debbugs.gnu.org; Fri, 01 Jan 2021 14:27:42 -0500 Date: Fri, 01 Jan 2021 19:27:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609529255; bh=6xCmklctHlMqWRnmXimDursD7vJvqky1znfsoKI1RZs=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=lsQD/2OrKab9OYB0pCa3f7KfxBntbxI2Yg45y6WyV7dJ3sqZH1ILnHl9hDFGy6cZU /Jy2kThKBzebhjwzYIJmMAAAO3SJecqZ+vqiwVxHTB8i8e3JZPjzkUXfR3OUgdMz8m hwy4Vdmf72F5xHwIngGnzWe58Rra8jlnI7FuLXxc= Message-ID: <20210101192713.23655-6-rprior@protonmail.com> In-Reply-To: <20210101192713.23655-1-rprior@protonmail.com> References: <20210101192713.23655-1-rprior@protonmail.com> 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" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches --- gnu/local.mk | 1 + .../vlang-accommodate-timestamps.patch | 50 +++++++++++++++++++ gnu/packages/vlang.scm | 7 +++ 3 files changed, 58 insertions(+) create mode 100644 gnu/packages/patches/vlang-accommodate-timestamps.patch diff --git a/gnu/local.mk b/gnu/local.mk index 2402b1e349..168c499976 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1702,6 +1702,7 @@ dist_patch_DATA = \ %D%/packages/patches/vinagre-newer-freerdp.patch \ %D%/packages/patches/vinagre-newer-rdp-parameters.patch \ %D%/packages/patches/virglrenderer-CVE-2017-6386.patch \ + %D%/packages/patches/vlang-accommodate-timestamps.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9638+CVE-2014-9639.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9640.patch \ %D%/packages/patches/vorbis-tools-CVE-2015-6749.patch \ diff --git a/gnu/packages/patches/vlang-accommodate-timestamps.patch b/gnu/packages/patches/vlang-accommodate-timestamps.patch new file mode 100644 index 0000000000..02171ac6cf --- /dev/null +++ b/gnu/packages/patches/vlang-accommodate-timestamps.patch @@ -0,0 +1,50 @@ +From 64e7c548843c7938fcfa6b697108d28aa26f4d69 Mon Sep 17 00:00:00 2001 +From: Ryan Prior +Date: Thu, 31 Dec 2020 02:31:38 -0600 +Subject: [PATCH] v.util: accomodate reproducible build environments like guix, + by not recompiling cmd/tools when mtime < 1024 (#7702) + +--- + vlib/v/util/util.v | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v +index 811b71585..1ed32bacf 100644 +--- a/vlib/v/util/util.v ++++ b/vlib/v/util/util.v +@@ -179,7 +179,10 @@ pub fn should_recompile_tool(vexe string, tool_source string) bool { + if !os.exists(tool_exe) { + should_compile = true + } else { +- if os.file_last_mod_unix(tool_exe) <= os.file_last_mod_unix(vexe) { ++ mtime_vexe := os.file_last_mod_unix(vexe) ++ mtime_tool_exe := os.file_last_mod_unix(tool_exe) ++ mtime_tool_source := os.file_last_mod_unix(tool_source) ++ if mtime_tool_exe <= mtime_vexe { + // v was recompiled, maybe after v up ... + // rebuild the tool too just in case + should_compile = true +@@ -192,10 +195,19 @@ pub fn should_recompile_tool(vexe string, tool_source string) bool { + should_compile = false + } + } +- if os.file_last_mod_unix(tool_exe) <= os.file_last_mod_unix(tool_source) { ++ if mtime_tool_exe <= mtime_tool_source { + // the user changed the source code of the tool, or git updated it: + should_compile = true + } ++ // GNU Guix and possibly other environments, have bit for bit reproducibility in mind, ++ // including filesystem attributes like modification times, so they set the modification ++ // times of executables to a small number like 0, 1 etc. In this case, we should not ++ // recompile even if other heuristics say that we should. Users in such environments, ++ // have to explicitly do: `v cmd/tools/vfmt.v`, and/or install v from source, and not ++ // use the system packaged one, if they desire to develop v itself. ++ if mtime_vexe < 1024 && mtime_tool_exe < 1024 { ++ should_compile = false ++ } + } + return should_compile + } +-- +2.29.2 + diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm index 92d178a3e1..3bdbf36f9d 100644 --- a/gnu/packages/vlang.scm +++ b/gnu/packages/vlang.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages version-control) #:use-module (gnu packages javascript) #:use-module (gnu packages xorg) + #:use-module (gnu packages) #:use-module (guix build-system gnu) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) @@ -61,6 +62,12 @@ (sha256 (base32 "1x2sf2j6xl11kjvv0i0anjqwsfb1la11xr7yhdnbix9808442wm2")) (modules '((guix build utils))) + ;; This patch is already accepted upstream but is required for version + ;; 0.2. The package will build without it, but it will fail to run any v + ;; tools afterwards because of how Guix changes modified timestamps in + ;; the package files. + (patches (search-patches + "vlang-accommodate-timestamps.patch")) (snippet '(begin ;; Eventually remove the whole thirdparty directory.