From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0Cc2BCwxFGJE2gAAgWs5BA (envelope-from ) for ; Tue, 22 Feb 2022 01:41:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mJvVACwxFGIRJwEAauVa8A (envelope-from ) for ; Tue, 22 Feb 2022 01:41:16 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9CE093106D for ; Tue, 22 Feb 2022 01:41:15 +0100 (CET) Received: from localhost ([::1]:45654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMJEw-0000uX-OV for larch@yhetil.org; Mon, 21 Feb 2022 19:41:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMJDr-0000pD-Sc for bug-guix@gnu.org; Mon, 21 Feb 2022 19:40:10 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMJDm-0001Pr-Ap for bug-guix@gnu.org; Mon, 21 Feb 2022 19:40:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMJDm-0007WK-83 for bug-guix@gnu.org; Mon, 21 Feb 2022 19:40:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#54097: go importer does not honor multi-module repositories Resent-From: raingloom Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 22 Feb 2022 00:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54097 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= Received: via spool by 54097-submit@debbugs.gnu.org id=B54097.164549034228829 (code B ref 54097); Tue, 22 Feb 2022 00:40:02 +0000 Received: (at 54097) by debbugs.gnu.org; 22 Feb 2022 00:39:02 +0000 Received: from localhost ([127.0.0.1]:39499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMJCo-0007Us-2c for submit@debbugs.gnu.org; Mon, 21 Feb 2022 19:39:02 -0500 Received: from mx1.riseup.net ([198.252.153.129]:37404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMJCj-0007UO-J6 for 54097@debbugs.gnu.org; Mon, 21 Feb 2022 19:39:01 -0500 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4K2gJr1N6qzDq8p; Mon, 21 Feb 2022 16:38:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1645490332; bh=CwlMcfh7pYHOx7r7h47uFRtUH6Qhovn0SNnQ/XE4Hgs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cAw+35bSI1Fk6A92893lzzaBJjxaugQBdRYJVq6PXeAeT0Xx1d6/RJx+nawwRw3GG m3GchXoZlAaYHlRgkKnMNaeC8ORbyFStdxo1G6YFPsd/8NdFWanzbxIaKLdvo9vePp cbGW0vyTYRgLKxSfExcw3YF58/kInAQwAHMn7PBE= X-Riseup-User-ID: 12BA86D0D7F89E57702B035A9849F946AEC51B7110EF00DD2B9DB59CB47FD38F Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4K2gJq1fPtz5wC9; Mon, 21 Feb 2022 16:38:50 -0800 (PST) Date: Tue, 22 Feb 2022 01:38:48 +0100 From: raingloom Message-ID: <20220222013848.06d515a1@riseup.net> In-Reply-To: <20220221234354.7698f141@alma-ubu.fritz.box> References: <20220221234354.7698f141@alma-ubu.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 54097@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645490475; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cUZiHgiCgPHMTpmxBnbY360AE7uUWx+MWTTQy6boNCE=; b=QYojRuvq1hpJ+V8QKgfxzGwg9m4Gy6BlWT46CWC3bk6mtnvEZ404Rvm1TePyDlUPpnKXVZ TGwhIPWCbHFUFVoWFkeU51pbpQzjDWeEEiNBzeAN9JIzScIIpdjuH9cVHQ00tVdtG/GnQ2 TPoE5Rw0dKdHCwkmb0VBKXhiY3p5HIMzaupnSADctj+Y+bCWp/AvTfTEhNdPsppJslopgJ 9Vm6aLLggGS3ba8iGggxncRcyjJCCUFEYqvu0n4O2hEWwJrxfWanzLq/IU8arDHarypXkr t+NYteOD+Il0V3bYbRttn5RqUShVLciPWsWERYaHQ1+x3UyEWdkXcw65EisJHg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645490475; a=rsa-sha256; cv=none; b=aFEQ7s6h1WRawIkt2DnXM04DmmUmOCniOZSHHL/BatR4APyFVYhfabENhOpZ2ZaI6yP2LP mL24CFfTsb7UvI1LbTfH3jcl6+aq7RBOfvZgULYGHKxt0tErs2iugXZPKcp9k10JcJ97Wq BEjetIaOUUiyRK/dWaXx1JZxKIzCIJkwxZwfMvh/F42Zy9vV1E8GZihukzPQzPAUpK9ORo xVpNr5ZOo2gQoxBhJMPFGwpnGc25O2rTvKuYQtwjHEcUutXgQ7bilQ0zjUL9wcjoXKZsLr KhsTdU1/YHJeYSFJRf2eQblyeOWOGCB5peayt8ZkNJ9LQlJO/ZRCb1IIBxwvmw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=cAw+35bS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=cAw+35bS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9CE093106D X-Spam-Score: -2.13 X-Migadu-Scanner: scn1.migadu.com X-TUID: iU+9+WRsreEc On Mon, 21 Feb 2022 23:43:54 +0100 Bj=C3=B6rn H=C3=B6fling wrote: > Go usually has the 1 repository=3D1 module convention. However, it > is also allowed that one repository contains multiple go modules. >=20 > If repository "foo" contains only one module, then versions are tagged > "v1.2.3". >=20 > However, if the repository "foo" contains modules "bar" and "baz", > each in a sub-directory of "foo", the versions will be tagged with > their respective prefix, i.e.: >=20 > foo/v1.2.3 > bar/v4.5.6 >=20 > See here: >=20 > https://github.com/golang/go/wiki/Modules#publishing-a-release > https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories > https://stackoverflow.com/questions/64701064/golang-separate-versioning-o= f-multiple-modules >=20 > However, our go-importer does not honor this. The Google Cloud API > modules are structured into sub-modules, but our importer searches the > wrong tag and raises an exception: >=20 > $ ./pre-inst-env guix import go cloud.google.com/go/storage > URL FOR VERSIONS: > https://proxy.golang.org/cloud.google.com/go/storage/@v/list > FETCH_GO_MOD: > https://proxy.golang.org/cloud.google.com/go/storage/@v/v1.21.0.mod > Backtrace: In ice-9/boot-9.scm: 1752:10 17 (with-exception-handler _ > _ #:unwind? _ # _) In unknown file: > 16 (apply-smob/0 #) > In ice-9/boot-9.scm: > 724:2 15 (call-with-prompt _ _ # default-prompt-handle?>) In ice-9/eval.scm: > 619:8 14 (_ #(#(#))) > In guix/ui.scm: > 2209:7 13 (run-guix . _) > 2172:10 12 (run-guix-command _ . _) > In guix/scripts/import.scm: > 124:11 11 (guix-import . _) > In ice-9/boot-9.scm: > 1752:10 10 (with-exception-handler _ _ #:unwind? _ # _) > In guix/scripts/import/go.scm: > 116:29 9 (_) > In ice-9/exceptions.scm: > 406:15 8 (go-module->guix-package* . _) > In ice-9/boot-9.scm: > 1752:10 7 (with-exception-handler _ _ #:unwind? _ # _) > In guix/import/go.scm: > 525:18 6 (go-module->guix-package "cloud.google.com/go/storage" # > ?) In guix/git.scm: > 277:4 5 (update-cached-checkout _ #:ref _ #:recursive? _ # _ # _ > ?) 266:18 4 (resolve _) > In git/reference.scm: > 60:8 3 (_ _ _) > In git/bindings.scm: > 77:2 2 (raise-git-error _) > In ice-9/boot-9.scm: > 1685:16 1 (raise-exception _ #:continuable? _) > 1683:16 0 (raise-exception _ #:continuable? _) >=20 > ice-9/boot-9.scm:1683:16: In procedure raise-exception: > Git error: reference 'refs/tags/v1.21.0' not found >=20 >=20 > The correct git reference to look for is: >=20 > refs/tags/storage/v1.21.0 >=20 > Bj=C3=B6rn >=20 I think this has been mentioned before, but I really think we should use Go's built-in tooling to extract this info, instead of reimplementing it in Guile. There is already some massive ineffeciency introduced by the importer cloning whole repos, whereas `go get` is smart enough to only download `go.mod` files. Just my 2c.