From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2ElbFD21XmelegEAe85BDQ:P1 (envelope-from ) for ; Sun, 15 Dec 2024 10:53:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 2ElbFD21XmelegEAe85BDQ (envelope-from ) for ; Sun, 15 Dec 2024 11:53:49 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=ln8XTbH2; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734260029; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0lc+BrXN+EMpHUyAvzI97Eehg2zAu7jawi6hL0RqdL8=; b=SjxAMFFZKuz8Owin3FQtIJkxWxaTWdvkDCHbklf8eDTrkuMoqdx7K+HtXmpdU/na2FdVUp dMxCBj5JuDbfwYAQ6vpN0xp7GYDV4hBv11nvdkpArhMfO49AKTRnztVB0mi76HhC/CUrSG PnreSF+scpnq4a8cDCHuDkiqLix+2e4UUq4kstl1zA1AcvjNvN33LW04RIYULumzZWMVMM MxcDWpQ/A+Tb6maZkNH6cfRPckKnJG5pjEc7ZSffcdG9RjWMCgr/7Hgq7FzTt4PYT51SPb y42OFwhlXZFhG525GuY3LisPcyxFMup1IgssaG+WrqWAIonPYXl7C5NdYlTFXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=ln8XTbH2; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734260029; a=rsa-sha256; cv=none; b=f1bl9k5YC/C2G5yKIlcPAoAlCj60XCUL+kiYSgw3xRgt1u2S305S/HkDFtiRhfuaX8t/xK yF/Q/jBrvVr2J/allNGxn8AcZELrDPCGSDauKL4Fc7arT8ihs9pcy8H5pfxW3tvLylZ9VJ 4sjnP3gkpsPSdoe8QXWK4SIpWSEC1QOAhk33JJn5jkGDUBgsxztXhLiFalShet7ZHTee4U MvIJUFkKmxpVunDto2ibREG+YpkNaD4+M4E6atOBCq5rRrCoPg/mmzn+7T+q0piWB5dhY2 xTfQh/oToiHWELGAfjKZcxeIzQBpQPesP7Bf4RseAeVuwZ2hKpLcEQvl4dqrFA== 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 F23287DE6F for ; Sun, 15 Dec 2024 11:53:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMkBm-0007aM-LX; Sun, 15 Dec 2024 03:41:22 -0500 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 1tMkBj-0007a6-Ld for guix-devel@gnu.org; Sun, 15 Dec 2024 03:41:19 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMkBe-0002us-6X; Sun, 15 Dec 2024 03:41:19 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3863c36a731so2175146f8f.1; Sun, 15 Dec 2024 00:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734252072; x=1734856872; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=0lc+BrXN+EMpHUyAvzI97Eehg2zAu7jawi6hL0RqdL8=; b=ln8XTbH2qHg8g0hm9ekizBusFLyxg4QqVz6o87bG6rD7/VOfddh+v2ZiAn6V6aT2pf k1s8hSrxqGVhrDQX0hGJrXitRjuLBowreNrcuSdF0gGKMoIVxatI1cH8m2vPqdwGdecd 29RrvQj9VyQDr+CFMTRyvR6pDmHT1LaTwISwv8WgnOir4UPX1g3+ZZU7Iq7AaIkqwNob xaZBrcqOusymbJY5GXyq0vRmI0EYsws5PdC/fJba4h2GXiU7cO21LVJwfx83inmTeVdL smjqfZidQOu+Gks2zWAAQ0r6LohUVrFjPuE/RO0WnqD3SyyJ9cc4dTdZtSKqYytWzC3B mnIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734252072; x=1734856872; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0lc+BrXN+EMpHUyAvzI97Eehg2zAu7jawi6hL0RqdL8=; b=tfB51DvuWKK9MZNMZxkkXvqgF6Xeiqo0bA78mGw4YY1LYRs+7f3BFlOFdByna373r0 Z2kUq/oDDSJEZgAT0fcGN50RjiVeQ6YirK+rE/2n55iAK30JJlt4NuTxg3iPmzmWLAfS EhwfIoRgAsSi0Fccvar4Dyt2+IO99NRViBg+TzMBPnzGT8R647h50YR2cgqUVhRMtvXt 48Yzc53a/HpYCSKnBj7tTNmEINGk9rOeOL2rRPUM2AQzcMUrNSoX5ddVSbwKvCl4L6hr UuOMmNAkVLUhAMMln0+ukmCVOhOiyKgP0xbpQTXxgrJOUoDiKc7eFk4W+SB7IO5Pvn0Z yvRw== X-Gm-Message-State: AOJu0Yz9vjxL+dVvIx81mfoVE8QvFWvdU/9gWHxqE0n7oZiNS/8HaI/e s7qXVBZw0/0WkXNgtgrrjbSp+Z75GBqhULW1jjy0Pw8PK81ftDK7lpFwwQ== X-Gm-Gg: ASbGnctknX6E7S4hZ3x1pyJ/qtuNLNEnxUxuxeTSQYiO/gP6/zDiDExMMhQX2v5uCyL xBMfp6BZ1g4Nns99sfr69U7EDcTcxPwjXhdzAL7nTHTR7g2/LMt34EVZyHzIpJxOMPrdGbkt11M edAD7lqsyU17ycvmOmcYziqsU0hNpOyJ05qS1vtQjEIUMLiorf4Cxa75sICyo7UBYMuNrwCKLrX 0myH2InkFhrBXgx/VTuziisnGhrUDL2mC10lUFKX8LNcqAjRE9iVDms X-Google-Smtp-Source: AGHT+IF/oJCrJ0F3/Y0VeuDOnJWDaCYa6w56SMnOKAVIgMFq0K74TGG0FmN2W8E1yFhOLuddwCTiRg== X-Received: by 2002:a05:6000:784:b0:385:faaa:9d1d with SMTP id ffacd0b85a97d-38880adb18cmr6884603f8f.35.1734252071170; Sun, 15 Dec 2024 00:41:11 -0800 (PST) Received: from localhost ([31.210.180.118]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c8061038sm4614145f8f.104.2024.12.15.00.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Dec 2024 00:41:09 -0800 (PST) Date: Sun, 15 Dec 2024 10:41:07 +0200 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Subject: Re: Use and abuse of =?utf-8?B?4oCYY29t?= =?utf-8?Q?puted-origin-method=E2=80=99=3A_the_=E2=80=98rust-ring?= =?utf-8?B?4oCZ?= case Message-ID: Mail-Followup-To: Ludovic =?utf-8?Q?Court=C3=A8s?= , guix-devel@gnu.org References: <87cyhtlwla.fsf@inria.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0Bsn7pfMJ3OCF2/i" Content-Disposition: inline In-Reply-To: <87cyhtlwla.fsf@inria.fr> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=efraim.flashner@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: F23287DE6F X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.52 X-Spam-Score: -3.52 X-TUID: ukh64stev0YE --0Bsn7pfMJ3OCF2/i Content-Type: multipart/mixed; boundary="gzZNrt2xxx5+66kR" Content-Disposition: inline --gzZNrt2xxx5+66kR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thanks for bringing this up! rust-ring, while an interesting experiment in how to package software which doesn't play well with rebuilding sources, is certainly not something we want to have be the norm. On Sat, Dec 14, 2024 at 11:37:53PM +0100, Ludovic Court=C3=A8s wrote: > Hello Guix, >=20 > =E2=80=98rust-ring-0.16-sources=E2=80=99 & co. are origins that use > =E2=80=98computed-origin-method=E2=80=99 (the thing that=E2=80=99s intern= al and undocumented) to > generate object files from assembly source, things like that. >=20 > An origin is supposed to represent source code, and clearly, the end > result here is not source by any stretch. >=20 > I believe it=E2=80=99s done this way simply because =E2=80=98cargo-build-= system=E2=80=99 then > embarks that =E2=80=9Csource=E2=80=9D to build leaf package(s) that use = =E2=80=98rust-ring=E2=80=99, > directly or indirectly; this is where Rust compilation actually takes > place and, IIUC, the reason why a build phase in =E2=80=98rust-ring=E2=80= =99 would be of > no use. That's correct. If we went the normal route and removed all the pre-generated files in a snippet and rebuilt them during the actual package build that would only work for that package, and we'd have to duplicate that for each package which uses rust-ring. > Anyway, the =E2=80=98computed-origin-method=E2=80=99 hack prevents input = rewriting from > working as expected because the inputs of that big gexp aren=E2=80=99t vi= sible > by just traversing the package graph. That=E2=80=99s a problem. Are we talking about the inputs used for the computed-origin? (perl, nasm, go, etc?) > Ideas on how to fix that? >=20 > An idea that comes to mind is to turn =E2=80=98rust-ring-0.16-sources=E2= =80=99 into a > package using =E2=80=98trivial-build-system=E2=80=99, though I=E2=80=99m = not sure it would work > well with =E2=80=98cargo-build-system=E2=80=99. The main problem we're faced with here is that "the source" (as rustc defines it) isn't to be touched during the build. Hence almost everything that is rebuilt is put into the pregenerated folder in the sources. There are a couple of files that are generated outside of the pregenerated directory, and none that are expected to be generated in the target directory. I'm pretty sure there are 3 options here: 1. Stop rebuilding the generated files. This is what we did in the past, and it allows rust-ring-0.14 to be used on riscv64-linux. I haven't talked with the Debian folks about it but I'm pretty sure this is what they currently do. I don't like it because we have instructions on how to do the rebuild and it's already implemented. I also really like that everything can be regenerated from (nearly) any architecture, which makes it a much nicer build than qemu, which needs many cross compilers. 2. Use the trivial-build-system instead of a computed-origin-method. I'm pretty sure we can use the output of the trivial-build-system (or any other package build) as the source for another package. I currently think this is the best option. 3. Adjust the build.rs file in rust-ring to call a custom shell script which will build all the missing files that we would remove in a snippet. This is probably best from a "the source is ready to hack on" perspective, but it means we're carrying around a custom build script with no chance of being upstreamed. It also means that each package which uses rust-ring will need to have all the rust-ring build dependencies added and it will need to be built each time. I've attached a patch that I tested locally to build the sources in an actual package, and then use that to build rust-ring. I tested it by building librsvg. Currently it still requires go itself as using gccgo needs gccgo-toolchain. On a side note, I would like to point out that we also use this for linux-libre and for icecat. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --gzZNrt2xxx5+66kR Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-rust-ring-0.17-Build-source-using-trivial-build-.patch" Content-Transfer-Encoding: quoted-printable =46rom bd33099bc04dc3663554ebe68d1d70345aceaef3 Mon Sep 17 00:00:00 2001 Message-ID: =46rom: Efraim Flashner Date: Sun, 15 Dec 2024 10:38:11 +0200 Subject: [PATCH] gnu: rust-ring-0.17: Build source using trivial-build-syst= em. This removes this use of computed-origin-method. * gnu/packages/crates-crypto.scm (rust-ring-0.17-sources): Replace use of computed-origin-method with an actual package. Change-Id: I195805492d61e7a1294926a047b0332265ae8187 --- gnu/packages/crates-crypto.scm | 339 +++++++++++++++++---------------- 1 file changed, 172 insertions(+), 167 deletions(-) diff --git a/gnu/packages/crates-crypto.scm b/gnu/packages/crates-crypto.scm index 995b183652a..982f6d1eeb1 100644 --- a/gnu/packages/crates-crypto.scm +++ b/gnu/packages/crates-crypto.scm @@ -35,6 +35,7 @@ =20 (define-module (gnu packages crates-crypto) #:use-module (guix build-system cargo) + #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) @@ -4135,11 +4136,11 @@ (define-public rust-rfc6979-0.3 ("rust-zeroize" ,rust-zeroize-1)) #:cargo-development-inputs (("rust-sha2" ,rust-sha2-0.10)))))) =20 -(define computed-origin-method (@@ (guix packages) computed-origin-method)) (define rust-ring-0.17-sources - (let* ((version "0.17.8") - (upstream-source - (origin + (package + (name "rust-ring") + (version "0.17.8.tar.gz") ; Hack to adjust the output name. + (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/briansmith/ring") @@ -4147,182 +4148,185 @@ (define rust-ring-0.17-sources (file-name (git-file-name "rust-ring" version)) (sha256 (base32 "0rqfal81bf4l3dja98cajfjq2jbz1rcx7xdp2r33cxrm5y5psr2= 8")) - (patches (search-patches "rust-ring-0.17-ring-core.patch"))))) - (origin - (method computed-origin-method) - (file-name (string-append "rust-ring-" version ".tar.gz")) - (sha256 #f) - (uri - (delay - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (set-path-environment-variable - "PATH" '("bin") - (list #+(canonical-package gzip) - #+(canonical-package tar) - #+perl - #+nasm - #+go - #+clang ; clang-format - #+python-minimal)) - (setenv "HOME" (getcwd)) - (copy-recursively #+upstream-source - (string-append "ring-" #$version)) - (with-directory-excursion (string-append "ring-" #$version) - (begin - ;; It turns out Guix's nasm works just fine here. - (substitute* "build.rs" - (("./target/tools/windows/nasm/nasm") "nasm")) - ;; Files which would be deleted in a snippet: - (delete-file "crypto/curve25519/curve25519_tables.h") - (delete-file "crypto/fipsmodule/ec/p256-nistz-table.h") - (delete-file "crypto/fipsmodule/ec/p256_table.h") - ;; This file causes problems during the 'package phase= and - ;; is not distributed with the packaged crate. - (substitute* "Cargo.toml" - (("\"bench\",") "")) - (delete-file "bench/Cargo.toml") - ;; Files to be generated in the sources: - (format #t "Generating the missing files ...~%") - (force-output) - (with-directory-excursion "crypto/curve25519" - (with-output-to-file "curve25519_tables.h" - (lambda _ (invoke "python3" "make_curve25519_table= s.py"))) - ;; As seen in git between 0.17.0 and 0.17.1. - (substitute* "curve25519_tables.h" - (("static const uint8_t k25519Precomp") - "const uint8_t k25519Precomp"))) - (with-directory-excursion "crypto/fipsmodule/ec" - (invoke "go" "run" "make_tables.go") - (invoke "go" "run" "make_ec_scalar_base_mult_tests.g= o")) - (format #t "Generating the pregenerated files ...~%") - (force-output) - (mkdir-p "pregenerated/tmp/ring_core_generated") + (patches (search-patches "rust-ring-0.17-ring-core.patch")) + (snippet + #~(begin (use-modules (guix build utils)) + ;; It turns out Guix's nasm works just fine here. + (substitute* "build.rs" + (("./target/tools/windows/nasm/nasm") "nasm")) + ;; These files are pregenerated: + (delete-file "crypto/curve25519/curve25519_tables.h= ") + (delete-file "crypto/fipsmodule/ec/p256-nistz-table= =2Eh") + (delete-file "crypto/fipsmodule/ec/p256_table.h") + ;; As seen in git between 0.17.0 and 0.17.1. + (substitute* "crypto/curve25519/make_curve25519_tab= les.py" + (("static const uint8_t k25519Precomp") + "const uint8_t k25519Precomp")) + ;; This file causes problems during the 'package ph= ase and + ;; is not distributed with the packaged crate. + (substitute* "Cargo.toml" + (("\"bench\",") "")) + (delete-file "bench/Cargo.toml"))))) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (setenv "PATH" + (string-join + (list (assoc-ref %build-inputs "clang") ; for clan= g-format + (assoc-ref %build-inputs "go") + (assoc-ref %build-inputs "gzip") + (assoc-ref %build-inputs "nasm") + (assoc-ref %build-inputs "perl") + (assoc-ref %build-inputs "python-minimal") + (assoc-ref %build-inputs "tar")) + "/bin:" 'suffix)) =20 - ;; We generate all the files which upstream would norm= ally be - ;; generate by using 'RING_PREGENERATE_ASM=3D1 cargo b= uild - ;; --target-dir=3Dtarget/pregenerate_asm' in order to = not include - ;; a dependency on cargo when generating the sources. - (define (prefix script) - (string-append - "pregenerated/" - (string-drop-right - (string-drop script - (string-index-right script #\/)) 3)= )) + (setenv "HOME" (getcwd)) + (copy-recursively #+source (string-append "ring-" #$version)) + (with-directory-excursion (string-append "ring-" #$version) + (begin + (with-directory-excursion "crypto/curve25519" + (with-output-to-file "curve25519_tables.h" + (lambda _ (invoke "python3" "make_curve25519_tables.py"= )))) + (with-directory-excursion "crypto/fipsmodule/ec" + (invoke "go" "run" "make_tables.go") + (invoke "go" "run" "make_ec_scalar_base_mult_tests.go")) + (format #t "Generating the pregenerated files ...~%") + (force-output) + (mkdir-p "pregenerated/tmp/ring_core_generated") =20 - (for-each - (lambda (script) - (invoke "perl" script "ios64" - (string-append (prefix script) "-ios64.S")) - (invoke "perl" script "linux64" - (string-append (prefix script) "-linux64.S= ")) - (invoke "perl" script "win64" - (string-append (prefix script) "-win64.S")= )) - '("crypto/fipsmodule/aes/asm/aesv8-armx.pl" - "crypto/fipsmodule/modes/asm/ghashv8-armx.pl" - "crypto/chacha/asm/chacha-armv8.pl" - "crypto/cipher_extra/asm/chacha20_poly1305_armv8.p= l" - "crypto/fipsmodule/aes/asm/vpaes-armv8.pl" - "crypto/fipsmodule/bn/asm/armv8-mont.pl" - "crypto/fipsmodule/ec/asm/p256-armv8-asm.pl" - "crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl" - "crypto/fipsmodule/modes/asm/aesv8-gcm-armv8.pl" - "crypto/fipsmodule/sha/asm/sha512-armv8.pl")) + ;; We generate all the files which upstream would normally = be + ;; generate by using 'RING_PREGENERATE_ASM=3D1 cargo build + ;; --target-dir=3Dtarget/pregenerate_asm' in order to not i= nclude + ;; a dependency on cargo when generating the sources. + (define (prefix script) + (string-append + "pregenerated/" + (string-drop-right + (string-drop script + (string-index-right script #\/)) 3))) =20 - (for-each - (lambda (arch) - (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-a= rmv8.pl" - arch (string-append - "pregenerated/sha256-armv8-" arch "= =2ES"))) - '("ios64" "linux64" "win64")) + (for-each + (lambda (script) + (invoke "perl" script "ios64" + (string-append (prefix script) "-ios64.S")) + (invoke "perl" script "linux64" + (string-append (prefix script) "-linux64.S")) + (invoke "perl" script "win64" + (string-append (prefix script) "-win64.S"))) + '("crypto/fipsmodule/aes/asm/aesv8-armx.pl" + "crypto/fipsmodule/modes/asm/ghashv8-armx.pl" + "crypto/chacha/asm/chacha-armv8.pl" + "crypto/cipher_extra/asm/chacha20_poly1305_armv8.pl" + "crypto/fipsmodule/aes/asm/vpaes-armv8.pl" + "crypto/fipsmodule/bn/asm/armv8-mont.pl" + "crypto/fipsmodule/ec/asm/p256-armv8-asm.pl" + "crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl" + "crypto/fipsmodule/modes/asm/aesv8-gcm-armv8.pl" + "crypto/fipsmodule/sha/asm/sha512-armv8.pl")) =20 - (for-each - (lambda (script) - (invoke "perl" script "linux32" - (string-append (prefix script) "-linux32.S= "))) - '("crypto/fipsmodule/aes/asm/aesv8-armx.pl" - "crypto/fipsmodule/modes/asm/ghashv8-armx.pl" - "crypto/fipsmodule/aes/asm/bsaes-armv7.pl" - "crypto/fipsmodule/aes/asm/vpaes-armv7.pl" - "crypto/fipsmodule/bn/asm/armv4-mont.pl" - "crypto/chacha/asm/chacha-armv4.pl" - "crypto/fipsmodule/modes/asm/ghash-armv4.pl" - "crypto/fipsmodule/sha/asm/sha256-armv4.pl" - "crypto/fipsmodule/sha/asm/sha512-armv4.pl")) + (for-each + (lambda (arch) + (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-armv8.= pl" + arch (string-append + "pregenerated/sha256-armv8-" arch ".S"))) + '("ios64" "linux64" "win64")) =20 - (for-each - (lambda (script) - (invoke "perl" script "elf" - "-fPIC" "-DOPENSSL_IA32_SSE2" - (string-append (prefix script) "-elf.S")) - (invoke "perl" script "win32n" - "-fPIC" "-DOPENSSL_IA32_SSE2" - (string-append - "pregenerated/tmp/" - (string-drop (prefix script) 13) "-win32= n.asm"))) - '("crypto/fipsmodule/aes/asm/aesni-x86.pl" - "crypto/fipsmodule/aes/asm/vpaes-x86.pl" - "crypto/fipsmodule/bn/asm/x86-mont.pl" - "crypto/chacha/asm/chacha-x86.pl" - "crypto/fipsmodule/modes/asm/ghash-x86.pl")) + (for-each + (lambda (script) + (invoke "perl" script "linux32" + (string-append (prefix script) "-linux32.S"))) + '("crypto/fipsmodule/aes/asm/aesv8-armx.pl" + "crypto/fipsmodule/modes/asm/ghashv8-armx.pl" + "crypto/fipsmodule/aes/asm/bsaes-armv7.pl" + "crypto/fipsmodule/aes/asm/vpaes-armv7.pl" + "crypto/fipsmodule/bn/asm/armv4-mont.pl" + "crypto/chacha/asm/chacha-armv4.pl" + "crypto/fipsmodule/modes/asm/ghash-armv4.pl" + "crypto/fipsmodule/sha/asm/sha256-armv4.pl" + "crypto/fipsmodule/sha/asm/sha512-armv4.pl")) =20 - (for-each - (lambda (script) - (invoke "perl" script "elf" - (string-append (prefix script) "-elf.S")) - (invoke "perl" script "macosx" - (string-append (prefix script) "-macosx.S"= )) - (invoke "perl" script "nasm" - (string-append - "pregenerated/tmp/" - (string-drop (prefix script) 13) "-nasm.= asm"))) - '("crypto/chacha/asm/chacha-x86_64.pl" - "crypto/fipsmodule/aes/asm/aesni-x86_64.pl" - "crypto/fipsmodule/aes/asm/vpaes-x86_64.pl" - "crypto/fipsmodule/bn/asm/x86_64-mont.pl" - "crypto/fipsmodule/bn/asm/x86_64-mont5.pl" - "crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl" - "crypto/fipsmodule/modes/asm/aesni-gcm-x86_64.pl" - "crypto/fipsmodule/modes/asm/ghash-x86_64.pl" - "crypto/fipsmodule/sha/asm/sha512-x86_64.pl" - "crypto/cipher_extra/asm/chacha20_poly1305_x86_64.= pl")) + (for-each + (lambda (script) + (invoke "perl" script "elf" + "-fPIC" "-DOPENSSL_IA32_SSE2" + (string-append (prefix script) "-elf.S")) + (invoke "perl" script "win32n" + "-fPIC" "-DOPENSSL_IA32_SSE2" + (string-append + "pregenerated/tmp/" + (string-drop (prefix script) 13) "-win32n.asm= "))) + '("crypto/fipsmodule/aes/asm/aesni-x86.pl" + "crypto/fipsmodule/aes/asm/vpaes-x86.pl" + "crypto/fipsmodule/bn/asm/x86-mont.pl" + "crypto/chacha/asm/chacha-x86.pl" + "crypto/fipsmodule/modes/asm/ghash-x86.pl")) =20 - (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-x86_6= 4.pl" - "elf" "pregenerated/sha256-x86_64-elf.S") + (for-each + (lambda (script) + (invoke "perl" script "elf" + (string-append (prefix script) "-elf.S")) + (invoke "perl" script "macosx" + (string-append (prefix script) "-macosx.S")) + (invoke "perl" script "nasm" + (string-append + "pregenerated/tmp/" + (string-drop (prefix script) 13) "-nasm.asm")= )) + '("crypto/chacha/asm/chacha-x86_64.pl" + "crypto/fipsmodule/aes/asm/aesni-x86_64.pl" + "crypto/fipsmodule/aes/asm/vpaes-x86_64.pl" + "crypto/fipsmodule/bn/asm/x86_64-mont.pl" + "crypto/fipsmodule/bn/asm/x86_64-mont5.pl" + "crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl" + "crypto/fipsmodule/modes/asm/aesni-gcm-x86_64.pl" + "crypto/fipsmodule/modes/asm/ghash-x86_64.pl" + "crypto/fipsmodule/sha/asm/sha512-x86_64.pl" + "crypto/cipher_extra/asm/chacha20_poly1305_x86_64.pl")) =20 - (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-x86_6= 4.pl" - "macosx" "pregenerated/sha256-x86_64-macosx.S") + (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-x86_64.pl" + "elf" "pregenerated/sha256-x86_64-elf.S") =20 - (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-x86_6= 4.pl" - "nasm" "pregenerated/tmp/sha256-x86_64-nasm.as= m") + (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-x86_64.pl" + "macosx" "pregenerated/sha256-x86_64-macosx.S") =20 - ;; TODO: Extract ring_core_generated/prefix_symbols_na= sm.inc - ;; and ring_core_generated/prefix_symbols_asm.h from b= uild.rs. + (invoke "perl" "crypto/fipsmodule/sha/asm/sha512-x86_64.pl" + "nasm" "pregenerated/tmp/sha256-x86_64-nasm.asm") =20 - (for-each - (lambda (script) - (invoke "nasm" "-o" (string-append (prefix script)= "o") - "-f" "win32" "-i" "include/" "-i" "pregene= rated/tmp/" - "-Xgnu" "-gcv8" script)) - (find-files "pregenerated/tmp" "win32n\\.asm")) + ;; TODO: Extract ring_core_generated/prefix_symbols_nasm.inc + ;; and ring_core_generated/prefix_symbols_asm.h from build.= rs. =20 - (for-each - (lambda (script) - (invoke "nasm" "-o" (string-append (prefix script)= "o") - "-f" "win64" "-i" "include/" "-i" "pregene= rated/tmp/" - "-Xgnu" "-gcv8" script)) - (find-files "pregenerated/tmp" "nasm\\.asm")) + (for-each + (lambda (script) + (invoke "nasm" "-o" (string-append (prefix script) "o") + "-f" "win32" "-i" "include/" "-i" "pregenerated= /tmp/" + "-Xgnu" "-gcv8" script)) + (find-files "pregenerated/tmp" "win32n\\.asm")) =20 - (format #t "Creating the tarball ...~%") - (force-output) - ;; The other option is to use cargo package --allow-di= rty - (with-directory-excursion "../" - (invoke "tar" "czf" #$output - ;; avoid non-determinism in the archive - "--sort=3Dname" "--mtime=3D@0" - "--owner=3Droot:0" "--group=3Droot:0" - (string-append "ring-" #$version)))))))))))) + (for-each + (lambda (script) + (invoke "nasm" "-o" (string-append (prefix script) "o") + "-f" "win64" "-i" "include/" "-i" "pregenerated= /tmp/" + "-Xgnu" "-gcv8" script)) + (find-files "pregenerated/tmp" "nasm\\.asm")) + + (format #t "Creating the tarball ...~%") + (force-output) + (with-directory-excursion "../" + (invoke "tar" "czf" #$output + ;; avoid non-determinism in the archive + "--sort=3Dname" "--mtime=3D@0" + "--owner=3Droot:0" "--group=3Droot:0" + (string-append "ring-" #$version)))))))) + (native-inputs + (list clang go gzip nasm perl python-minimal tar)) + (home-page "https://github.com/briansmith/ring") + (synopsis "Safe, fast, small crypto using Rust") + (description "This package provided safe, fast, small crypto using Rus= t.") + (license (list license:isc license:openssl)))) =20 (define-public rust-ring-0.17 (package @@ -4346,6 +4350,7 @@ (define-public rust-ring-0.17 (description "This package provided safe, fast, small crypto using Rus= t.") (license (list license:isc license:openssl)))) =20 +(define computed-origin-method (@@ (guix packages) computed-origin-method)) (define rust-ring-0.16-sources (let* ((version "0.16.20") (upstream-source base-commit: cfd4f56f75a20b6732d463180d211f796c9032e5 --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --gzZNrt2xxx5+66kR-- --0Bsn7pfMJ3OCF2/i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmdeliMACgkQQarn3Mo9 g1EBfg//TShudH20wHZQQFSIdsytVcyMI9FIAgLMZmXTAeIktax7kg01YJF/pXLY EMr5CVAGYmDueKJoOSwNRUOH2mv7blW4LFhztTEys7CwfvEdogQQ17kcaclFGLO8 Bezg4LIMRxOc6qT3fRyO2X4PKt2xfJiW3mePNS4YHs8SlZaQvVnwnJdNB27QnIaz JZhgjlfRhd2gRHOpEPv/hv19/nZzQEnFNvvSLA7FmHZQMUM6yvDzbeQerJnMkWF3 Sb1JrtYcDI5qPfFiue7NYkX9+qx36+Cjrq1MrN3V5LS5QSSJsTSY/DNZijn7wzGu WN+NuMfjtuyH/Iqu5dMx0niOOcDa52RYKwueEy6Uo8/VRyVl+vwZnK4iZV3B2Hpo ZH64estXJz+gwSuWQzB8pbnMf7aTRcy0Aih0ZocWcP8BNSi9lQg7B9XpxfPj3MQh 37yW2iUBpC6FRUQXK7YnBqVqZFxpsIYdLkvQmnf8GqNpGKInEL/qmq3A8aEVxDsU qlfZ4X+rO3oWCqJXsyDkUFd8CB5/w4Pb/xcJfR12Yeb6oBspMyh7gvk5RIr2BX6Y J1NOkCmYvPyQrN8v6nfeUFgKTTuQe+bHivMAIaKKch40bKGTXWkIvemmsnf0K2Ri zo3FdJT+qHIO8XxU62LstgguYMVk88JxwpVPAXKrCPAPfle5Mj0= =NbL5 -----END PGP SIGNATURE----- --0Bsn7pfMJ3OCF2/i--