From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wI5MLdHNjWT9VAAASxT56A (envelope-from ) for ; Sat, 17 Jun 2023 17:14:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0JZmLdHNjWQEdQAA9RJhRA (envelope-from ) for ; Sat, 17 Jun 2023 17:14:25 +0200 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 4FD8C31BD3 for ; Sat, 17 Jun 2023 17:14:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAXcq-0002np-Pn; Sat, 17 Jun 2023 11:14:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAXcp-0002mE-CI for bug-guix@gnu.org; Sat, 17 Jun 2023 11:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAXcp-0006kW-3n for bug-guix@gnu.org; Sat, 17 Jun 2023 11:14:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAXco-0000Fr-SW for bug-guix@gnu.org; Sat, 17 Jun 2023 11:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63001: bug#63631: [PATCH] import: go: Handle subpackage versioning correctly. Resent-From: "Timo Wilken" Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 17 Jun 2023 15:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63001 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 63631@debbugs.gnu.org, 64036@debbugs.gnu.org, Simon Tournier , 63647@debbugs.gnu.org, 64035@debbugs.gnu.org, 63001@debbugs.gnu.org, 54097@debbugs.gnu.org, wolf@wolfsden.cz Received: via spool by 63001-submit@debbugs.gnu.org id=B63001.1687014840956 (code B ref 63001); Sat, 17 Jun 2023 15:14:02 +0000 Received: (at 63001) by debbugs.gnu.org; 17 Jun 2023 15:14:00 +0000 Received: from localhost ([127.0.0.1]:52287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAXcl-0000FH-Cr for submit@debbugs.gnu.org; Sat, 17 Jun 2023 11:13:59 -0400 Received: from mx2.mythic-beasts.com ([46.235.227.24]:35093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAXcc-0000EB-Cs; Sat, 17 Jun 2023 11:13:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=twilken.net ; s=mythic-beasts-k1; h=To:From:Subject:Date; bh=pLlAjfqsoe+3U3a73MQeHAaM/uSI+UrqGsrVeSKy1QM=; b=zI4HPa8dV46Hjnio0YDducSSwZ M29u2+iSJgjnWkngcWfT9SjYDe9ZLcVAF6i1Ndo75UO/OHkpFsGhXUIm1L8Fz/B5Y6Tg3zjvoVFmy d2/oqU7XiJvDOnOICpI3cx5UJO/54X/q5T9ko6ub0/iW9+KHQrST+7gIUbsLEFePPVSChBnKxzIj0 6vl4AibdV6yP/bGdLIvjcfMXs4yCOg/+eCxfY8y0t1VVKYU/YVdRUrSzYPgPYv7nhW0qOEJZKfPL7 6rRHFmKh51WiRPEO/oUchLlUi9MFuV/F8pPh+ZAd9D/fTIovUzVWesUglqbjMlC1UubueYwa/EPQC NdDeVMug==; Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qAXcS-004VRH-W7; Sat, 17 Jun 2023 16:13:41 +0100 Content-Type: multipart/signed; boundary=dc3bfcd0ce40fc9a1a65ded3476be064f73442d113438739c89741eeba4a; micalg=pgp-sha256; protocol="application/pgp-signature" Date: Sat, 17 Jun 2023 17:12:58 +0200 From: "Timo Wilken" Message-Id: X-Mailer: aerc 0.14.0 References: <6dd1de3dd4d968876fa55f5126056834c77b0244.1684703258.git.guix@twilken.net> <87pm5xrbsg.fsf@gnu.org> In-Reply-To: <87pm5xrbsg.fsf@gnu.org> X-BlackCat-Spam-Score: 16 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: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687014865; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type: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=pLlAjfqsoe+3U3a73MQeHAaM/uSI+UrqGsrVeSKy1QM=; b=lQGW/+kNharBXKO1DEYM3LKsGLqkCuKT5uCSEgAf2svA+RPYzxV9ZnQnghJ9OZNkoNDjZW 8T48Cgw89sPt4n3BF6fUtSx/8eeOgoGe/1AekADelm6o7lrg4Jx+Q+3R20CbjWTklYqmKM Mmak7onesI8CnkrjMJfmSGUtmCsga04bUQBmrYj8ACAqM7uG2q88BVMYkYXGeTPINYbvj9 bobNfi+ptdzH6E5OhEsr3Qo5QkZAQOT55XM0g2vDQNMI3Fajll/ZoPl/aQ6XthAAFL9jBa +uDQBQUHf86/6G4WXwbeCsCeAq07NR5/cxgaDPPb+RPqCHnA6PoNgg9RIGMfYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=twilken.net header.s=mythic-beasts-k1 header.b=zI4HPa8d; dmarc=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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687014865; a=rsa-sha256; cv=none; b=uhraRLoq1qNga9tZi8uMeX0KQskBKgtEwVqhY5ZachxxgjsTAySzBfdR5NL9jPAiUVFm8/ e2ndJDMcW2sbESeQ3/LaOBBCTKoHQcgUshEX2O3hdDNDqlGdBZGf9/z/H9NODNMUnTEjyH pdRhhik7mEmdQb1DlyhL0MP7gsXwoQnoxwYcbUQ4iUHxMgLxQqnLQ6ShBPJfXi2+T/nXig rwrMNr1KWUhLqXhVUkRH7iJtAUmgT8Uwo/AvkFLgPNxbJwV2MyvHkw6h0SEsmTXTKrhbVo Nd5lQ5cNZXGPdxke5PVSquIz7BGCwF0pELz/2HZKsxnxrPhZViHtQiLEkqWkhQ== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 0.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=twilken.net header.s=mythic-beasts-k1 header.b=zI4HPa8d; dmarc=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: 4FD8C31BD3 X-Spam-Score: 0.67 X-TUID: HAeCwAeTmBa+ --dc3bfcd0ce40fc9a1a65ded3476be064f73442d113438739c89741eeba4a Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Hi Ludo', (hi everyone,) On Wed Jun 14, 2023 at 11:09 PM CEST, Ludovic Court=C3=A8s wrote: > Timo Wilken skribis: > > Here's a patch that fixes the reported issue (bug#54097) for me. I've o= nly > > tested this on the github.com/googleapis/google-cloud-go/compute packag= e so > > far, though it seems to work there. Perhaps others have more testcases? > > > > I don't know enough about Go tooling to use it, so I've just patched th= e Guile > > logic of the importer. (I don't write Go, I just want to package stuff = written > > in it.) In terms of performance, at least the repo contents are apparen= tly > > cached by the first `git-checkout-hash' call, even if it fails, so the = second > > call doesn't have to redownload them. I've been testing my patch further this weekend, and I have a couple more patches in the pipeline; I suppose I ought to clean those up and submit the= m. In particular, I've got fixes for the following queued up locally: 1. Finding the `module-path-subdir' needs another case for e.g. cloud.google.com/go/*. 2. My patch sometimes generates an unnecessary `go-version->git-ref' call. 3. Go versions need to be parsed from go.mod, since some packages require a newer Go compiler than our default. This I've got a patch for, but this = Go version also ought to propagate up the dependency tree. I haven't found = an easy way to do that, since the importer seems to generate top-level packages first, before descending the dep tree... 4. `fetch-module-meta-data' ought to ignore 4xx HTTP errors to follow the spec; gonum.org/v1/gonum specifically depends on this behaviour. I've been trying to recursively import github.com/matrix-org/dendrite, whic= h has a particularly large and hairy dependency tree. While I can now import = it without crashes, I can't build it from the imported package definitions yet= -- mainly because of lots of dependency cycles in the generated packages, but there may be more issues hidden beneath that. Still, I can recommend it as a test of everyone's importer patches, since it'll find a lot of edge cases in importing alone! > What you propose looks similar to part of the work Simon Tournier > submitted at . It seems lots of people have been working on the same problem -- in additio= n to Simon's patches, I found a patch submitted by Elbek (issues 64035 & 6403= 6; Cc'd). I also forgot about the issue I submitted months ago (63001)... > What would you suggest? Simon? Here's a brief comparison between Simon's patches and mine -- Simon's seem = to contain fixes for a couple more things than mine currently does: 1. Simon sorts available versions in an error message; this can presumably = be merged independently since it doesn't conflict with other patches. 2. Simon always prepends a "SUBDIR/" prefix to the tag if found, whereas I = try to find the plain "vX" tag first, then fall back to "SUBDIR/vX". Judging= by https://go.dev/ref/mod#vcs-version, Simon's approach seems more correct. I'll change my implementation to match and try it out. 3. For detecting the `module-path-subdirectory' in Simon's patches: that's = the same approach I used initially, but I found I have to try `(substring module-path (string-length import-prefix))' first (to handle e.g. cloud.google.com/go/*). This is one of the things I haven't submitted yet... > Thanks for the patch, Timo! Thanks for your work in sorting through all of this, Ludo'! Cheers, Timo --dc3bfcd0ce40fc9a1a65ded3476be064f73442d113438739c89741eeba4a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEU+w8BoVog92SNVvCL8eFBGgfabAFAmSNzaUACgkQL8eFBGgf abDEaA//Y6k/Uckhvq+wllES0TjACxVG+2bY2E/wLZNoQShXF5Tn3ZQ9o2HOU7Gr p8er/t/JkPLYm9w2MidUtvTms6qxp8H/YIZ12gzZ+GP/eoKa/iiqt42+KZvLS/Is B2JWEcaJLFYy0w9nuubeuQpgcWEmxyk7/zb++GovD0tfYgczII3N1Z5fhRmeAj0N FbKqfkBocxruYvBfcI5KhMV6Q1TjCwuAH+j2iwNmsiSnm7NTKbJxfCyO9+p5UF9w O/em01p9J+Cg6EEFunwoi1pjoEAkVZCRtgaiP1SMgapq74UKKagvsWqMoW+JHpDf uuiaVn1sLuTt+u9KGamYqaCj1NRcCfN7SjPxS7oTM4hsytVDmUB/eIHD6t3HntCP Ev43fJKJwLoybQV0ptajnJggEEaEY1cegQG683jsD0ycrToh4YEhLe5fQsGhaLMA 7MSLjjf0K73BoFyZi+wYyfDPYqXRQmpb3Z6cKJPlF3v4IF13UtSxP0yBRdz930aI 1b1Q5khLQzQBI0fvxMNcZGPeA2RjPyNsXE8pKn9zEkIunzX9VYN8az++EjX928Ox mmgjEUsLWMPCSMwGcEoZye6R5wJUG34LEkoQTbySf+314hlELPuGcLCatFgZZbXq 1Hn1upt13XYRYVCX/SXIpBJL9gdNbi2sSg8FVm4Aq+sQQqZzAKs= =fjJn -----END PGP SIGNATURE----- --dc3bfcd0ce40fc9a1a65ded3476be064f73442d113438739c89741eeba4a--