From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Date: Tue, 1 Aug 2023 09:10:38 -0700 Message-ID: References: <8e555eb8-529d-d11c-66c7-bd16f5d45be7@gmail.com> <87edknj6nf.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25810"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64985@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 01 18:11:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qQry2-0006Va-Ch for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Aug 2023 18:11:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQrxn-0001Cc-Aa; Tue, 01 Aug 2023 12:11:11 -0400 Original-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 1qQrxf-0001Bx-DV for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2023 12:11:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qQrxe-00025p-Nz for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2023 12:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qQrxe-00031q-BR for bug-gnu-emacs@gnu.org; Tue, 01 Aug 2023 12:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Aug 2023 16:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64985 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64985-submit@debbugs.gnu.org id=B64985.169090624711617 (code B ref 64985); Tue, 01 Aug 2023 16:11:02 +0000 Original-Received: (at 64985) by debbugs.gnu.org; 1 Aug 2023 16:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:48212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQrxP-00031I-6j for submit@debbugs.gnu.org; Tue, 01 Aug 2023 12:10:47 -0400 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:47337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQrxN-000312-1C for 64985@debbugs.gnu.org; Tue, 01 Aug 2023 12:10:45 -0400 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bbf3da0ea9so25035035ad.2 for <64985@debbugs.gnu.org>; Tue, 01 Aug 2023 09:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690906238; x=1691511038; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=2v2PpH5rBEe5UVJ9qICh3tSelZlRHrka0WAIwr2k5Qs=; b=SvQEqFHQ0HVyYEDwWHU8XAjDZSjSukS/pAM46YLBeNPhjZpi0FwSymAwFh+WDxbmxT PYcY0FkuIlfw6lA/v/+P1RfsPDfaNDkMmWOnTvq0BIsRfPQSxi5CwkS0xxFtIbKbLx9s Fmsr4S+1Amp8L8bL4RURFLk3vnWVqctxw/smSiBDIKHkGVahOvwUOtt3mV2YljIFfEdD m/akC5l4q+0ppMR2N0eBNgsH1sfg/+PPBA8U24h7Ki0Bh12tDhdkjpmc0ht3ZYtnyNT0 rFt6lwvTzQWItFG5yiUMfpBxCjak3RjCrrBQohGdabogK59PtBG7fISWVXCH11grW0I0 Y/6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690906238; x=1691511038; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2v2PpH5rBEe5UVJ9qICh3tSelZlRHrka0WAIwr2k5Qs=; b=WMFdVoJSwG2k4J6SX41K/nz1q9TPTdyCURzAlCYK9kVODWpF64KhCYPe6/lV9wbioS Opl5d76BraIFb2NyDEzCUydpGB5dKG3gHQOv1SsXErgbM0QCHmxGDwwT9x/GeU/kvejQ pe3txcX/r2ILVv56UCLs3oOooWnYoZWhlIoavJVKbqzRXt7w1fWcYcHtCKeP6ZeBv/QY dKNbBzRXv9vRQ+QKT+L2cmErp5Bw42bTNTEj3o3+q6m2mnixip4y+ARiTa1CDApdc1yt FGVfh6cLYYmssDGGM8l2cXUpJSjqrcxByabFoiaPnKnxIAF8IBIcK4J67yIfhcyQC/fa ICtQ== X-Gm-Message-State: ABy/qLbrjBv/6Gex84+gMRWKfBCVAuJBgGEjwDh8zmnNNcRu9AFVDAvU 4kv1wtmVSAhLlPY5ZijDCns= X-Google-Smtp-Source: APBJJlF/F5caxe8wcZJHbAAMbWzub25I11cMgL077gsBxfcyv4cSQAyGqxdyeCYObw2asvKKV6TJLA== X-Received: by 2002:a17:902:834c:b0:1bb:a6de:8e49 with SMTP id z12-20020a170902834c00b001bba6de8e49mr11234476pln.9.1690906238402; Tue, 01 Aug 2023 09:10:38 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id m24-20020a170902bb9800b001bbbbda70ccsm10662534pls.158.2023.08.01.09.10.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 09:10:37 -0700 (PDT) Content-Language: en-US In-Reply-To: <87edknj6nf.fsf@posteo.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266458 Archived-At: On 8/1/2023 5:20 AM, Philip Kaludercic wrote: > Jim Porter writes: > >> When using the various package-vc installation functions, Emacs >> byte-compiles the source (good). However, it doesn't ignore sources >> that match wildcards in ".elpaignore" (bad). That's because, even >> though 'byte-compile-ignore-files' is documented to be a list of >> regexps, 'byte-recompile-directory' treats it as a list of strings. > > I am a bit confused about this point. Why do you think that > `byte-recompile-directory' treads `byte-compile-ignore-files' as a list > of non-regexp strings? The docstring for 'regexp-opt' (which is what 'byte-recompile-directory' uses to combine 'byte-compile-ignore-files') says this: Return a regexp to match a string in the list STRINGS. Each member of STRINGS is treated as a fixed string, not as a regexp. > Here also, instead of merging a list of regular expressions into a > disjunctive one, you match each individually. Am I missing something, > or what does this change? > > (string-match-p (regexp-opt '("foo" "bar" "baz")) "foo") ;=> 0 > (seq-some (lambda (ex) (string-match-p ex "foo")) '("foo" "bar" "baz")) ;=> 0 Consider this case: (string-match-p (regexp-opt '("fo+" "bar")) "foo") ;=> nil (seq-some (lambda (ex) (string-match-p ex "foo")) '("fo+" "bar")) ;=> 0 There might be another way to do this, e.g. so that we could optimize the regexp, but I'm not sure if Emacs has anything to optimize a list of *regexp* alternatives (rather than a list of *string* alternatives). I tested out 'rx' too, but no luck there either. This seemed like the best I could do without more extensive changes, which I wanted to avoid for the 29 branch.