From 37a8f5b281644bd5355406a4df76bbb9efc50d9c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Oct 2020 10:19:38 +0200 Subject: openpgp: '&openpgp-unrecognized-packet-error' includes type tag. * guix/openpgp.scm (&openpgp-unrecognized-packet-error)[type]: New field. (get-data, parse-subpackets): Initialize 'type' field. --- guix/openpgp.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/openpgp.scm b/guix/openpgp.scm index 153752ee73..648c359621 100644 --- a/guix/openpgp.scm +++ b/guix/openpgp.scm @@ -34,6 +34,7 @@ openpgp-error? openpgp-unrecognized-packet-error? openpgp-unrecognized-packet-error-port + openpgp-unrecognized-packet-error-type openpgp-invalid-signature-error? openpgp-invalid-signature-error-port @@ -132,6 +133,7 @@ ;; Error raised when reading an unsupported or unrecognized packet tag. (define-condition-type &openpgp-unrecognized-packet-error &openpgp-error openpgp-unrecognized-packet-error? + (type openpgp-unrecognized-packet-error-type) (port openpgp-unrecognized-packet-error-port)) ;; Error raised when reading an invalid signature packet. @@ -477,7 +479,8 @@ hexadecimal format for fingerprints." ((= tag PACKET-ONE-PASS-SIGNATURE) 'one-pass-signature) ;TODO: implement (else - (raise (condition (&openpgp-unrecognized-packet-error (port p)))))))) + (raise (condition (&openpgp-unrecognized-packet-error (type tag) + (port p)))))))) (define-record-type (make-openpgp-public-key version subkey? time value fingerprint) @@ -817,6 +820,7 @@ FINGERPRINT, a bytevector." (if critical? (raise (condition (&openpgp-unrecognized-packet-error + (type type) (port signature-port)))) (list 'unsupported-subpacket type data)))))) -- cgit v1.2.3 From 6b793fa66218337a1f638466753cd5326a6a6c18 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 7 Oct 2020 10:11:05 +0300 Subject: build-system/go: Install license files. * guix/build/go-build-system.scm (install-license-files): New procedure. (%standard-phases): Replace inherited 'install-license-files phase. --- guix/build/go-build-system.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'guix') diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index b9cb2bfd7b..227df820db 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2020 Jack Hill ;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2020 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -254,6 +255,17 @@ XXX We can't make use of compiled libraries (Go \"packages\")." (copy-recursively source dest #:keep-mtime? #t))) #t) +(define* (install-license-files #:key unpack-path + import-path + #:allow-other-keys + #:rest args) + "Install license files matching LICENSE-FILE-REGEXP to 'share/doc'. Adjust +the standard install-license-files phase to first enter the correct directory." + (with-directory-excursion (string-append "src/" (if (string-null? unpack-path) + import-path + unpack-path)) + (apply (assoc-ref gnu:%standard-phases 'install-license-files) args))) + (define* (remove-store-reference file file-name #:optional (store (%store-directory))) "Remove from FILE occurrences of FILE-NAME in STORE; return #t when FILE-NAME @@ -317,6 +329,7 @@ files in OUTPUTS." (replace 'build build) (replace 'check check) (replace 'install install) + (replace 'install-license-files install-license-files) (add-after 'install 'remove-go-references remove-go-references))) (define* (go-build #:key inputs (phases %standard-phases) -- cgit v1.2.3 From 5ef1508942ee083ed22b844f5291e59320016b79 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 15 Oct 2020 16:41:14 +0200 Subject: ui: Only suggest modules that export the unbound variable identifier. Fixes . Reported by Tobias Geerinckx-Rice . * guix/ui.scm (known-variable-definition): Check for variables in the public interface of HEAD, not in HEAD itself. * tests/guix-build.sh: Add test. --- guix/ui.scm | 3 ++- tests/guix-build.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index 8213e8ebab..8d7bc238bc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -297,7 +297,8 @@ VARIABLE and return it, or #f if none was found." (hash-map->list (lambda (name module) module) (module-submodules head))))) - (match (module-local-variable head variable) + (match (and=> (module-public-interface head) + (cut module-local-variable <> variable)) (#f (loop next suggestions visited)) (_ (match (module-name head) diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 6dbb53206e..4a58ea1476 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -198,6 +198,33 @@ grep "forget.*(guix build-system gnu)" "$module_dir/err" # hint rm -f "$module_dir"/* +# Unbound variable: don't suggest modules that do not export the variable. +cat > "$module_dir/aa-private.scm" < "$module_dir/bb-public.scm" < "$module_dir/cc-user.scm" < "$module_dir/err" +cat "$module_dir/err" +grep "make-thing.*unbound" "$module_dir/err" # actual error +grep "forget.*(bb-public)" "$module_dir/err" # hint + +rm -f "$module_dir"/* + # Wrong 'define-module' clause reported by 'warn-about-load-error'. cat > "$module_dir/foo.scm" < Date: Fri, 16 Oct 2020 14:55:00 +0200 Subject: gexp: Add 'assume-valid-file-name' syntax for use with 'local-file'. * guix/gexp.scm (assume-valid-file-name): New variable. (local-file): Add clause with (assume-valid-file-name file). --- guix/gexp.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/gexp.scm b/guix/gexp.scm index 25e4881d21..76fffc4908 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -48,6 +48,7 @@ gexp-input-output gexp-input-native? + assume-valid-file-name local-file local-file? local-file-file @@ -424,6 +425,12 @@ vicinity of DIRECTORY." (string-append directory "/" file)) (else file)))) +(define-syntax-rule (assume-valid-file-name file) + "This is a syntactic keyword to tell 'local-file' that it can assume that +the given file name is valid, even if it's not a string literal, and thus not +warn about it." + file) + (define-syntax local-file (lambda (s) "Return an object representing local file FILE to add to the store; this @@ -442,13 +449,20 @@ where FILE is the entry's absolute file name and STAT is the result of This is the declarative counterpart of the 'interned-file' monadic procedure. It is implemented as a macro to capture the current source directory where it appears." - (syntax-case s () + (syntax-case s (assume-valid-file-name) ((_ file rest ...) (string? (syntax->datum #'file)) ;; FILE is a literal, so resolve it relative to the source directory. #'(%local-file file (delay (absolute-file-name file (current-source-directory))) rest ...)) + ((_ (assume-valid-file-name file) rest ...) + ;; FILE is not a literal, so resolve it relative to the source + ;; directory. Since the user declared FILE is valid, do not pass + ;; #:literal? #f so that we do not warn about it later on. + #'(%local-file file + (delay (absolute-file-name file (current-source-directory))) + rest ...)) ((_ file rest ...) ;; Resolve FILE relative to the current directory. (with-syntax ((location (datum->syntax s (syntax-source s)))) @@ -456,7 +470,7 @@ appears." (delay (absolute-file-name file (getcwd))) rest ... #:location 'location - #:literal? #f))) + #:literal? #f))) ;warn if FILE is relative ((_) #'(syntax-error "missing file name")) (id -- cgit v1.2.3 From f045a7a9262c0291175533c92cdd73e43d5e2f6b Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Thu, 15 Oct 2020 18:32:59 +0200 Subject: import: utils: Fix license name mismatches and define CUA-OPL-1.0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/licenses.scm (cua-opl1.0): New variable. * guix/import/utils.scm (spdx-string->license): Rename licenses to fit the internal names and add a notice pointing to guix/licenses.scm. Signed-off-by: Ludovic Courtès --- guix/import/utils.scm | 14 +++++++++----- guix/licenses.scm | 10 ++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 0cfa1f8321..145515c489 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017, 2019, 2020 Ricardo Wurmus ;;; Copyright © 2018 Oleg Pykhalov ;;; Copyright © 2019 Robert Vollmert +;;; Copyright © 2020 Helio Machado <0x2b3bfa0+guix@googlemail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -124,9 +125,12 @@ of the string VERSION is replaced by the symbol 'version." ;; https://spdx.org/licenses/ ;; The psfl, gfl1.0, nmap, repoze ;; licenses doesn't have SPDX identifiers + ;; + ;; Please update guix/licenses.scm when modifying + ;; this list to avoid mismatches. (match str - ("AGPL-1.0" 'license:agpl-1.0) - ("AGPL-3.0" 'license:agpl-3.0) + ("AGPL-1.0" 'license:agpl1) + ("AGPL-3.0" 'license:agpl3) ("Apache-1.1" 'license:asl1.1) ("Apache-2.0" 'license:asl2.0) ("BSL-1.0" 'license:boost1.0) @@ -166,8 +170,8 @@ of the string VERSION is replaced by the symbol 'version." ("LGPL-2.0+" 'license:lgpl2.0+) ("LGPL-2.1" 'license:lgpl2.1) ("LGPL-2.1+" 'license:lgpl2.1+) - ("LGPL-3.0" 'license:lgpl3.0) - ("LGPL-3.0+" 'license:lgpl3.0+) + ("LGPL-3.0" 'license:lgpl3) + ("LGPL-3.0+" 'license:lgpl3+) ("MPL-1.0" 'license:mpl1.0) ("MPL-1.1" 'license:mpl1.1) ("MPL-2.0" 'license:mpl2.0) @@ -175,7 +179,7 @@ of the string VERSION is replaced by the symbol 'version." ("NCSA" 'license:ncsa) ("OpenSSL" 'license:openssl) ("OLDAP-2.8" 'license:openldap2.8) - ("CUA-OPL-1.0" 'license:opl1.0) + ("CUA-OPL-1.0" 'license:cua-opl1.0) ("QPL-1.0" 'license:qpl) ("Ruby" 'license:ruby) ("SGI-B-2.0" 'license:sgifreeb2.0) diff --git a/guix/licenses.scm b/guix/licenses.scm index cd43386102..255b755e6c 100644 --- a/guix/licenses.scm +++ b/guix/licenses.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2017 Arun Isaac ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2020 André Batista +;;; Copyright © 2020 Helio Machado <0x2b3bfa0+guix@googlemail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ artistic2.0 clarified-artistic copyleft-next cpl1.0 + cua-opl1.0 edl1.0 epl1.0 epl2.0 @@ -117,6 +119,9 @@ ;;; https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix ;;; https://www.gnu.org/licenses/license-list ;;; +;;; Please update spdx-string->license from guix/import/utils.scm +;;; when modifying this list to avoid mismatches. +;;; ;;; Code: (define agpl1 @@ -269,6 +274,11 @@ at URI, which may be a file:// URI pointing the package's tree." "http://directory.fsf.org/wiki/License:CPLv1.0" "https://www.gnu.org/licenses/license-list#CommonPublicLicense10")) +(define cua-opl1.0 + (license "CUA Office Public License v1.0" + "https://spdx.org/licenses/CUA-OPL-1.0.html" + "https://opensource.org/licenses/CUA-OPL-1.0")) + (define edl1.0 (license "EDL 1.0" "http://directory.fsf.org/wiki/License:EDLv1.0" -- cgit v1.2.3 From 6be71461309bad19dcd96faa151ca691d87f28df Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 18 Oct 2020 00:21:33 +0200 Subject: gexp: 'assume-valid-file-name' has files looked up under the CWD. Fixes a bug introduced in 5d4ad8e1be6d60c38577e2f3d92cc5642b12eff0, whereby files enclosed in 'assume-valid-file-name' would be looked up relative to the source directory instead of relative to the current directory. * guix/gexp.scm (local-file): In the 'assume-valid-file-name' case, look up FILE relative to the current working directory. --- guix/gexp.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/gexp.scm b/guix/gexp.scm index 76fffc4908..9339b226b7 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -457,11 +457,11 @@ appears." (delay (absolute-file-name file (current-source-directory))) rest ...)) ((_ (assume-valid-file-name file) rest ...) - ;; FILE is not a literal, so resolve it relative to the source + ;; FILE is not a literal, so resolve it relative to the current ;; directory. Since the user declared FILE is valid, do not pass ;; #:literal? #f so that we do not warn about it later on. #'(%local-file file - (delay (absolute-file-name file (current-source-directory))) + (delay (absolute-file-name file (getcwd))) rest ...)) ((_ file rest ...) ;; Resolve FILE relative to the current directory. -- cgit v1.2.3 From eaf096398349a484bd23fd829755f7dfaf237ab4 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Arruga Vivas Date: Mon, 22 Apr 2019 14:44:22 +0200 Subject: system: Provide locale information to the bootloader. * gnu/machine/ssh.scm (roll-back-managed-host): Use locale information from boot-parameters. * gnu/system.scm (operating-system-bootcfg): Provide locale information to the bootloader. * guix/system/script.scm (reinstall-bootloader): Use locale information from boot-parameters. --- gnu/machine/ssh.scm | 3 +++ gnu/system.scm | 2 ++ guix/scripts/system.scm | 2 ++ 3 files changed, 7 insertions(+) (limited to 'guix') diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 35b42add48..5020bd362f 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -480,6 +480,8 @@ an environment type of 'managed-host." (raise roll-back-failure))) (entries -> (map boot-parameters->menu-entry (list (second boot-parameters)))) + (locale -> (boot-parameters-locale + (second boot-parameters))) (old-entries -> (map boot-parameters->menu-entry (drop boot-parameters 2))) (bootloader -> (operating-system-bootloader @@ -489,6 +491,7 @@ an environment type of 'managed-host." (bootloader-configuration-bootloader bootloader)) bootloader entries + #:locale locale #:old-entries old-entries))) (remote-result (machine-remote-eval machine remote-exp))) (when (eqv? 'error remote-result) diff --git a/gnu/system.scm b/gnu/system.scm index e8fe41cc24..a3122eaa65 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1242,6 +1242,7 @@ a list of , to populate the \"old entries\" menu." (let* ((file-systems (operating-system-file-systems os)) (root-fs (operating-system-root-file-system os)) (root-device (file-system-device root-fs)) + (locale (operating-system-locale os)) (params (operating-system-boot-parameters os root-device #:system-kernel-arguments? #t)) @@ -1254,6 +1255,7 @@ a list of , to populate the \"old entries\" menu." (generate-config-file bootloader-conf (list entry) #:old-entries old-entries + #:locale locale #:store-directory-prefix (btrfs-store-subvolume-file-name file-systems)))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 939559e719..9ed5c26483 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -384,6 +384,7 @@ STORE is an open connection to the store." ;; Make the specified system generation the default entry. (params (first (profile-boot-parameters %system-profile (list number)))) + (locale (boot-parameters-locale params)) (old-generations (delv number (reverse (generation-numbers %system-profile)))) (old-params (profile-boot-parameters @@ -396,6 +397,7 @@ STORE is an open connection to the store." ((bootcfg (lower-object ((bootloader-configuration-file-generator bootloader) bootloader-config entries + #:locale locale #:old-entries old-entries))) (drvs -> (list bootcfg))) (mbegin %store-monad -- cgit v1.2.3