unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob f5468224de119a8d5863d4ce1480a367672ceaac 1353 bytes (raw)
name: build-aux/compile-all.scm 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
(use-modules (system base target)
             (ice-9 threads))

(define compile-options '(format unbound-variable arity-mismatch))

(define (file-mtime<? f1 f2)
  (< (stat:mtime (stat f1))
     (stat:mtime (stat f2))))

(define (scm->go file)
  (string-append (string-drop-right file 4) ".go"))

(define (file->module file)
  (map string->symbol
       (string-split (string-drop-right file 4) #\/)))

(let* ((args (cdr (command-line)))
       (target (car args))
       (files (cdr args)))
  (for-each
   (lambda (file)
     (let ((go (scm->go file)))
       (unless (and (file-exists? go)
                    (file-mtime<? file go))
         (let ((module (file->module file)))
           (format #t "  LOAD ~s~%" module)
           (resolve-interface module)))))
   files)
  (with-target target
    (lambda ()
      (let ((mutex (make-mutex)))
        (par-for-each
         (lambda (file)
           (let ((go (scm->go file)))
             (unless (and (file-exists? go)
                          (file-mtime<? file go))
               (with-mutex mutex
                 (format #t "  GUILEC ~s~%" file)
                 (force-output))
               (compile-file file #:output-file go #:opts compile-options)
               (with-mutex mutex
                 (format #t "  WROTE ~s~%" go)
                 (force-output)))))
         files)))))

debug log:

solving f546822 ...
found f546822 in https://yhetil.org/guix-devel/87mvsgxpef.fsf@T420.taylan/

applying [1/1] https://yhetil.org/guix-devel/87mvsgxpef.fsf@T420.taylan/
diff --git a/build-aux/compile-all.scm b/build-aux/compile-all.scm
new file mode 100644
index 0000000..f546822

Checking patch build-aux/compile-all.scm...
Applied patch build-aux/compile-all.scm cleanly.

index at:
100644 f5468224de119a8d5863d4ce1480a367672ceaac	build-aux/compile-all.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).