From patchwork Tue May 3 11:16:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Attila Lendvai X-Patchwork-Id: 39094 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F132727BBEA; Tue, 3 May 2022 12:24:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8852A27BBE9 for ; Tue, 3 May 2022 12:24:27 +0100 (BST) Received: from localhost ([::1]:55184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlqdm-00066g-Mj for patchwork@mira.cbaines.net; Tue, 03 May 2022 07:24:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqbV-0004YH-Bx for guix-patches@gnu.org; Tue, 03 May 2022 07:22:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlqbS-00073M-P3 for guix-patches@gnu.org; Tue, 03 May 2022 07:22:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlqbS-0002fI-KM for guix-patches@gnu.org; Tue, 03 May 2022 07:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 May 2022 11:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55242 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55242@debbugs.gnu.org Cc: Attila Lendvai X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165157687110165 (code B ref -1); Tue, 03 May 2022 11:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 May 2022 11:21:11 +0000 Received: from localhost ([127.0.0.1]:38785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlqac-0002dt-QG for submit@debbugs.gnu.org; Tue, 03 May 2022 07:21:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:33454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlqab-0002dm-HT for submit@debbugs.gnu.org; Tue, 03 May 2022 07:21:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqaV-0003zd-Cd for guix-patches@gnu.org; Tue, 03 May 2022 07:21:07 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:44994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlqaR-0006sx-SZ for guix-patches@gnu.org; Tue, 03 May 2022 07:21:01 -0400 Received: by mail-ej1-x630.google.com with SMTP id i19so32741595eja.11 for ; Tue, 03 May 2022 04:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sp9+RU3c27xHgtxDhBA7eeakqVjOntbZGqIPJZaLCmI=; b=UHaeMTduoYbUVG7yrg8/OU2roimEVciBdo1hoYD6C8c3NmJTYzxV5cmbRKgg1eJSdn 0hT3uSz0y6+Oet7Hnev/YDE7ql82PrfuVyhZC56PMos3FANxtrxYxsBywcgv0rlai9hu sdgDjhWj8pjTdazsb9OaJ/S1wiOMAPuYf5Q0G254BhCoGRmtXu3Anuc4tFXR/NRItfV+ bFx35/07G94dIJ6lD9RPIQqoF0hy7WHsIhhptz9zw5jwbxn9NyXPshAP0qwtzOgnDwU6 QNX8W+dhopK33hKatg6Q6mE9h85oIvTHGbHSHVIxp1Dni+HeUq2XFnTlDxGYGuO+VpfK 59hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Sp9+RU3c27xHgtxDhBA7eeakqVjOntbZGqIPJZaLCmI=; b=Wy0mtNXH7V6kNE+r1wsx0mxmZqb03Qcw+4jbDt7zF/EjPgo+mduCQwNi0QDSsT0Y8W MiHNnh6lgHYePEUHbmd82Yd6U7Yn+5kLgbABuOvcOdo8JdAvvJSwiauqm4wtBvEvnUE3 ngxHFvtL6PoeJX8wMJAhHEIqLBYvk81dH1bLzq1cpllS2AA8po28NhCAEHYuw4o/Z0GJ aBmxwnrMO4V7qB4ULN+G36E9fPy2za5pubh8cEp8DTtOiUz9RV5wyQsIOQ9WOxFZXYT2 oCkPpBrfI5cwwlU3UYHGI9QqDoRd7WfOzKt1U1G1SMXC79woxP9/zsC3c9o5T8qtDFvW ELlQ== X-Gm-Message-State: AOAM532hZ/drqFtzOccEGsYQAiIXTz5faT4aUWnU+ZpPU6AmM+H8y0Nm roUyw0gyd1dI2j44cXC7kxHAlfrN5JA= X-Google-Smtp-Source: ABdhPJyVrOqKyJCCJVZuUJn+EwPXW0Wg/sOdlRYSNeq0d3RzObnV3mMm8V2zyOvS4/D9r4G4wItwyA== X-Received: by 2002:a17:906:5d0c:b0:6f3:dce6:a69a with SMTP id g12-20020a1709065d0c00b006f3dce6a69amr15717670ejt.23.1651576855321; Tue, 03 May 2022 04:20:55 -0700 (PDT) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id y5-20020a056402170500b0042617ba63d3sm7798469edu.93.2022.05.03.04.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 04:20:54 -0700 (PDT) From: Attila Lendvai Date: Tue, 3 May 2022 13:16:12 +0200 Message-Id: <20220503111620.3139-1-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=attila.lendvai@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- this will be a series of patches that were needed to be able to (mostly) successfully run these two imports (go-ethereum and ethersphere/bee): RUN=12 clear && ./pre-inst-env guix import go -r --pin-versions github.com/ethersphere/bee@v1.5.1 > >(tee -a ~/workspace/guix/importing/bee-run-${RUN}.scm) 2> >(tee -a ~/workspace/guix/importing/bee-run-${RUN}.log >&2) RUN=36 clear && ./pre-inst-env guix import go -r --pin-versions github.com/ethereum/go-ethereum@v1.10.17 > >(tee -a ~/workspace/guix/importing/go-ethereum-run-${RUN}.scm) 2> >(tee -a ~/workspace/guix/importing/go-ethereum-run-${RUN}.log >&2) note that i only have a mediocre knowledge of the golang infrastructure, so this should be reviewed by someone who more deeply understands the golang build process, and its implementation within guix. i think most of it is not very controversial, maybe except the last commit. i'm willing to reshape this under the guidance of someone who has a better bird's eye view perspective on this all. guix/scripts/import.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 40fa6759ae..891f558b97 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -127,10 +127,14 @@ (define-command (guix-import . args) ('define-public _ ...))) (print expr)) ((? list? expressions) - (for-each (lambda (expr) - (print expr) - (newline)) - expressions)) + (let ((count 0)) + (for-each (lambda (expr) + (print expr) + (set! count (1+ count)) + (newline)) + expressions) + (format (current-warning-port) + (G_ "Imported ~a packages~%") count))) (x (leave (G_ "'~a' import failed~%") importer)))) (let ((hint (string-closest importer importers #:threshold 3))) From patchwork Tue May 3 11:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Attila Lendvai X-Patchwork-Id: 39095 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8EC9D27BBEA; Tue, 3 May 2022 12:44:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 48B6C27BBE9 for ; Tue, 3 May 2022 12:44:33 +0100 (BST) Received: from localhost ([::1]:45608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlqxE-0003eA-ER for patchwork@mira.cbaines.net; Tue, 03 May 2022 07:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqwk-0003dC-Ng for guix-patches@gnu.org; Tue, 03 May 2022 07:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlqwk-0002RD-DO for guix-patches@gnu.org; Tue, 03 May 2022 07:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlqwk-0005Pq-Bg for guix-patches@gnu.org; Tue, 03 May 2022 07:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55242] [PATCH 02/10] guix: import: go: Rename go.pkg.dev-info to pkg.go.dev-info. References: <20220503111620.3139-1-attila@lendvai.name> In-Reply-To: <20220503111620.3139-1-attila@lendvai.name> Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 May 2022 11:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55242 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55242@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 55242-submit@debbugs.gnu.org id=B55242.165157821020687 (code B ref 55242); Tue, 03 May 2022 11:44:02 +0000 Received: (at 55242) by debbugs.gnu.org; 3 May 2022 11:43:30 +0000 Received: from localhost ([127.0.0.1]:38815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlqwE-0005NZ-Ch for submit@debbugs.gnu.org; Tue, 03 May 2022 07:43:30 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:42843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlqwB-0005N3-Lc for 55242@debbugs.gnu.org; Tue, 03 May 2022 07:43:28 -0400 Received: by mail-ed1-f48.google.com with SMTP id z19so19494210edx.9 for <55242@debbugs.gnu.org>; Tue, 03 May 2022 04:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0EaRwqltx74K+c88sp3dmDjNsW9WweZYaKkVLmJrrW4=; b=orYLiFZdh+iZfTVRl84FOWB5McxY83Y5/H/LdojRJPpM3HE/NikzefKISFVzYEkICP /YpUNxgxh8bWJV/SRJrsVOjvXLYCZYktCbaZwzRHk1ct0pBqZgdCGpzH+rpi4cSsJnHw /43yW94MtR+dOXfQn6r8Dt0s2AuBXAcZ5N+m7HFy9zmiC5iN76mQ15Qly6zSZSyP34P6 p7uR02nWz3WZdDfoKCT5ItDO6mFx6h10+swqHs0DnrN7d4k6epRwnUY0T4ynF776MEzW 69V8KlO2QOucSZGaPS5XdMg+AKkiFlI+dnVWaIm2tclAo56pD2pO7+byICpZO2d2lVZO x1NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=0EaRwqltx74K+c88sp3dmDjNsW9WweZYaKkVLmJrrW4=; b=IP6bxWBo9g4IFRF7v0gHQi5xbi3l65VMGfz0VPVnhcVkDSYpF7C7cXQ2XHwHj/Zm7R C0B/GuBpeKu6E8Qb6CX1zwz6AkrSS8xXhdf2hNbrEbBOvYA5i+F5kvsKsNFsgc2Q8uae Q0juYhKmQfO59oVLnhBg8iLNF7AxegFNgatcFDMEgJGJf7pSOevHmnmhIm9Me+iif/E3 kE/lE7JV1W6L8+ojUkIuvKFuSVPbSDQY9aVxLLdBtCm3nUdRytG91ImFppbexjWHA8n8 v/H+jcLpgAMz0nJo1y13jX3GySJl5iTtfNK4TR1Kjx08Y1+PxlEEUVT3UIpxmagRGAd2 XvZA== X-Gm-Message-State: AOAM5301/Hm4E5oo6f13WuXsAHQqbM+Ti17bqyfaKiYPYFG+oSp56qON 5JQHbVLO1TmBXeOhmKO3ts1RbGd07A0= X-Google-Smtp-Source: ABdhPJyF019NFblk2hic2vsFhwlOHyhy4Qq7jZyCjz96xo4tvymMgRihoaC6DWNAF37YeKVZC6TJDQ== X-Received: by 2002:aa7:d549:0:b0:425:fc06:60d4 with SMTP id u9-20020aa7d549000000b00425fc0660d4mr17902490edr.300.1651578201541; Tue, 03 May 2022 04:43:21 -0700 (PDT) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id k13-20020a05640212cd00b0042617ba63d6sm7766964edx.96.2022.05.03.04.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 04:43:21 -0700 (PDT) From: Attila Lendvai Date: Tue, 3 May 2022 13:42:53 +0200 Message-Id: <20220503114301.9524-2-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches To properly mimic the name of the website. Also employ it at one more place. --- guix/import/go.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/guix/import/go.scm b/guix/import/go.scm index d00c13475a..bb4bb7bb7b 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -120,8 +120,11 @@ (define (escape occurrence) ;; Prevent inlining of this procedure, which is accessed by unit tests. (set! go-path-escape go-path-escape) -(define (go.pkg.dev-info name) - (http-fetch* (string-append "https://pkg.go.dev/" name))) +(define (pkg.go.dev-info module-path) + ;; FIXME if MODULE-PATH is a fork on github, then it will try to get the + ;; info of the fork (instead of the upstream), which most probably does not + ;; exist in pkg.go.dev. Example: https://github.com/bonitoo-io/oapi-codegen + (http-fetch* (string-append "https://pkg.go.dev/" module-path))) (define* (go-module-version-string goproxy name #:key version) "Fetch the version string of the latest version for NAME from the given @@ -147,7 +150,7 @@ (define* (go-module-available-versions goproxy name) (define (go-package-licenses name) "Retrieve the list of licenses that apply to NAME, a Go package or module name (e.g. \"github.com/golang/protobuf/proto\")." - (let* ((body (go.pkg.dev-info (string-append name "?tab=licenses"))) + (let* ((body (pkg.go.dev-info (string-append name "?tab=licenses"))) ;; Extract the text contained in a h2 child node of any ;; element marked with a "License" class attribute. (select (sxpath `(// (* (@ (equal? (class "License")))) @@ -169,7 +172,7 @@ (define (sxml->texi sxml-node) (define (go-package-description name) "Retrieve a short description for NAME, a Go package name, e.g. \"google.golang.org/protobuf/proto\"." - (let* ((body (go.pkg.dev-info name)) + (let* ((body (pkg.go.dev-info name)) (sxml (html->sxml body #:strict? #t)) (overview ((sxpath `(// @@ -206,8 +209,7 @@ (define (go-package-synopsis module-name) the https://pkg.go.dev/ web site." ;; Note: Only the *module* (rather than package) page has the README title ;; used as a synopsis on the https://pkg.go.dev web site. - (let* ((url (string-append "https://pkg.go.dev/" module-name)) - (body (http-fetch* url)) + (let* ((body (pkg.go.dev-info module-name)) ;; Extract the text contained in a h2 child node of any ;; element marked with a "License" class attribute. (select-title (sxpath