From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Mathieu Lirzin <mthl@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: using Cuirass to track a guix packages' git
Date: Fri, 23 Sep 2016 15:44:45 +0200 [thread overview]
Message-ID: <87wpi2buia.fsf@gnu.org> (raw)
In-Reply-To: <871t0adalz.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Fri, 23 Sep 2016 15:11:36 +0200")
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
Jan Nieuwenhuizen writes:
Oops, sent too soon, patch 2 needed this fix
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 0dcf544..5d3922b 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -141,7 +141,7 @@ INSERT INTO Specifications\
(#:branch . ,branch)
(#:tag . ,(if (string=? tag "NULL") #f tag))
(#:commit . ,(if (string=? rev "NULL") #f rev))
- (#:no-compile? . ,(zero? no-compile?)))
+ (#:no-compile? . ,(not (zero? no-compile?))))
specs))))))
(define (db-add-derivation db job)
Greetings,
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-cuirass-support-tracking-of-a-Guix-package-s-git.patch --]
[-- Type: text/x-patch, Size: 3690 bytes --]
From 2ddac2390c42836cb5073ce67466802e2306e1aa Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 15 Sep 2016 23:15:54 +0200
Subject: [PATCH 2/4] cuirass: support tracking of a Guix package's git.
* src/schema.sql (Specifications): Add no_compile_p column.
* src/cuirass/database.scm (db-add-specification,
db-get-specifications): Handle #:no-compile? property.
* src/cuirass/base.scm (process-specs): Skip compilation if #:no-compile?.
---
src/cuirass/base.scm | 5 +++--
src/cuirass/database.scm | 12 +++++++-----
src/schema.sql | 3 ++-
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 8ad6af4..3d542b1 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -149,8 +149,9 @@ if required."
(let ((commit (fetch-repository spec))
(stamp (db-get-stamp db spec)))
(unless (string=? commit stamp)
- (compile (string-append (%package-cachedir) "/"
- (assq-ref spec #:name)))
+ (unless (assq-ref spec #:no-compile?)
+ (compile (string-append (%package-cachedir) "/"
+ (assq-ref spec #:name))))
(with-store store
(let* ((spec* (acons #:current-commit commit spec))
(jobs (evaluate store db spec*)))
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 2d2dfd2..5d3922b 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -116,11 +116,12 @@ database object."
"Store specification SPEC in database DB and return its ID."
(apply sqlite-exec db "\
INSERT INTO Specifications\
- (repo_name, url, load_path, file, proc, arguments, branch, tag, revision)\
- VALUES ('~A', '~A', '~A', '~A', '~S', '~S', '~A', '~A', '~A');"
+ (repo_name, url, load_path, file, proc, arguments, branch, tag, revision, no_compile_p)\
+ VALUES ('~A', '~A', '~A', '~A', '~S', '~S', '~A', '~A', '~A', ~A);"
(append
(assq-refs spec '(#:name #:url #:load-path #:file #:proc #:arguments))
- (assq-refs spec '(#:branch #:tag #:commit) "NULL")))
+ (assq-refs spec '(#:branch #:tag #:commit) "NULL")
+ (list (if (assq-ref spec #:no-compile?) "1" "0"))))
(last-insert-rowid db))
(define (db-get-specifications db)
@@ -128,7 +129,7 @@ INSERT INTO Specifications\
(specs '()))
(match rows
(() specs)
- ((#(id name url load-path file proc args branch tag rev) . rest)
+ ((#(id name url load-path file proc args branch tag rev no-compile?) . rest)
(loop rest
(cons `((#:id . ,id)
(#:name . ,name)
@@ -139,7 +140,8 @@ INSERT INTO Specifications\
(#:arguments . ,(with-input-from-string args read))
(#:branch . ,branch)
(#:tag . ,(if (string=? tag "NULL") #f tag))
- (#:commit . ,(if (string=? rev "NULL") #f rev)))
+ (#:commit . ,(if (string=? rev "NULL") #f rev))
+ (#:no-compile? . ,(not (zero? no-compile?))))
specs))))))
(define (db-add-derivation db job)
diff --git a/src/schema.sql b/src/schema.sql
index a545da5..f8042d1 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -11,7 +11,8 @@ CREATE TABLE Specifications (
-- The following columns are optional.
branch TEXT,
tag TEXT,
- revision TEXT
+ revision TEXT,
+ no_compile_p INTEGER
);
CREATE TABLE Stamps (
--
2.9.3
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.nl
next prev parent reply other threads:[~2016-09-23 13:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 22:10 using Cuirass to track a guix packages' git Jan Nieuwenhuizen
2016-09-20 19:49 ` Mathieu Lirzin
2016-09-22 22:03 ` Mathieu Lirzin
2016-09-23 13:11 ` Jan Nieuwenhuizen
2016-09-23 13:44 ` Jan Nieuwenhuizen [this message]
2016-09-23 15:25 ` Mathieu Lirzin
2016-09-23 15:39 ` Jan Nieuwenhuizen
2016-09-23 17:59 ` Mathieu Lirzin
2016-09-23 19:05 ` Jan Nieuwenhuizen
2016-09-23 22:36 ` Mathieu Lirzin
2016-09-23 22:43 ` David Craven
2016-09-23 22:59 ` Mathieu Lirzin
2016-09-24 5:42 ` Jan Nieuwenhuizen
2016-09-28 11:59 ` Mathieu Lirzin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wpi2buia.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=guix-devel@gnu.org \
--cc=mthl@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).