From 240a9c69a6064544a616acc521c993542c364948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 12 Sep 2018 15:08:38 +0200 Subject: perform-download: Optionally report a "download-progress" trace. * guix/scripts/perform-download.scm (perform-download): Add #:print-build-trace? and pass it to 'url-fetch'. (guix-perform-download): Define 'print-build-trace?' and pass it to 'perform-download'. * guix/build/download.scm (ftp-fetch): Add #:print-build-trace? and honor it. (url-fetch): Likewise. * nix/libstore/builtins.cc (builtinDownload): Set _NIX_OPTIONS environment variable. --- guix/build/download.scm | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'guix/build') diff --git a/guix/build/download.scm b/guix/build/download.scm index 315a3554ec..54163849a2 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -115,7 +115,7 @@ and 'guix publish', something like (string-drop path 33) path))) -(define* (ftp-fetch uri file #:key timeout) +(define* (ftp-fetch uri file #:key timeout print-build-trace?) "Fetch data from URI and write it to FILE. Return FILE on success. Bail out if the connection could not be established in less than TIMEOUT seconds." (let* ((conn (match (and=> (uri-userinfo uri) @@ -136,12 +136,17 @@ out if the connection could not be established in less than TIMEOUT seconds." (lambda (out) (dump-port* in out #:buffer-size %http-receive-buffer-size - #:reporter (progress-reporter/file - (uri-abbreviation uri) size)))) - - (ftp-close conn)) - (newline) - file) + #:reporter + (if print-build-trace? + (progress-reporter/trace + file (uri->string uri) size) + (progress-reporter/file + (uri-abbreviation uri) size))))) + + (ftp-close conn) + (unless print-build-trace? + (newline)) + file)) ;; Autoload GnuTLS so that this module can be used even when GnuTLS is ;; not available. At compile time, this yields "possibly unbound @@ -723,7 +728,8 @@ Return a list of URIs." #:key (timeout 10) (verify-certificate? #t) (mirrors '()) (content-addressed-mirrors '()) - (hashes '())) + (hashes '()) + print-build-trace?) "Fetch FILE from URL; URL may be either a single string, or a list of string denoting alternate URLs for FILE. Return #f on failure, and FILE on success. @@ -759,13 +765,18 @@ otherwise simply ignore them." (lambda (output) (dump-port* port output #:buffer-size %http-receive-buffer-size - #:reporter (progress-reporter/file - (uri-abbreviation uri) size)) + #:reporter (if print-build-trace? + (progress-reporter/trace + file (uri->string uri) size) + (progress-reporter/file + (uri-abbreviation uri) size))) (newline))) file))) ((ftp) (false-if-exception* (ftp-fetch uri file - #:timeout timeout))) + #:timeout timeout + #:print-build-trace? + print-build-trace?))) (else (format #t "skipping URI with unsupported scheme: ~s~%" uri) -- cgit v1.2.3 From bb6419f3745911aec87ad79c55bb953b36f246dd Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Thu, 30 Aug 2018 22:08:59 -0400 Subject: build-system: haskell: Add #:cabal-revision argument. Add a #:cabal-revision argument for specifying which Cabal file revision from Hackage should be used. * guix/build-system/haskell.scm (source-url->revision-url): New function. (lower): Accept a cabal-revision keyword argument, convert it to an origin record, and add it to the resulting bag's host-inputs. (haskell-build): Pass the cabal-revision input to the builder as an argument. * guix/build/haskell-build-system.scm (patch-cabal-file): New phase. (%standard-phases): Add it. --- guix/build/haskell-build-system.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'guix/build') diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index 26519ce5a6..be4f5b583b 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -27,6 +27,7 @@ #:use-module (ice-9 regex) #:use-module (ice-9 match) #:use-module (ice-9 vlist) + #:use-module (ice-9 ftw) #:export (%standard-phases haskell-build)) @@ -265,8 +266,19 @@ given Haskell package." (run-setuphs "haddock" haddock-flags) #t)) +(define* (patch-cabal-file #:key cabal-revision #:allow-other-keys) + (when cabal-revision + ;; Cabal requires there to be a single file with the suffix ".cabal". + (match (scandir "." (cut string-suffix? ".cabal" <>)) + ((original) + (format #t "replacing ~s with ~s~%" original cabal-revision) + (copy-file cabal-revision original)) + (_ (error "Could not find a Cabal file to patch.")))) + #t) + (define %standard-phases (modify-phases gnu:%standard-phases + (add-after 'unpack 'patch-cabal-file patch-cabal-file) (delete 'bootstrap) (add-before 'configure 'setup-compiler setup-compiler) (add-before 'install 'haddock haddock) -- cgit v1.2.3 From a7b751965f8420c871ae24aee25f1eb7a217e608 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Tue, 2 Oct 2018 04:57:31 -0400 Subject: build-system/asdf: Properly handle dependency specification casing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build/lisp-utils.scm (normalize-dependency): Modify match clauses to match the upper-case symbols that lisp produces. Signed-off-by: Ludovic Courtès --- guix/build/lisp-utils.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'guix/build') diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 6470cfec97..97bc6197a3 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -84,11 +84,12 @@ (define (normalize-dependency dependency) "Normalize the name of DEPENDENCY. Handles dependency definitions of the dependency-def form described by -." +. +Assume that any symbols in DEPENDENCY will be in upper-case." (match dependency - ((':version name rest ...) + ((':VERSION name rest ...) `(:version ,(normalize-string name) ,@rest)) - ((':feature feature-specification dependency-specification) + ((':FEATURE feature-specification dependency-specification) `(:feature ,feature-specification ,(normalize-dependency dependency-specification))) -- cgit v1.2.3