From patchwork Wed Aug 24 08:57:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Legoll X-Patchwork-Id: 14896 Received: (qmail 84758 invoked by uid 89); 24 Aug 2016 08:58:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=recompiles, explanations X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Aug 2016 08:58:27 +0000 Received: from localhost ([::1]:50257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcU0v-0001Au-23 for patchwork@sourceware.org; Wed, 24 Aug 2016 04:58:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcU0p-00018K-Ed for guix-devel@gnu.org; Wed, 24 Aug 2016 04:58:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcU0k-0004kd-E9 for guix-devel@gnu.org; Wed, 24 Aug 2016 04:58:18 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:35959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcU0k-0004kM-9O; Wed, 24 Aug 2016 04:58:14 -0400 Received: by mail-qk0-f179.google.com with SMTP id l2so8635488qkf.3; Wed, 24 Aug 2016 01:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Cfwm2kc/h7Qy6i6i8T4bAtTJcvjEKVt7WrVnypGGLvg=; b=T+ZTgAV9L1iZy4Mufx1b3VUZzKpMOlnBxnJ+xTQTdK7DYM8YgZaSFPrcvLEUgxS7Td sAtiWS3F6kR0KD3BUn0ZL8eXzSS9/oLs4biEK3R7cn44uSIoqVRKhzLISfz1DuK/n5tm TFckfTJ3V21sxxnHvwRTlpAZ7SGFPy32CYUP2TsGGT+yP6MhPJbyICHnKix/bUKbhvox 7kPErekkc2KFFP24RDF8AyADUbVkW5DKkicr9hUwXh4YRBdYerV0Bfcz9HZHSoGf/Ziu mJIbG9xPcPb3caBpYwe148+flzJu3Ynl8toMXxmBNd7BrmLzzyVOAtm/mSkSHP3IR3W7 4jsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Cfwm2kc/h7Qy6i6i8T4bAtTJcvjEKVt7WrVnypGGLvg=; b=GGqjXTSA12ddMN57A4v4m7MLK7++cVP0DxRjU1cFN3Hzk5Ch03RWquy3i0F6Z2QnSs fHxYR+B9wTM2CbjYUI3y2sAARd/kMB2U9rbA8Xclri99oip4tEBTg3Ql1GalpcXV/muZ g9uC7YDWPJp4eYA88qQERNA6RE9mWbd4NAzCysrVPW0hnsU98YZlRMNMyIRfpSkeqlDR /5fKHlyHauDqo5WlUa5K4CnA6lak4GuTE4gBUANxfqysOB+dgWuO7AfHYw/SeQNGAJpe AF792z/kuqJFJF1FTZa6F5YEhGQ+zqcj3qL5fZoAaFHPBT9GL+wgCkf2dEqp5Apy7KEA E5Eg== X-Gm-Message-State: AE9vXwOlU0Pf2qMUTySWsuSO0UEj3/SWOm6nMenrE5Dtn7V96JaetbiaXJM4wjy5nLQiPkYe/MD3QX9Bnf3BQA== X-Received: by 10.233.222.133 with SMTP id s127mr2251744qkf.166.1472029033807; Wed, 24 Aug 2016 01:57:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.34.44 with HTTP; Wed, 24 Aug 2016 01:57:13 -0700 (PDT) In-Reply-To: References: <20160822180117.GA17367@jasmine> From: Vincent Legoll Date: Wed, 24 Aug 2016 10:57:13 +0200 Message-ID: Subject: Re: guix pull avoidance To: Leo Famulari , guix-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.179 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" Hello, > How's the following totally untested, probably buggy patch ? After painful testing (I have to remove the .config/guix/latest symlink each time, make it point back to ~/guix_git with my modifications, and it recompiles a whole bunch of scm files...) Any idea how to improve that ? > it's in RFC, to show the intended effects... I fixed a few silly mistakes... > What's inside: > > - create a symlink /gnu/store/latest pointing to the last installed > /gnu/store/*-guix-latest This is failing with : guix pull: error: symlink: Read-only file system: "/gnu/store/latest.new" Despite my tries to replicate the (run-with-store (mlet* %store-monad ...)) thing, which AFAIU*, should make writing to the store doable... What am I missing ? * I don't think I fully understand that, as the "->" in the mlet* for instance, I couldn't find explanations in guile's refman nor guix's... Please help From f0d8a8f1e5a5c69752c2c6139b6a5325734c4ba1 Mon Sep 17 00:00:00 2001 From: Vincent Legoll Date: Tue, 23 Aug 2016 15:06:12 +0200 Subject: [PATCH] Add --nodownload CLI option * guix/scripts/pull.scm (show-help, %option): add new option (guix-pull): handle --nodownload option (build-and-install): add store parameter, create $STORE/latest symlink Signed-off-by: Vincent Legoll --- guix/scripts/pull.scm | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index a4824e4..b1911ba 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -79,6 +79,8 @@ Download and deploy the latest version of Guix.\n")) --url=URL download the Guix tarball from URL")) (display (_ " --bootstrap use the bootstrap Guile to build the new Guix")) + (display (_ " + --nodownload only switch to the last downloaded version of Guix")) (newline) (display (_ " -h, --help display this help and exit")) @@ -99,6 +101,9 @@ Download and deploy the latest version of Guix.\n")) (option '("bootstrap") #f #f (lambda (opt name arg result) (alist-cons 'bootstrap? #t result))) + (option '("nodownload") #f #f + (lambda (opt name arg result) + (alist-cons 'nodownload? #t result))) (option '(#\h "help") #f #f (lambda args @@ -197,6 +202,7 @@ contained therein." (if built? (mlet* %store-monad ((latest -> (string-append config-dir "/latest")) + (latest-in-store -> (string-append %store-directory "/latest")) (done (indirect-root-added latest))) (if (and (file-exists? latest) (string=? (readlink latest) source-dir)) @@ -205,6 +211,9 @@ contained therein." (return #t)) (begin (switch-symlinks latest source-dir) + (switch-symlinks latest-in-store source-dir) + (display "symlinked: " latest source-dir) + (display "symlinked: " latest-in-store source-dir) (format #t (_ "updated ~a successfully deployed under `~a'~%") %guix-package-name latest) @@ -224,18 +233,27 @@ contained therein." (with-error-handling (let* ((opts (parse-options)) (store (open-connection)) + (config-dir (config-directory)) (url (assoc-ref opts 'tarball-url))) - (let ((tarball (download-to-store store url "guix-latest.tar.gz"))) - (unless tarball - (leave (_ "failed to download up-to-date source, exiting\n"))) - (parameterize ((%guile-for-build - (package-derivation store - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.0))))) + (if (assoc-ref opts 'nodownload?) (run-with-store store - (build-and-install tarball (config-directory) - #:verbose? (assoc-ref opts 'verbose?)))))))) + (mlet* %store-monad + ((latest -> (string-append config-dir "/latest")) + (latest-in-store -> (string-append %store-directory "/latest"))) + (begin + (switch-symlinks latest latest-in-store) + (display "symlinked: " latest latest-in-store)))) + (let ((tarball (download-to-store store url "guix-latest.tar.gz"))) + (unless tarball + (leave (_ "failed to download up-to-date source, exiting\n"))) + (parameterize ((%guile-for-build + (package-derivation store + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.0))))) + (run-with-store store + (build-and-install tarball config-dir + #:verbose? (assoc-ref opts 'verbose?))))))))) ;; Local Variables: ;; eval: (put 'with-PATH 'scheme-indent-function 1) -- 2.9.3