From ce0be5675b702b2ff89aed1772ebb42af4150243 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 19 May 2020 15:55:08 +0200 Subject: packages: Introduce and use it in . * guix/packages.scm (): New record type. (define-content-hash-constructor, build-content-hash) (content-hash): New macros. (print-content-hash): New procedure. (): Rename constructor to '%origin'. [sha256]: Remove field. [hash]: New field. Adjust users. (origin-compatibility-helper, origin): New macros. (origin-sha256): New deprecated procedure. (origin->derivation): Adjust accordingly. * tests/packages.scm ("package-source-derivation, origin, sha512"): New test. * guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax matching. * tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users. * tests/derivations.scm: Likewise. * tests/store.scm: Likewise. * tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field with the right length. * gnu/packages/aspell.scm (aspell-dictionary) (aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for proper syntax matching. * gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'. * gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'. * gnu/packages/readline.scm (readline-patch): Likewise. * gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to 'sha256-bv'. * guix/import/utils.scm: Hide (gcrypt hash) 'sha256'. --- guix/import/utils.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/import') diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 3809c3d074..0cfa1f8321 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -24,7 +24,7 @@ (define-module (guix import utils) #:use-module (guix base32) #:use-module ((guix build download) #:prefix build:) - #:use-module (gcrypt hash) + #:use-module ((gcrypt hash) #:hide (sha256)) #:use-module (guix http-client) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix utils) -- cgit v1.2.3 From 8d1d56578aa95118650ed2197bfb7fac40f4218a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 May 2020 17:57:54 +0200 Subject: git: 'update-cached-checkout' returns the commit relation. * guix/git.scm (update-cached-checkout): Add #:starting-commit parameter. Call 'commit-relation' when #:starting-commit is true. Always return the relation or #f as the third value. (latest-repository-commit): Adjust accordingly. * guix/import/opam.scm (get-opam-repository): Likewise. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Update mock of 'update-cached-checkout' accordingly. --- guix/channels.scm | 2 +- guix/git.scm | 22 +++++++++++++++++----- guix/import/opam.scm | 2 +- tests/channels.scm | 12 ++++++------ 4 files changed, 25 insertions(+), 13 deletions(-) (limited to 'guix/import') diff --git a/guix/channels.scm b/guix/channels.scm index e0a7a84f55..75b767a94c 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -218,7 +218,7 @@ result is unspecified." (and (string=? (basename file) ".git") (eq? 'directory (stat:type stat)))) - (let-values (((checkout commit) + (let-values (((checkout commit relation) (update-cached-checkout (channel-url channel) #:ref (channel-reference channel)))) (when (guix-channel? channel) diff --git a/guix/git.scm b/guix/git.scm index 249d622756..ab3b5075b1 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -262,14 +262,16 @@ definitely available in REPOSITORY, false otherwise." #:key (ref '(branch . "master")) recursive? + starting-commit (log-port (%make-void-port "w")) (cache-directory (url-cache-directory url (%repository-cache-directory) #:recursive? recursive?))) - "Update the cached checkout of URL to REF in CACHE-DIRECTORY. Return two + "Update the cached checkout of URL to REF in CACHE-DIRECTORY. Return three values: the cache directory name, and the SHA1 commit (a string) corresponding -to REF. +to REF, and the relation of the new commit relative to STARTING-COMMIT (if +provided) as returned by 'commit-relation'. REF is pair whose key is [branch | commit | tag | tag-or-commit ] and value the associated data: [ | | | ]. @@ -302,7 +304,17 @@ When RECURSIVE? is true, check out submodules as well, if any." (remote-fetch (remote-lookup repository "origin")))) (when recursive? (update-submodules repository #:log-port log-port)) - (let ((oid (switch-to-ref repository canonical-ref))) + + ;; Note: call 'commit-relation' from here because it's more efficient + ;; than letting users re-open the checkout later on. + (let* ((oid (switch-to-ref repository canonical-ref)) + (new (and starting-commit + (commit-lookup repository oid))) + (old (and starting-commit + (commit-lookup repository + (string->oid starting-commit)))) + (relation (and starting-commit + (commit-relation old new)))) ;; Reclaim file descriptors and memory mappings associated with ;; REPOSITORY as soon as possible. @@ -310,7 +322,7 @@ When RECURSIVE? is true, check out submodules as well, if any." 'repository-close!) (repository-close! repository)) - (values cache-directory (oid->string oid)))))) + (values cache-directory (oid->string oid) relation))))) (define* (latest-repository-commit store url #:key @@ -343,7 +355,7 @@ Log progress and checkout info to LOG-PORT." (format log-port "updating checkout of '~a'...~%" url) (let*-values - (((checkout commit) + (((checkout commit _) (update-cached-checkout url #:recursive? recursive? #:ref ref diff --git a/guix/import/opam.scm b/guix/import/opam.scm index ae7df8a8b5..9cda3da006 100644 --- a/guix/import/opam.scm +++ b/guix/import/opam.scm @@ -115,7 +115,7 @@ (define (get-opam-repository) "Update or fetch the latest version of the opam repository and return the path to the repository." - (receive (location commit) + (receive (location commit _) (update-cached-checkout "https://github.com/ocaml/opam-repository") location)) diff --git a/tests/channels.scm b/tests/channels.scm index 910088ba15..3578b57204 100644 --- a/tests/channels.scm +++ b/tests/channels.scm @@ -136,11 +136,11 @@ (url "test"))) (test-dir (channel-instance-checkout instance--simple))) (mock ((guix git) update-cached-checkout - (lambda* (url #:key ref) + (lambda* (url #:key ref starting-commit) (match url - ("test" (values test-dir "caf3cabba9e")) + ("test" (values test-dir "caf3cabba9e" #f)) (_ (values (channel-instance-checkout instance--no-deps) - "abcde1234"))))) + "abcde1234" #f))))) (with-store store (let ((instances (latest-channel-instances store (list channel)))) (and (eq? 2 (length instances)) @@ -155,11 +155,11 @@ (url "test"))) (test-dir (channel-instance-checkout instance--with-dupes))) (mock ((guix git) update-cached-checkout - (lambda* (url #:key ref) + (lambda* (url #:key ref starting-commit) (match url - ("test" (values test-dir "caf3cabba9e")) + ("test" (values test-dir "caf3cabba9e" #f)) (_ (values (channel-instance-checkout instance--no-deps) - "abcde1234"))))) + "abcde1234" #f))))) (with-store store (let ((instances (latest-channel-instances store (list channel)))) (and (= 2 (length instances)) -- cgit v1.2.3 From 2e08394b3c64ad77cebb94f54677130e4fdaf9e9 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 8 Jun 2020 21:13:46 +0200 Subject: import: stackage: Fix typo. * guix/import/stackage.scm (latest-lts-release): Fix spelling of "included". --- guix/import/stackage.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/import') diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index 14150201b5..9572f8c26d 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -122,7 +122,7 @@ included in the Stackage LTS release." (let ((pkgs-info (mlambda () (lts-info-packages (stackage-lts-info-fetch))))) (lambda* (package) "Return an for the latest Stackage LTS release of -PACKAGE or #f it the package is not inlucded in the Stackage LTS release." +PACKAGE or #f it the package is not included in the Stackage LTS release." (let* ((hackage-name (guix-package->hackage-name package)) (version (lts-package-version (pkgs-info) hackage-name)) (name-version (hackage-name-version hackage-name version))) -- cgit v1.2.3 From 35b00d4caa798ca03a0d4c01ca02c656590ccaa5 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 9 Jun 2020 22:29:38 +0200 Subject: import: stackage: Fix typo. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/stackage.scm (latest-lts-release): Fix spelling of ‘if’. --- guix/import/stackage.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/import') diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index 9572f8c26d..e04073d193 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -122,7 +122,7 @@ included in the Stackage LTS release." (let ((pkgs-info (mlambda () (lts-info-packages (stackage-lts-info-fetch))))) (lambda* (package) "Return an for the latest Stackage LTS release of -PACKAGE or #f it the package is not included in the Stackage LTS release." +PACKAGE or #f if the package is not included in the Stackage LTS release." (let* ((hackage-name (guix-package->hackage-name package)) (version (lts-package-version (pkgs-info) hackage-name)) (name-version (hackage-name-version hackage-name version))) -- cgit v1.2.3 From 8e518d4802891ea8398aab7259f823c3cc648d64 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 12 Jun 2020 15:49:57 +0200 Subject: guix: Update to Bioconductor 3.11. * guix/build-system/r.scm (bioconductor-uri): Use new URL. * guix/import/cran.scm (%bioconductor-version): Update to 3.11. --- guix/build-system/r.scm | 4 ++-- guix/import/cran.scm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'guix/import') diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm index 2d328764b0..c8ec9abd0d 100644 --- a/guix/build-system/r.scm +++ b/guix/build-system/r.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus +;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,7 +59,7 @@ release corresponding to NAME and VERSION." "/src/contrib/" name "_" version ".tar.gz") ;; TODO: use %bioconductor-version from (guix import cran) - (string-append "https://bioconductor.org/packages/3.10" + (string-append "https://bioconductor.org/packages/3.11" type-url-part "/src/contrib/Archive/" name "_" version ".tar.gz")))) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index ad66a644ee..b822fbc0ae 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -141,9 +141,9 @@ package definition." (define %cran-url "https://cran.r-project.org/web/packages/") (define %bioconductor-url "https://bioconductor.org/packages/") -;; The latest Bioconductor release is 3.10. Bioconductor packages should be +;; The latest Bioconductor release is 3.11. Bioconductor packages should be ;; updated together. -(define %bioconductor-version "3.10") +(define %bioconductor-version "3.11") (define* (bioconductor-packages-list-url #:optional type) (string-append "https://bioconductor.org/packages/" -- cgit v1.2.3