From patchwork Mon Sep 6 10:57:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 32664 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 8830327BBE3; Mon, 6 Sep 2021 11:58:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0788927BBE1 for ; Mon, 6 Sep 2021 11:58:12 +0100 (BST) Received: from localhost ([::1]:32948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNCKJ-0000xp-5X for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 06:58:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNCKA-0000wm-Tq for guix-patches@gnu.org; Mon, 06 Sep 2021 06:58:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNCKA-00018F-MY for guix-patches@gnu.org; Mon, 06 Sep 2021 06:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNCKA-0005SA-MA for guix-patches@gnu.org; Mon, 06 Sep 2021 06:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50426] [PATCH] import: elpa: Don't hardcode default branch to 'master'. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 10:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50426 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50426@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163092584120913 (code B ref -1); Mon, 06 Sep 2021 10:58:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Sep 2021 10:57:21 +0000 Received: from localhost ([127.0.0.1]:52109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNCJV-0005RA-8K for submit@debbugs.gnu.org; Mon, 06 Sep 2021 06:57:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:35936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNCJP-0005Qw-9Y for submit@debbugs.gnu.org; Mon, 06 Sep 2021 06:57:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNCJO-0000cs-0p for guix-patches@gnu.org; Mon, 06 Sep 2021 06:57:14 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:56132 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNCJL-0000LO-Fc for guix-patches@gnu.org; Mon, 06 Sep 2021 06:57:13 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1630925825; bh=zvtc+Usc5TcstdMdjk8Juu1HB9FJ3YduT+mo/DONu60=; h=From:To:Subject:Date; b=IDVzn10XndCt7M9m/CDpQEoI4s4muWIQDKXn8yCFYqy2HvE8SO2QtbTvHj3+CHnmp nElYD1ueeoAsUWnC5GW0mFICjW2SlCRxiodk1ubDo2bH/dOe5wVpn+4g5Hq14M/ZKA KW98aonr+kPaXG03/PF+QdI4v3XY75p5dt/hLOqs= Message-Id: <7a5a35f29121ebbb2e1ec1fe991159fbf6bae2e4.1630925679.git.public@yoctocell.xyz> Date: Mon, 06 Sep 2021 12:57:04 +0200 MIME-Version: 1.0 Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.419, PDS_OTHER_BAD_TLD=1.999, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 Otherwise, remotes without a branch named 'master' will cause an error when importing. * guix/import/elpa (git-repository->origin): Fallback to HEAD instead of the 'master' branch. --- For example, try to import the ‘consult’ package from MELPA: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix import elpa -a melpa consult ;;; note: source file /home/yoctocell/src/guix/guix/import/elpa.scm ;;; newer than compiled /home/yoctocell/src/guix/guix/import/elpa.go ;;; note: source file /home/yoctocell/src/guix/guix/import/elpa.scm ;;; newer than compiled /home/yoctocell/.config/guix/current/lib/guile/3.0/site-ccache/guix/import/elpa.go ;;; note: source file /home/yoctocell/src/guix/guix/import/elpa.scm ;;; newer than compiled /home/yoctocell/.guix-home/profile/lib/guile/3.0/site-ccache/guix/import/elpa.go Backtrace: In ice-9/boot-9.scm: 1752:10 16 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In unknown file: 15 (apply-smob/0 #) In ice-9/boot-9.scm: 724:2 14 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 13 (_ #(#(#))) In guix/ui.scm: 2185:7 12 (run-guix . _) 2148:10 11 (run-guix-command _ . _) In guix/scripts/import.scm: 121:11 10 (guix-import . _) In guix/scripts/import/elpa.scm: 104:23 9 (guix-import-elpa . _) In guix/import/elpa.scm: 207:2 8 (elpa->guix-package _ #:repo _ #:version _) In ice-9/boot-9.scm: 1752:10 7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In guix/store.scm: 658:37 6 (thunk) In guix/git.scm: 481:8 5 (latest-repository-commit # "https://github.com/…" …) 247:4 4 (update-cached-checkout _ #:ref _ #:recursive? _ #:check-out? _ #:starting-commit _ # _ …) 211:19 3 (resolve _) In git/branch.scm: 101:8 2 (_ _ _ _) In git/bindings.scm: 77:2 1 (raise-git-error _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Git error: cannot locate remote-tracking branch 'origin/master' --8<---------------cut here---------------end--------------->8--- guix/import/elpa.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: 9540323458de87b0b8aa421e449a4fe27af7c393 diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index c0dc5acf51..f9689aaa13 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Oleg Pykhalov ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus +;;; Copyright © 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -257,7 +258,7 @@ RECIPE." ((assoc-ref recipe #:commit) => (lambda (commit) (cons 'commit commit))) (else - '(branch . "master")))) + '()))) (let-values (((directory commit) (download-git-repository url ref))) `(origin