summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-11-17 18:00:28 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-11-17 18:00:28 -0500
commit129b9b16d9b588316cc997cf8f4fefe30961a417 (patch)
treebc1dc50e83af6e9afb2ee24cd32f5e42e039642e /guix
parent5f9c92dd6285a1ef326cf5aa99781f1f3acbd245 (diff)
parent9113de2ca2db195908e3262b3752f8392ada8630 (diff)
Merge remote-tracking branch 'origin/version-1.2.0' into master
Conflicts: gnu/packages/bioinformatics.scm The python-pysam package fixed in master was kept instead of the update done in the version-1.2.0 branch.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/build.scm4
-rw-r--r--guix/scripts/pack.scm5
-rw-r--r--guix/scripts/publish.scm28
-rw-r--r--guix/scripts/pull.scm2
-rw-r--r--guix/self.scm10
5 files changed, 39 insertions, 10 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index e9de97c881..cc020632af 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -51,7 +51,9 @@
#:use-module ((guix progress) #:select (current-terminal-columns))
#:use-module ((guix build syscalls) #:select (terminal-columns))
#:use-module (guix transformations)
- #:export (%standard-build-options
+ #:export (log-url
+
+ %standard-build-options
set-build-options-from-command-line
set-build-options-from-command-line*
show-build-options-help
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 06509ace2d..0b29997200 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -59,11 +59,16 @@
#:use-module (srfi srfi-37)
#:use-module (ice-9 match)
#:export (compressor?
+ compressor-name
+ compressor-extenstion
+ compressor-command
+ %compressors
lookup-compressor
self-contained-tarball
docker-image
squashfs-image
+ %formats
guix-pack))
;; Type of a compression tool.
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index a976a9ac60..f1a9970a7f 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2020 by Amar M. Singh <nly@disroot.org>
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -250,6 +251,21 @@ usage."
("WantMassQuery" . 0)
("Priority" . 100)))
+;;; A common buffer size value used for the TCP socket SO_SNDBUF option and
+;;; the gzip compressor buffer size.
+(define %default-buffer-size
+ (* 208 1024))
+
+(define %default-socket-options
+ ;; List of options passed to 'setsockopt' when transmitting files.
+ (list (list SO_SNDBUF %default-buffer-size)))
+
+(define* (configure-socket socket #:key (level SOL_SOCKET)
+ (options %default-socket-options))
+ "Apply multiple option tuples in OPTIONS to SOCKET, using LEVEL."
+ (for-each (cut apply setsockopt socket level <>)
+ options))
+
(define (signed-string s)
"Sign the hash of the string S with the daemon's key. Return a canonical
sexp for the signature."
@@ -569,7 +585,7 @@ requested using POOL."
(lambda (port)
(write-file item port))
#:level (compression-level compression)
- #:buffer-size (* 128 1024))
+ #:buffer-size %default-buffer-size)
(rename-file (string-append nar ".tmp") nar))
('lzip
;; Note: the file port gets closed along with the lzip port.
@@ -866,7 +882,7 @@ or if EOF is reached."
;; 'make-gzip-output-port' wants a file port.
(make-gzip-output-port (response-port response)
#:level level
- #:buffer-size (* 64 1024)))
+ #:buffer-size %default-buffer-size))
(($ <compression> 'lzip level)
(make-lzip-output-port (response-port response)
#:level level))
@@ -891,8 +907,7 @@ blocking."
client))
(port (begin
(force-output client)
- (setsockopt client SOL_SOCKET
- SO_SNDBUF (* 128 1024))
+ (configure-socket client)
(nar-response-port response compression))))
;; XXX: Given our ugly workaround for <http://bugs.gnu.org/21093> in
;; 'render-nar', BODY here is just the file name of the store item.
@@ -922,7 +937,7 @@ blocking."
size)
client))
(output (response-port response)))
- (setsockopt client SOL_SOCKET SO_SNDBUF (* 128 1024))
+ (configure-socket client)
(if (file-port? output)
(sendfile output input size)
(dump-port input output))
@@ -1067,7 +1082,8 @@ methods, return the applicable compression."
(define (open-server-socket address)
"Return a TCP socket bound to ADDRESS, a socket address."
(let ((sock (socket (sockaddr:fam address) SOCK_STREAM 0)))
- (setsockopt sock SOL_SOCKET SO_REUSEADDR 1)
+ (configure-socket sock #:options (cons (list SO_REUSEADDR 1)
+ %default-socket-options))
(bind sock address)
sock))
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index bb1b560a22..7fd8b3f1a4 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -385,7 +385,7 @@ previous generation. Return true if there are news to display."
(and=> (relative-generation profile -1)
(cut generation-file-name profile <>)))
- (when previous
+ (and previous
(let ((old-channels (profile-channels previous))
(new-channels (profile-channels profile)))
;; Find the channels present in both PROFILE and PREVIOUS, and print
diff --git a/guix/self.scm b/guix/self.scm
index bbfd2f1b95..026dcd9c1a 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -400,6 +400,12 @@ a list of extra files, such as '(\"contributing\")."
(find-files directory
"\\.[a-z]{2}(_[A-Z]{2})?\\.po$")))
+ (define parallel-jobs
+ ;; Limit thread creation by 'n-par-for-each'. Going beyond can
+ ;; lead libgc 8.0.4 to abort with:
+ ;; mmap(PROT_NONE) failed
+ (min (parallel-job-count) 4))
+
(mkdir #$output)
(copy-recursively #$documentation "."
#:log (%make-void-port "w"))
@@ -415,14 +421,14 @@ a list of extra files, such as '(\"contributing\")."
(setenv "LC_ALL" "en_US.UTF-8")
(setlocale LC_ALL "en_US.UTF-8")
- (n-par-for-each (parallel-job-count)
+ (n-par-for-each parallel-jobs
(match-lambda
((language . po)
(translate-texi "guix" po language
#:extras '("contributing"))))
(available-translations "." "guix-manual"))
- (n-par-for-each (parallel-job-count)
+ (n-par-for-each parallel-jobs
(match-lambda
((language . po)
(translate-texi "guix-cookbook" po language)))