From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Go importer - help with git-fetch Date: Tue, 06 Aug 2019 14:56:14 +0200 Message-ID: <87zhkmxxjl.fsf@elephly.net> References: <4c2f5f76-b431-57ce-3697-ac2cbb48f395@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51826) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huz0s-0004do-VE for guix-devel@gnu.org; Tue, 06 Aug 2019 08:56:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huz0r-0007qf-SI for guix-devel@gnu.org; Tue, 06 Aug 2019 08:56:26 -0400 Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1huz0r-0007pP-FI for guix-devel@gnu.org; Tue, 06 Aug 2019 08:56:25 -0400 In-reply-to: <4c2f5f76-b431-57ce-3697-ac2cbb48f395@riseup.net> 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: swedebugia Cc: guix-devel@gnu.org swedebugia writes: > I got this far by using (guix build git): > > (display (let* ((name "github.com/gogo/protobuf") > (url (go-name->url name)) > (commit "28a6bbf47e48e0b2220b2a244750b660c83d4942")) > (with-store store > (run-with-store store > (let ((path "test")) > (git-fetch url commit path)))))) > > But I'm pretty new to this derivation 2nd order code stuff and I don't=20 > understand the errors. > > It gives me: > > Initialized empty Git repository in /home/egil/src/guix/test2/.git/ > remote: Enumerating objects: 924, done. > remote: Counting objects: 100% (924/924), done. > remote: Compressing objects: 100% (745/745), done. > remote: Total 924 (delta 476), reused 330 (delta 132), pack-reused 0 > Receiving objects: 100% (924/924), 1.45 MiB | 944.00 KiB/s, done. > Resolving deltas: 100% (476/476), done. > From https://github.com/gogo/protobuf > * branch 28a6bbf47e48e0b2220b2a244750b660c83d4942 -> FETCH_H= EAD > Note: checking out 'FETCH_HEAD'. > > You are in 'detached HEAD' state. You can look around, make experimental > changes and commit them, and you can discard any commits you make in this > state without impacting any branches by performing another checkout. > > If you want to create a new branch to retain commits you create, you may > do so (now or later) by using -b with the checkout command again. Example: > > git checkout -b > > HEAD is now at 28a6bbf [merge] Fix merge of non-nullable slices (#569) > 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 guix/import/go.scm: > 262:11 3 (_) > In guix/store.scm: > 623:10 2 (call-with-store #) > 1803:24 1 (run-with-store # _ # _ = =E2=80=A6) > In unknown file: > 0 (_ #) > > ERROR: Wrong type to apply: #t > > What does this error mean? The error means that you tried to use #T as a procedure. =E2=80=9Crun-with-store=E2=80=9D expects a monadic value. =E2=80=9Cgit-fet= ch=E2=80=9D returns #T, though, not a monadic value. Note that we already have all the stuff that=E2=80=99s needed for hash computation of git checkouts. Look for =E2=80=9Cguix hash -rx=E2=80=9D. --=20 Ricardo