From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kXz9Hup37184UwAA0tVLHw (envelope-from ) for ; Fri, 01 Jan 2021 19:28:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0PxKGup371/bHgAA1q6Kng (envelope-from ) for ; Fri, 01 Jan 2021 19:28:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 18F539404CD for ; Fri, 1 Jan 2021 19:28:42 +0000 (UTC) Received: from localhost ([::1]:50430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQ6L-0003dX-1q for larch@yhetil.org; Fri, 01 Jan 2021 14:28:41 -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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Ryan Prior , Ryan Prior via Guix-patches From: Ryan Prior via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.83 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=protonmail.com header.s=protonmail header.b=lsQD/2Or; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 18F539404CD X-Spam-Score: -2.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: YQRt3XbOlavh --- 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 =3D=09=09=09=09=09=09\ %D%/packages/patches/vinagre-newer-freerdp.patch \ %D%/packages/patches/vinagre-newer-rdp-parameters.patch \ %D%/packages/patches/virglrenderer-CVE-2017-6386.patch =09\ + %D%/packages/patches/vlang-accommodate-timestamps.patch =09\ %D%/packages/patches/vorbis-tools-CVE-2014-9638+CVE-2014-9639.patch=09= =09\ %D%/packages/patches/vorbis-tools-CVE-2014-9640.patch=09=09\ %D%/packages/patches/vorbis-tools-CVE-2015-6749.patch=09=09\ 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 g= uix, + 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 { + =09if !os.exists(tool_exe) { + =09=09should_compile =3D true + =09} else { +-=09=09if os.file_last_mod_unix(tool_exe) <=3D os.file_last_mod_unix(vexe)= { ++=09=09mtime_vexe :=3D os.file_last_mod_unix(vexe) ++=09=09mtime_tool_exe :=3D os.file_last_mod_unix(tool_exe) ++=09=09mtime_tool_source :=3D os.file_last_mod_unix(tool_source) ++=09=09if mtime_tool_exe <=3D mtime_vexe { + =09=09=09// v was recompiled, maybe after v up ... + =09=09=09// rebuild the tool too just in case + =09=09=09should_compile =3D true +@@ -192,10 +195,19 @@ pub fn should_recompile_tool(vexe string, tool_sourc= e string) bool { + =09=09=09=09should_compile =3D false + =09=09=09} + =09=09} +-=09=09if os.file_last_mod_unix(tool_exe) <=3D os.file_last_mod_unix(tool_= source) { ++=09=09if mtime_tool_exe <=3D mtime_tool_source { + =09=09=09// the user changed the source code of the tool, or git updated = it: + =09=09=09should_compile =3D true + =09=09} ++=09=09// GNU Guix and possibly other environments, have bit for bit repro= ducibility in mind, ++=09=09// including filesystem attributes like modification times, so they= set the modification ++=09=09// times of executables to a small number like 0, 1 etc. In this ca= se, we should not ++=09=09// recompile even if other heuristics say that we should. Users in = such environments, ++=09=09// have to explicitly do: `v cmd/tools/vfmt.v`, and/or install v fr= om source, and not ++=09=09// use the system packaged one, if they desire to develop v itself. ++=09=09if mtime_vexe < 1024 && mtime_tool_exe < 1024 { ++=09=09=09should_compile =3D false ++=09=09} + =09} + =09return should_compile + } +--=20 +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 versio= n + ;; 0.2. The package will build without it, but it will fail to run an= y v + ;; tools afterwards because of how Guix changes modified timestamps i= n + ;; the package files. + (patches (search-patches + "vlang-accommodate-timestamps.patch")) (snippet '(begin ;; Eventually remove the whole thirdparty directory. --=20 2.29.2