From a8e24a5258aa05689bcafa70af071da5296f63a4 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Sat, 4 Sep 2021 20:09:03 +0200 Subject: [PATCH 1/6] build-self: Implement basic 'hash-algorithm'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module (guix hash) used from 'search-patch' in a future patch needs it to be properly defined when (guix hash) is being compiled. 'search-patch' is used when the derivation of Guix is being computed, so it is important to avoid the ‘wrong type to apply: #’ error. * build-aux/build-self.scm (build-program)[fake-gcrypt-hash]: Define hash-algorithm for sha1 and sha256. --- build-aux/build-self.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 3a2d13cc09..2c13d9d530 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -259,8 +259,17 @@ interface (FFI) of Guile.") (define fake-gcrypt-hash ;; Fake (gcrypt hash) module; see below. (scheme-file "hash.scm" - #~(define-module (gcrypt hash) - #:export (sha1 sha256)))) + #~(begin + (define-module (gcrypt hash) + #:export (sha1 sha256 hash-algorithm)) + ;; Avoid ‘Wrong type to apply: + ;; #’ errors. + (define sha1) + (define sha256) + (define-syntax hash-algorithm + (syntax-rules (sha1 sha256) + ((_ sha1) 2) + ((_ sha256) 8)))))) (define fake-git (scheme-file "git.scm" #~(define-module (git)))) base-commit: b4d132f98e03fae559db832e88897f1e166c4d47 prerequisite-patch-id: 91a26ba19372112a11a0eea2b066d2f63641deb1 prerequisite-patch-id: a535c1ae2a1fbf75d7ac9a3118ed23bd4fa03ecc prerequisite-patch-id: 29eba0cede1c1e7153a7c7b9a58b33b67f693a13 prerequisite-patch-id: 8dd2234fa0f867081c6cf614c7a22b00022702b4 prerequisite-patch-id: 2fe0e5c67a37ef3f0e22813c9808eaeec83bb552 prerequisite-patch-id: 91514568f1ef4870ad7ed7b3f685f04703f9c090 -- 2.33.0