From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: how to create and test a new service definition Date: Sun, 14 May 2017 09:04:11 +0000 Message-ID: References: <87vap4zupo.fsf@gnu.org> <878tm0zflx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9pRw-0005Rb-E9 for guix-devel@gnu.org; Sun, 14 May 2017 05:04:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9pRt-0008KP-8j for guix-devel@gnu.org; Sun, 14 May 2017 05:04:24 -0400 Received: from [195.159.176.226] (port=50989 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9pRt-0008KI-28 for guix-devel@gnu.org; Sun, 14 May 2017 05:04:21 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d9pRl-0008V4-5q for guix-devel@gnu.org; Sun, 14 May 2017 11:04:13 +0200 In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org On Sun, 14 May 2017, Catonano wrote: > 2017-05-13 22:06 GMT+02:00 Ludovic Court=C3=A8s : > >> Vincent Legoll skribis: >> >>>> The best way to test your code is to write an =E2=80=98operating-syste= m=E2=80=99 >>>> declaration that uses the new service and to instantiate it in a VM wi= th >>>> =E2=80=98guix system vm=E2=80=99. >>> >>> Should that be working properly (out-of-the-box) when you're already in >>> a qemu VM (recursive virtualization) ? >>> >>> I ask because I'm getting: >>> >>> [...] >>> ERROR: qemu failed "qemu-system-x86_64" >> >> What were the lines above this one? This tool tries to use KVM if it >> seems available. Maybe in your case it =E2=80=9Cseems=E2=80=9D to be av= ailable (as in >> /dev/kvm exists) but is actually unusable? >> >>>> Once you=E2=80=99ve done that, you can also write an automated test fo= r the new >>>> service; see . >>> >>> I'm far from there, I have a *really* hard time getting back to guixsd. >> For >>> instance it took me very long time to find back the GUIX_PACKAGE_PATH >>> env var. This looks under-documented, or I don't understand how one is = to >>> work on custom or new packages, etc... >> >> =E2=80=98GUIX_PACKAGE_PATH=E2=80=99 is documented at >> > Modules.html#index-GUIX_005fPACKAGE_005fPATH>. >> >> The workflow for defining packages is described at >> >> , >> and that for contributing them is at >> > Submitting-Patches.html>. >> >> There=E2=80=99s probably room for improvement though. What changes/addi= tions >> would you suggest? >> > > Let me chime in here: I'd suggest to state the workflow or defining > services, as the one or deining packages is stated > > But I'm not thinking about how to define and use The scheme structures. T= he > examples are enough for that. > > I'm thinking about things like how to deal with qemu, if you want to test > your services in a vm > > Is there any other way to get your feet wet with services ? > > George suggested me the trick to link a checked out master branch to > .local/guix/profile (or maybe it's the other way around: it's liinking > .local/guix/profile to a checked out master branch) > > Is anyone using this to work on services ? How, exactly ? > > Thanks > My current way of testing services is usually on bare-metal. I had bad experiences with one network based service (gnunet) and it being terrible to debug, so I took the QEMU out of there. I test things this way which will not break my current generation=20 like darkhttpd or the gopherd I submitted as a question. Other, potential boot breaking, stuff I test on other systems. This is also because I never really figured out the best way to run network based services in qemu in Guix. I have no issues with qemu, but on Guix many months back it behaved unlike the qemu I knew from Gentoo. There is lots of room for services in the documentation. There should be a "contributing services" section in chapter 8, currently I learn this the way I learned to do packages, by repetition and failure until I see how to debug stuff.. which is already=20 helping since I am starting to see patterns for debugging with darkhttpd=20 (it helped that it simply worked and then randomly broke in further=20 attempts).