Re: Fwd: Running individual system tests

2019-10-23 Thread Daniel Schäfer

So you're saying, I have to run

```
./bootstrap
./configure
make
./pre-inst-env guix build my-new-package
```

which builds the daemon, and compiles all Guile modules?
And I have to do it, whenever I want to run any system test, or build an 
in-tree package (which I'm going to submit for inclusion)?
Or more precisely: It has to be run, once, before I do those things. 
Question: Doesn't it ever have to be rerun? How are new modules compiled?


It takes 33 minutes on my laptop and is only going to take longer, when 
Guix gets bigger.
Is there maybe an interpreted mode? Or could this be better with Guile 
3.0 JIT?


- Daniel

On 10/21/19 8:43 AM, Daniel Schäfer wrote:

Hi Ricardo,

For a test of an external system, like something I develop at work, I 
don't want/need to have Guix with all modules compiled present.

I don't want unnecessary steps if they are not necessary.

Please refer to my first mail with an example of running a test 
standalone.
I'd like some assistance to make my snippet nicer and not return an 
error after successfully running the test.


Thanks,
Daniel

On 10/19/19 7:35 PM, Ricardo Wurmus wrote:

Hi Daniel,

I don’t understand why you would want to run a system test without
building Guix first.

Could you elaborate?





Re: Fwd: Running individual system tests

2019-10-21 Thread Daniel Schäfer

Hi Ricardo,

For a test of an external system, like something I develop at work, I 
don't want/need to have Guix with all modules compiled present.

I don't want unnecessary steps if they are not necessary.

Please refer to my first mail with an example of running a test standalone.
I'd like some assistance to make my snippet nicer and not return an 
error after successfully running the test.


Thanks,
Daniel

On 10/19/19 7:35 PM, Ricardo Wurmus wrote:

Hi Daniel,

I don’t understand why you would want to run a system test without
building Guix first.

Could you elaborate?





Fwd: Running individual system tests

2019-10-19 Thread Daniel Schäfer

Hi Guix developers,

I'm still trying to figure out, how to run a single Guix system test 
without building the entirety of Guix.
Does anybody do this? Has anybody written a Guix system test for 
something not in Guix? Maybe a personal or work-related project.


CC'ing some people who've added guix system tests.

Thanks,
Daniel

 Forwarded Message 
Subject:Running individual system tests
Date:   Tue, 15 Oct 2019 13:21:45 +0200
From:   Daniel Schäfer 
To: help-g...@gnu.org



Hi Guix,

Guix System has nice system tests, as described in [1] but they don't 
easily allow to run a single test.


The manual says to run `make check-system TESTS="basic mcron"` in the 
guix source tree.
That, however, (apparently) requires to be bootstrapped, configured and 
all Scheme files to be fully built.


Is there something as simple as:

$ guix build -f gnu/tests/rsync.scm
guix build: error: #: not something we can build

---

I hacked together a solution that works but is far from nice.
It is based off of build-aux/run-system-tests.scm and I tried to strip 
it down to the core.


$ cat run-test.scm
(use-modules (gnu tests rsync)
 (gnu tests)
 (guix store)
 (guix status)
 (guix monads)
 (guix derivations)
 (guix ui)
 (srfi srfi-1)
 (srfi srfi-34))

(define (built-derivations* drv)
  (lambda (store)
    (guard (c ((store-protocol-error? c)
   (values #f store)))
  (values (build-derivations store drv) store

(system-test-value %test-rsync)
  (with-store store
    (with-status-verbosity 2
  (run-with-store store
    (mlet* %store-monad ((drv (mapm %store-monad system-test-value 
(list %test-rsync)))

 (out -> (map derivation->output-path drv)))
  (mbegin %store-monad
    (show-what-to-build* drv)
    (set-build-options* #:keep-going? #t #:keep-failed? #t
    #:print-build-trace #t
    #:print-extended-build-trace? #t
    #:fallback? #t)
    (built-derivations* drv)
    (display out))

$ guile -s run-test.scm
(/gnu/store/scifaigbvcj20lplj3mvqj3ndr9w0nlv-rsync-test)Backtrace:
   8 (apply-smob/1 #)
In ice-9/boot-9.scm:
    705:2  7 (call-with-prompt _ _ #)
In ice-9/eval.scm:
    619:8  6 (_ #(#(#)))
In ice-9/boot-9.scm:
   2312:4  5 (save-module-excursion _)
  3831:12  4 (_)
In /home/zoid/guix/gnu/tests/run-test.scm:
 19:4  3 (_)
In guix/status.scm:
    810:4  2 (call-with-status-report _ _)
In guix/store.scm:
  1737:24  1 (run-with-store _ _ #:guile-for-build _ #:system _ # _)
In unknown file:
   0 (_ #)

ERROR: Wrong type to apply: #


It shows the derivation output path before the backtrace and thus I can 
inspect the log.

Can I do this in a nicer way?
It would be very helpful for out-of-tree system tests.

Thanks

- Daniel

[1] https://guix.gnu.org/blog/2016/guixsd-system-tests/




Compatibility between Nix and Guix

2019-09-25 Thread Daniel Schäfer

Hi all,

I've been using NixOS for a few years and now I want to try out Guix.
The goal is to see whether there is a benefit to using both and what we can 
learn from each other.

Last year Ludo wrote:

> Is compatibility with the nix-daemon a goal of the Guix project?

I’ve come to the conclusion that it’s not a worthy goal, as in, it would
cost more than it’s worth.  guix-daemon is already incompatible with
nix-daemon on a few things, such as the “builtin:download” derivation
builder.


But the Guix manual at 2.2 [1] says:

When a working installation of the Nix package manager is available, you can
instead configure Guix with --disable-daemon. In that case, Nix replaces the
three dependencies above.

Guix is compatible with Nix, so it is possible to share the same store between
both. To do so, you must pass configure not only the same --with-store-dir
value, but also the same --localstatedir value. The latter is essential because
it specifies where the database that stores metadata about the store is
located, among other things. The default values for Nix are
--with-store-dir=/nix/store and --localstatedir=/nix/var. Note that
--disable-daemon is not required if your goal is to share the store with Nix. 


How much of that is still true? The daemon is not compatible anymore and
I don't think it is a good idea to have two different daemons share the same 
store.

Is there still the a possibility to use either Nix on GuixSD or Guix on NixOS
without duplicating the store or running two daemons?
Or e.g. use Nix with Guile?

Cheers,
Daniel

[1] https://guix.gnu.org/manual/en/guix.html#Requirements