From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GD8JDrPY0mAO8QAAgWs5BA (envelope-from ) for ; Wed, 23 Jun 2021 08:46:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2NiaCbPY0mC9SgAAbx9fmQ (envelope-from ) for ; Wed, 23 Jun 2021 06:46:11 +0000 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 ACC6814B86 for ; Wed, 23 Jun 2021 08:46:10 +0200 (CEST) Received: from localhost ([::1]:33630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvweH-00039S-2T for larch@yhetil.org; Wed, 23 Jun 2021 02:46:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvweA-00039K-44 for guix-patches@gnu.org; Wed, 23 Jun 2021 02:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvwe9-0004q9-Sl for guix-patches@gnu.org; Wed, 23 Jun 2021 02:46:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvwe9-0001xn-PU for guix-patches@gnu.org; Wed, 23 Jun 2021 02:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49181] Fix missing phases in Emacs builds Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Jun 2021 06:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49181 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 49181@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16244307487521 (code B ref -1); Wed, 23 Jun 2021 06:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jun 2021 06:45:48 +0000 Received: from localhost ([127.0.0.1]:40310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvwds-0001x9-2l for submit@debbugs.gnu.org; Wed, 23 Jun 2021 02:45:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:49354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvwdq-0001x1-B6 for submit@debbugs.gnu.org; Wed, 23 Jun 2021 02:45:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvwdp-00037x-Ge for guix-patches@gnu.org; Wed, 23 Jun 2021 02:45:41 -0400 Received: from zancanaro.com.au ([45.76.117.151]:37592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvwdl-0004PD-C1 for guix-patches@gnu.org; Wed, 23 Jun 2021 02:45:41 -0400 Received: by zancanaro.com.au (Postfix, from userid 116) id 66AEE34D71; Wed, 23 Jun 2021 06:45:30 +0000 (UTC) Received: from jolteon (n49-177-243-126.bla4.nsw.optusnet.com.au [49.177.243.126]) by zancanaro.com.au (Postfix) with ESMTPSA id 5197B34A69 for ; Wed, 23 Jun 2021 06:45:29 +0000 (UTC) User-agent: mu4e 1.4.15; emacs 27.2 From: Carlo Zancanaro Date: Wed, 23 Jun 2021 16:45:28 +1000 Message-ID: <87k0mlaxkn.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=45.76.117.151; envelope-from=carlo@zancanaro.id.au; helo=zancanaro.com.au X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624430770; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post; bh=9z/gtpaVKXCe4QO2FWPWtvAUC5CcqGOqucPpORcOp08=; b=D9va4IXI7tSl2Wqi48YYg3pG2t5oTwWYpI8Z14a48QmtJnBrNizn5vY8QkiomW2IeKlk0E wxsg4l4iGYWaFeoltq0y2mjRhWe2ehedXlef7qjycwukizXUwuuoUgl4pOi9Pik75hhKp6 DcHz2dez/vH5Ds/Z/608MVI3+w4wgSMwOGkgoEZFmhQ/Tgz+8bpuzf/QmzqgJy6rI0tu7d K5BOLG+wg+F1frXuqhBoEp4eaXiyifh25+MuorXiMKLgjSTxHQ7Qh1vEdGYRZI1sNfTWOy kUUpdmJUpIdFKLUmLgedj0fYed0h0mlWuMDVotclw8xWNhpHbYbpgV6uZr9Acw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624430770; a=rsa-sha256; cv=none; b=bXcEw8WOHf/wZnlHVLiSOENZsk3PRmT7B6psojDeCWA4Rh4UC8o05KBhnxQ6jpB1TNcx0+ bwP9UKs5Y+KAJCPMCkG0oSC8FhyCWQlupJlUgRile3X6P15pEjToX9WpjqXFq319cvlPkO e0zPWwDKiYEimmLps+BTEWsZRLbN9Q6FokXnQSWOM2bejlJpVWYOMEKMvDmgmOHD53IapS aeeRdEqz47wSRWVKF9f7P2KU08RxJdbZ+L5R0xPCk6bvUjY3FKmaDJyiuvcYJvBxAhK3BU cMw9/6+yT/lMLyeRkXXpjWXdyGmlBbIQzKwLAwqddXLdDit34GsD/GSjZckpww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: ACC6814B86 X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZSpI7ZHn6tuB --=-=-= Content-Type: text/plain; format=flowed Hi there! I went to install emacs-protobuf-mode today and found that the build wasn't working. I investigated and it looks like someone renamed the add-source-to-load-path phase to expand-load-path, but they left a few references behind. The first of my patches fixes that. The second of my patches is more controversial. It changes modify-phases to error out if the asked-for phase doesn't exist in add-before/add-after clauses. I think this is the right move, because it's hard to imagine when the default behaviour of "add to the end of the phases list" is helpful. In most cases the extra phases are setup/transformation phases that we need to run before the final "install" phase, so it's far more useful to fail early than to add these to the end of the phases list. Carlo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gnu-Fix-references-to-emacs-build-system-s-expand-lo.patch >From d07b375d6d0a1c354587b285a2547aee8f6e9f96 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 23 Jun 2021 15:57:40 +1000 Subject: [PATCH 1/2] gnu: Fix references to emacs-build-system's expand-load-path phase * gnu/packages/emacs-xyz.scm (emacs-pdf-tools): Change reference from emacs-add-source-to-load-path to emacs-expand-load-path * gnu/packages/erlang.scm (emacs-erlang): Change reference from add-source-to-load-path to expand-load-path * gnu/packages/protobuf.scm (emacs-protobuf-mode): Change reference from add-source-to-load-path to expand-load-path --- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/erlang.scm | 2 +- gnu/packages/protobuf.scm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index eef33fd437..28b87d49dd 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -3310,7 +3310,7 @@ during idle time, while Emacs is doing nothing else.") ("pdf-tools-handle-upgrades" '())))) (add-after 'emacs-patch-variables 'emacs-expand-load-path (assoc-ref emacs:%standard-phases 'expand-load-path)) - (add-after 'emacs-add-source-to-load-path 'emacs-install + (add-after 'emacs-expand-load-path 'emacs-install (assoc-ref emacs:%standard-phases 'install)) (add-after 'emacs-install 'emacs-build (assoc-ref emacs:%standard-phases 'build)) diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm index 7b5dc70b5d..d52d5c3983 100644 --- a/gnu/packages/erlang.scm +++ b/gnu/packages/erlang.scm @@ -232,7 +232,7 @@ built-in support for concurrency, distribution and fault tolerance.") (arguments `(#:phases (modify-phases %standard-phases - (add-before 'add-source-to-load-path 'change-working-directory + (add-before 'expand-load-path 'change-working-directory (lambda _ (chdir "lib/tools/emacs") #t))))) (home-page "https://www.erlang.org/") (synopsis "Erlang major mode for Emacs") diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm index 857adf1703..9c6dcb51cc 100644 --- a/gnu/packages/protobuf.scm +++ b/gnu/packages/protobuf.scm @@ -311,7 +311,7 @@ structured data.") (arguments `(#:phases (modify-phases %standard-phases - (add-before 'add-source-to-load-path 'change-working-directory + (add-before 'expand-load-path 'change-working-directory (lambda _ (chdir "editors") #t))))) (home-page "https://github.com/protocolbuffers/protobuf") (synopsis "Protocol buffers major mode for Emacs") -- 2.32.0 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0002-guix-Make-modify-phases-error-when-adding-before-aft.patch Content-Transfer-Encoding: quoted-printable >From b272a65b12175a3d0354f18e19247f9ed72f5f8e Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 23 Jun 2021 15:59:37 +1000 Subject: [PATCH 2/2] guix: Make modify-phases error when adding before/afte= r a missing phase * guix/build/utils.scm (alist-cons-before, alist-cons-after): Cause a match= failure if the reference is not found, rather than appending to the alist. * tests/build-utils.scm: Update tests to match. --- guix/build/utils.scm | 15 +++++++++------ tests/build-utils.scm | 12 ++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 419c10195b..6e052a7ea1 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2015, 2018 Mark H Weaver ;;; Copyright =C2=A9 2018 Arun Isaac ;;; Copyright =C2=A9 2018, 2019 Ricardo Wurmus +;;; Copyright =C2=A9 2021 Carlo Zancanaro ;;; ;;; This file is part of GNU Guix. ;;; @@ -571,18 +572,22 @@ effects, such as displaying warnings or error message= s." (define* (alist-cons-before reference key value alist #:optional (key=3D? equal?)) "Insert the KEY/VALUE pair before the first occurrence of a pair whose k= ey -is REFERENCE in ALIST. Use KEY=3D? to compare keys." +is REFERENCE in ALIST. Use KEY=3D? to compare keys. An error is raised w= hen no +such pair exists." (let-values (((before after) (break (match-lambda ((k . _) (key=3D? k reference))) alist))) - (append before (alist-cons key value after)))) + (match after + ((reference after ...) + (append before (alist-cons key value (cons reference after))))))) =20 (define* (alist-cons-after reference key value alist #:optional (key=3D? equal?)) "Insert the KEY/VALUE pair after the first occurrence of a pair whose key -is REFERENCE in ALIST. Use KEY=3D? to compare keys." +is REFERENCE in ALIST. Use KEY=3D? to compare keys. An error is raised w= hen +no such pair exists." (let-values (((before after) (break (match-lambda ((k . _) @@ -590,9 +595,7 @@ is REFERENCE in ALIST. Use KEY=3D? to compare keys." alist))) (match after ((reference after ...) - (append before (cons* reference `(,key . ,value) after))) - (() - (append before `((,key . ,value))))))) + (append before (cons* reference `(,key . ,value) after)))))) =20 (define* (alist-replace key value alist #:optional (key=3D? equal?)) "Replace the first pair in ALIST whose car is KEY with the KEY/VALUE pai= r. diff --git a/tests/build-utils.scm b/tests/build-utils.scm index 654b480ed9..c694b479b3 100644 --- a/tests/build-utils.scm +++ b/tests/build-utils.scm @@ -38,17 +38,17 @@ '((a . 1) (x . 42) (b . 2) (c . 3)) (alist-cons-before 'b 'x 42 '((a . 1) (b . 2) (c . 3)))) =20 -(test-equal "alist-cons-before, reference not found" - '((a . 1) (b . 2) (c . 3) (x . 42)) - (alist-cons-before 'z 'x 42 '((a . 1) (b . 2) (c . 3)))) +(test-assert "alist-cons-before, reference not found" + (not (false-if-exception + (alist-cons-before 'z 'x 42 '((a . 1) (b . 2) (c . 3)))))) =20 (test-equal "alist-cons-after" '((a . 1) (b . 2) (x . 42) (c . 3)) (alist-cons-after 'b 'x 42 '((a . 1) (b . 2) (c . 3)))) =20 -(test-equal "alist-cons-after, reference not found" - '((a . 1) (b . 2) (c . 3) (x . 42)) - (alist-cons-after 'z 'x 42 '((a . 1) (b . 2) (c . 3)))) +(test-assert "alist-cons-after, reference not found" + (not (false-if-exception + (alist-cons-after 'z 'x 42 '((a . 1) (b . 2) (c . 3)))))) =20 (test-equal "alist-replace" '((a . 1) (b . 77) (c . 3)) --=20 2.32.0 --=-=-=--