unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 2/4] guix build: Add --max-jobs option (without handling code).
       [not found] ` <CAJ41eex60Gk1i4Lir3Qx3tNnqvhyR_KvQugjhTipORqKe+ak8g@mail.gmail.com>
@ 2014-11-22 22:35   ` Deck Pickard
  0 siblings, 0 replies; only message in thread
From: Deck Pickard @ 2014-11-22 22:35 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2084 bytes --]

* doc/guix.texi: Mention in the docs.
* guix/scripts/build.scm: Extend (show-build-options-help) and
(%standard-build-options) functions.
---
doc/guix.texi | 5 +++++
guix/scripts/build.scm | 14 ++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 2a33cb5..02edee0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2676,6 +2676,11 @@ may be helpful when debugging setup issues with the
build daemon.
Allow the use of up to @var{n} CPU cores for the build. The special
value @code{0} means to use as many CPU cores as available.

+@item --max-jobs=@var{n}
+@itemx -M @var{n}
+Allow at most @var{n} build jobs. The special value @code{0} means to
+create as many jobs as the number of available CPU cores.
+
@end table

Behind the scenes, @command{guix build} is essentially an interface to
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 7b7f419..d10b95b 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -119,7 +119,9 @@ options handled by
'set-build-options-from-command-line', and listed in
(display (_ "
--verbosity=LEVEL use the given verbosity LEVEL"))
(display (_ "
- -c, --cores=N allow the use of up to N CPU cores for the build")))
+ -c, --cores=N allow the use of up to N CPU cores for the build"))
+ (display (_ "
+ -M, --max-jobs=N allow at most N build jobs")))

(define (set-build-options-from-command-line store opts)
"Given OPTS, an alist as returned by 'args-fold' given
@@ -192,7 +194,15 @@ options handled by
'set-build-options-from-command-line', and listed in
(let ((c (false-if-exception (string->number arg))))
(if c
(apply values (alist-cons 'cores c result) rest)
- (leave (_ "~a: not a number~%") arg)))))))
+ (leave (_ "not a number: '~a' option argument: ~a~%")
+ name arg)))))
+ (option '(#\M "max-jobs") #t #f
+ (lambda (opt name arg result . rest)
+ (let ((c (false-if-exception (string->number arg))))
+ (if c
+ (apply values (alist-cons 'max-jobs c result) rest)
+ (leave (_ "not a number: '~a' option argument: ~a~%")
+ name arg)))))))

;;;
-- 
2.1.2

[-- Attachment #2: Type: text/html, Size: 2503 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-22 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <-6243148198355410639@unknownmsgid>
     [not found] ` <CAJ41eex60Gk1i4Lir3Qx3tNnqvhyR_KvQugjhTipORqKe+ak8g@mail.gmail.com>
2014-11-22 22:35   ` [PATCH 2/4] guix build: Add --max-jobs option (without handling code) Deck Pickard

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).