unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 4/4] guix build: Try to handle --cores and --max-jobs in a sane way.
       [not found] <41991997306568388@unknownmsgid>
@ 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: 2048 bytes --]

* guix/scripts/build.scm (set-build-options-from-command-line): use
make-schedule-sane to parse and set "scheduling" options.
---
guix/scripts/build.scm | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index d10b95b..31f17d2 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -20,6 +20,7 @@
(define-module (guix scripts build)
#:use-module (guix ui)
#:use-module (guix store)
+ #:use-module (guix schedule)
#:use-module (guix derivations)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -127,16 +128,19 @@ options handled by
'set-build-options-from-command-line', and listed in
"Given OPTS, an alist as returned by 'args-fold' given
'%standard-build-options', set the corresponding build options on STORE."
;; TODO: Add more options.
- (set-build-options store
- #:keep-failed? (assoc-ref opts 'keep-failed?)
- #:build-cores (or (assoc-ref opts 'cores) 0)
- #:fallback? (assoc-ref opts 'fallback?)
- #:use-substitutes? (assoc-ref opts 'substitutes?)
- #:use-build-hook? (assoc-ref opts 'build-hook?)
- #:max-silent-time (assoc-ref opts 'max-silent-time)
- #:timeout (assoc-ref opts 'timeout)
- #:print-build-trace (assoc-ref opts 'print-build-trace?)
- #:verbosity (assoc-ref opts 'verbosity)))
+ (let ((sched (make-schedule-sane #:max-cores (assoc-ref opts 'cores)
+ #:max-jobs (assoc-ref opts 'max-jobs))))
+ (set-build-options store
+ #:keep-failed? (assoc-ref opts 'keep-failed?)
+ #:build-cores (schedule-max-cores sched)
+ #:max-build-jobs (schedule-max-jobs sched)
+ #:fallback? (assoc-ref opts 'fallback?)
+ #:use-substitutes? (assoc-ref opts 'substitutes?)
+ #:use-build-hook? (assoc-ref opts 'build-hook?)
+ #:max-silent-time (assoc-ref opts 'max-silent-time)
+ #:timeout (assoc-ref opts 'timeout)
+ #:print-build-trace (assoc-ref opts 'print-build-trace?)
+ #:verbosity (assoc-ref opts 'verbosity))))

(define %standard-build-options
;; List of standard command-line options for tools that build something.
-- 
2.1.2

[-- Attachment #2: Type: text/html, Size: 2402 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] <41991997306568388@unknownmsgid>
2014-11-22 22:35 ` [PATCH 4/4] guix build: Try to handle --cores and --max-jobs in a sane way 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).