From ad1d03fcf0472c88c9f63e8126274320cb0a076e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 12 Mar 2018 15:14:01 +0100 Subject: build-system: minify: Do not import (ice-9 popen) in the build environment. The (ice-9 popen) module should not be added to the imported-modules here, because that depends on the Guile that is used on the host side. * guix/build-system/minify.scm (%minify-build-system-modules): Remove import of (ice-9 popen). --- guix/build-system/minify.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build-system/minify.scm b/guix/build-system/minify.scm index af90a32f59..21d84a179a 100644 --- a/guix/build-system/minify.scm +++ b/guix/build-system/minify.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017 Ricardo Wurmus +;;; Copyright © 2017, 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,7 +39,6 @@ (define %minify-build-system-modules ;; Build-side modules imported by default. `((guix build minify-build-system) - (ice-9 popen) ,@%gnu-build-system-modules)) (define (default-uglify-js) -- cgit v1.2.3 From 61b1dbbdcd87f6b37d6b87715a9a4da4e63485ab Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 15 Mar 2018 10:28:22 +0100 Subject: guix system: Add '--skip-checks'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by Tomáš Čech . * guix/scripts/system.scm (perform-action): Add #:skip-safety-checks? and honor it. (show-help, %options): Add --skip-checks. (process-action): Pass #:skip-safety-checks? to 'perform-action'. * doc/guix.texi (Invoking guix system): Document --skip-checks. --- doc/guix.texi | 10 ++++++++++ guix/scripts/system.scm | 18 +++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index d3a7908f9c..bcea89e07b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20458,6 +20458,16 @@ of the image size as a function of the size of the system declared in Make @var{file} a symlink to the result, and register it as a garbage collector root. +@item --skip-checks +Skip pre-installation safety checks. + +By default, @command{guix system init} and @command{guix system +reconfigure} perform safety checks: they make sure the file systems that +appear in the @code{operating-system} declaration actually exist +(@pxref{File Systems}), and that any Linux kernel modules that may be +needed at boot time are listed in @code{initrd-modules} (@pxref{Initial +RAM Disk}). Passing this option skips these tests altogether. + @item --on-error=@var{strategy} Apply @var{strategy} when an error occurs when reading @var{file}. @var{strategy} may be one of the following: diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index acfccce96d..f0c4a2ba1b 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -733,7 +733,8 @@ and TARGET arguments." (#$installer #$bootloader #$device #$target)))))) (define* (perform-action action os - #:key install-bootloader? + #:key skip-safety-checks? + install-bootloader? dry-run? derivations-only? use-substitutes? bootloader-target target image-size file-system-type full-boot? @@ -750,7 +751,10 @@ When DERIVATIONS-ONLY? is true, print the derivation file name(s) without building anything. When GC-ROOT is a path, also make that path an indirect root of the build -output when building a system derivation, such as a disk image." +output when building a system derivation, such as a disk image. + +When SKIP-SAFETY-CHECKS? is true, skip the file system and initrd module +static checks." (define println (cut format #t "~a~%" <>)) @@ -760,7 +764,8 @@ output when building a system derivation, such as a disk image." ;; Check whether the declared file systems exist. This is better than ;; instantiating a broken configuration. Assume that we can only check if ;; running as root. - (when (memq action '(init reconfigure)) + (when (and (not skip-safety-checks?) + (memq action '(init reconfigure))) (check-mapped-devices os) (when (zero? (getuid)) (check-file-system-availability (operating-system-file-systems os)) @@ -933,6 +938,8 @@ Some ACTIONS support additional ARGS.\n")) --expose=SPEC for 'vm', expose host file system according to SPEC")) (display (G_ " --full-boot for 'vm', make a full boot sequence")) + (display (G_ " + --skip-checks skip file system and initrd module safety checks")) (newline) (display (G_ " -h, --help display this help and exit")) @@ -974,6 +981,9 @@ Some ACTIONS support additional ARGS.\n")) (option '("full-boot") #f #f (lambda (opt name arg result) (alist-cons 'full-boot? #t result))) + (option '("skip-checks") #f #f + (lambda (opt name arg result) + (alist-cons 'skip-safety-checks? #t result))) (option '("share") #t #f (lambda (opt name arg result) @@ -1067,6 +1077,8 @@ resulting from command-line parsing." #:derivations-only? (assoc-ref opts 'derivations-only?) #:use-substitutes? (assoc-ref opts 'substitutes?) + #:skip-safety-checks? + (assoc-ref opts 'skip-safety-checks?) #:file-system-type (assoc-ref opts 'file-system-type) #:image-size (assoc-ref opts 'image-size) #:full-boot? (assoc-ref opts 'full-boot?) -- cgit v1.2.3 From e72077c5356e2db21002b351a7a79901232a2d3b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 17 Mar 2018 04:02:25 -0400 Subject: download: Remove TU Wien mirror. * guix/download.scm (%mirrors): Remove gd.tuwien.ac.at, which no longer seems to exist. --- guix/download.scm | 3 --- 1 file changed, 3 deletions(-) (limited to 'guix') diff --git a/guix/download.scm b/guix/download.scm index 55da2c1d37..5044534bf5 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -66,7 +66,6 @@ "ftp://gcc.gnu.org/pub/gcc/" ,@(map (cut string-append <> "/gcc") gnu-mirrors)) (gnupg - "http://gd.tuwien.ac.at/privacy/gnupg/" "http://artfiles.org/gnupg.org" "http://www.crysys.hu/" "https://gnupg.org/ftp/gcrypt/" @@ -143,7 +142,6 @@ "http://apache.belnet.be/" "http://mirrors.ircam.fr/pub/apache/" "http://apache-mirror.rbc.ru/pub/apache/" - "ftp://gd.tuwien.ac.at/pub/infosys/servers/http/apache/dist/" ;; As a last resort, try the archive. "http://archive.apache.org/dist/") @@ -163,7 +161,6 @@ "ftp://ftp.piotrkosoft.net/pub/mirrors/ftp.x.org/" "ftp://ftp.portal-to-web.de/pub/mirrors/x.org/" "ftp://ftp.solnet.ch/mirror/x.org/" - "ftp://gd.tuwien.ac.at/X11/" "ftp://mi.mirror.garr.it/mirrors/x.org/" "ftp://mirror.cict.fr/x.org/" "ftp://mirror.switch.ch/mirror/X11/" -- cgit v1.2.3 From 44dd3d579db3aa467e41d0b431029e46cae8e12d Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Fri, 16 Mar 2018 14:53:09 +0100 Subject: import: elpa: use https in download URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/elpa.scm (elpa-url): Use HTTPS. Signed-off-by: Ludovic Courtès --- guix/import/elpa.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 45a419217c..7f76a13adb 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -69,9 +69,9 @@ NAMES (strings)." (define* (elpa-url #:optional (repo 'gnu)) "Retrun the URL of REPO." (let ((elpa-archives - '((gnu . "http://elpa.gnu.org/packages") - (melpa-stable . "http://stable.melpa.org/packages") - (melpa . "http://melpa.org/packages")))) + '((gnu . "https://elpa.gnu.org/packages") + (melpa-stable . "https://stable.melpa.org/packages") + (melpa . "https://melpa.org/packages")))) (assq-ref elpa-archives repo))) (define* (elpa-fetch-archive #:optional (repo 'gnu)) -- cgit v1.2.3 From 07d2fed2f60c43372446bee5fa2ac779e4acb0eb Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Fri, 16 Mar 2018 14:55:10 +0100 Subject: import: elpa: Fix typos in documentation strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/elpa.scm: Fix typos in docstrings. Signed-off-by: Ludovic Courtès --- guix/import/elpa.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 7f76a13adb..5d3d04ee7c 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -67,7 +67,7 @@ NAMES (strings)." (string-append package-name-prefix (string-downcase name))))) (define* (elpa-url #:optional (repo 'gnu)) - "Retrun the URL of REPO." + "Retrieve the URL of REPO." (let ((elpa-archives '((gnu . "https://elpa.gnu.org/packages") (melpa-stable . "https://stable.melpa.org/packages") @@ -75,7 +75,7 @@ NAMES (strings)." (assq-ref elpa-archives repo))) (define* (elpa-fetch-archive #:optional (repo 'gnu)) - "Retrive the archive with the list of packages available from REPO." + "Retrieve the archive with the list of packages available from REPO." (let ((url (and=> (elpa-url repo) (cut string-append <> "/archive-contents")))) (if url -- cgit v1.2.3 From 95bd9f65a8ee64d17707a76aebc8720bbd961b68 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 17 Mar 2018 23:59:18 +0100 Subject: git: 'switch-to-ref' accepts short commit IDs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by Björn Höfling . * guix/git.scm (switch-to-ref): When REF is a commit, check the length of COMMIT and use 'object-lookup-prefix' if available. --- guix/git.scm | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'guix') diff --git a/guix/git.scm b/guix/git.scm index fc41e2ace3..d31c35f64f 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,8 @@ #:use-module (rnrs bytevectors) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:export (%repository-cache-directory latest-repository-commit)) @@ -94,17 +97,32 @@ create the store directory name." (define (switch-to-ref repository ref) "Switch to REPOSITORY's branch, commit or tag specified by REF." - (let* ((oid (match ref - (('branch . branch) - (reference-target - (branch-lookup repository branch BRANCH-REMOTE))) - (('commit . commit) - (string->oid commit)) - (('tag . tag) - (reference-name->oid repository - (string-append "refs/tags/" tag))))) - (obj (object-lookup repository oid))) - (reset repository obj RESET_HARD))) + (define obj + (match ref + (('branch . branch) + (let ((oid (reference-target + (branch-lookup repository branch BRANCH-REMOTE)))) + (object-lookup repository oid))) + (('commit . commit) + (let ((len (string-length commit))) + ;; 'object-lookup-prefix' appeared in Guile-Git in Mar. 2018, so we + ;; can't be sure it's available. Furthermore, 'string->oid' used to + ;; read out-of-bounds when passed a string shorter than 40 chars, + ;; which is why we delay calls to it below. + (if (< len 40) + (if (module-defined? (resolve-interface '(git object)) + 'object-lookup-prefix) + (object-lookup-prefix repository (string->oid commit) len) + (raise (condition + (&message + (message "long Git object ID is required"))))) + (object-lookup repository (string->oid commit))))) + (('tag . tag) + (let ((oid (reference-name->oid repository + (string-append "refs/tags/" tag)))) + (object-lookup repository oid))))) + + (reset repository obj RESET_HARD)) (define* (latest-repository-commit store url #:key -- cgit v1.2.3