From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: pre-release [PATCH] git-service Date: Wed, 13 Jul 2016 10:23:51 +0000 Message-ID: <87lh1596q0.fsf@we.make.ritual.n0.is> References: <87zipsgm8g.fsf@we.make.ritual.n0.is> <87r3b33ls5.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNHKh-0004rc-8Q for guix-devel@gnu.org; Wed, 13 Jul 2016 06:24:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNHKf-0000Qc-SN for guix-devel@gnu.org; Wed, 13 Jul 2016 06:23:59 -0400 Received: from mithlond.libertad.in-berlin.de ([2001:67c:1400:2490::1]:51603 helo=beleriand.n0.is) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNHKf-0000Q8-FH for guix-devel@gnu.org; Wed, 13 Jul 2016 06:23:57 -0400 Received: by beleriand.n0.is (OpenSMTPD) with ESMTPSA id fd21530e TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO for ; Wed, 13 Jul 2016 10:23:55 +0000 (UTC) In-Reply-To: <87r3b33ls5.fsf@elephly.net> (Ricardo Wurmus's message of "Fri, 08 Jul 2016 22:41:30 +0200") 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 Hi, thanks to you both for your help! Ricardo Wurmus writes: > Thompson, David writes: > >> On Fri, Jul 8, 2016 at 11:53 AM, ng0 wrote: >>> I need some feedback on the git-service. >>> The inserted patch gives me this output: >>> >>> >>> +(define-record-type* >>> + git-configuration make-git-configuration >>> + git-configuration? >>> + (git git-configuration-git ; >>> + (default git)) >>> + (base-path git-configuration-base-path) ; string >>> + (port git-configuration-port)) ; string >> >> So, this is a record type... >> >>> + >>> +(define git-shepherd-service >>> + (match-lambda >>> + (($ git base-path port) >>> + (let ((conf (string-append >>> + "--base-path="base-path >>> + "--port="(number->string port)))) >>> + (list (shepherd-service >>> + (provision '(git)) >>> + (requirement '(networking loopback syslogd)) >>> + (documentation "Run the git-daemon server for git repositories") >>> + (start #~(make-forkexec-constructor >>> + (list (string-append #$git "/bin/git") >>> + "daemon" "--syslog" "--informative-errors" >>> + #$conf))) >> >> ...and you (ungexp conf), where conf is an instance of that record >> type, into what is supposed to be a list of strings that form command >> line arguments for git. See the issue? With the additional input Ricardo gave it's clearer now. > > I might be misreading this, but “conf” here is literally the string > > “--base-path=something--port=1234” > > when “base-path” is the string “something” and “port” is the number > “1234”. > > The let binding for “conf” is incorrect. > > First, you say earlier that “port” is a string: > >> + (port git-configuration-port)) ; string > > but then you pass it to “number->string”, so it’s actually expected to > be a number. > > Second, the argument to “make-forkexec-constructor” is supposed to be a > list of strings, each representing one argument. So defining “conf” as > a concatenation is not okay. You don’t need a let-binding for “conf” at > all. Just use “base-path” and “port” directly. (I haven’t tested > this.) > > (list (string-append #$git "/bin/git") > "daemon" "--syslog" "--informative-errors" > (string-append "--base-path=" $#base-path) > (string-append "--port=" $#port)) > > But the error you get stems from passing a value of > “” to something that expects a package. I don’t see > where this happens. Since I cannot see “~/testvm.scm” I cannot tell you > anything more. > > ~~ Ricardo > I based this on information sourced from other services, and some parts (the service field and the shepherd-service) are just testing out what is expected and what's not. I feel like your information and what I need to read up on helps alot. thanks. -- ♥Ⓐ ng0 For non-prism friendly talk find me on http://www.psyced.org SecuShare – http://secushare.org