GNU bug report logs - #37150
Erroneous uses of regex in the invokation of FIND-FILES

Previous Next

Package: guix;

Reported by: Alex Vong <alexvong1995 <at> gmail.com>

Date: Fri, 23 Aug 2019 02:51:02 UTC

Severity: normal

Done: Andreas Enge <andreas <at> enge.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37150 in the body.
You can then email your comments to 37150 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#37150; Package guix. (Fri, 23 Aug 2019 02:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Vong <alexvong1995 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 23 Aug 2019 02:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Vong <alexvong1995 <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: Erroneous uses of regex in the invokation of FIND-FILES
Date: Fri, 23 Aug 2019 10:50:02 +0800
[Message part 1 (text/plain, inline)]
Hello guix,

Currently, there are a lot of erroneous uses of regex in the invokation
of FIND-FILES. Please see the conversations below (taken from
https://lists.gnu.org/archive/html/guix-devel/2019-08/msg00149.html).

Mark H Weaver writes:

> Hi Alex,
>
> Alex Vong <alexvong1995 <at> gmail.com> writes:
>
>> I find out that there are a lof of erroneous uses of regex in the
>> invokation of FIND-FILES. The correct usage should be:
>>
>>   (find-files "." "\\.c$")
>>
>> Instead people write:
>>
>>   (find-files "." ".*\\.c")
>>
>> which match unwanted files.
>>
>> For examples, in the procedure CUSTOM-GCC, the correct regex should be:
>>
>>   "(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)$"
>>
>> instead of:
>>
>>   ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"
>>
>> Please correct me if I am wrong.
>
> You're right.  It would be good to fix these problems incrementally, as
> long as the changes don't cause too many rebuilds.
>
> Changes to core packages will need to wait for now, since 'core-updates'
> is frozen, and 'core-updates-next' should also be considered frozen,
> since it will become 'core-updates' as soon as Berlin has built it out a
> bit more.  (The only change in 'core-updates-next' relative to
> 'core-updates' is that the new bootstrap tarballs have been fixed to be
> deterministic.)
>
> For some of these fixes, it might be best to apply them to 'staging'.
>
>> Right now, the erroneous use of regex in CUSTOM-GCC casues the 'bin/'
>> directory of the output of gccgo, gcc-objc and gcc-objc++ to be empty.
>
> I'm uncertain how many rebuilds it would trigger to change 'custom-gcc',
> and I don't have confidence that "guix refresh -l" is capable of giving
> us a reliable answer.  In the meantime, would you like to file a bug
> report for this, so it's not forgotten?
>
> Thanks for looking into it.
>
>      Best,
>       Mark


-- 
Stand with Hong Kong!
#Eye4HK
Alex

https://twitter.com/freedomhkg
https://twitter.com/stand_with_hk
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37150; Package guix. (Fri, 23 Aug 2019 03:56:01 GMT) Full text and rfc822 format available.

Message #8 received at 37150 <at> debbugs.gnu.org (full text, mbox):

From: Alex Vong <alexvong1995 <at> gmail.com>
To: 37150 <at> debbugs.gnu.org
Cc: Mark H Weaver <mhw <at> netris.org>
Subject: Re: Erroneous uses of regex in the invokation of FIND-FILES
Date: Fri, 23 Aug 2019 11:55:00 +0800
[Message part 1 (text/plain, inline)]
Hello Mark,

>> You're right.  It would be good to fix these problems incrementally, as
>> long as the changes don't cause too many rebuilds.
>>
I agree we should fix it incrementally, like how the 'invoke' transition
was handled. The patch below does exactly that (it fixes the problem for
delta which causes 6 rebuilds only according to "guix refresh -l").

[0001-gnu-delta-Fix-regex-in-the-invokation-of-find-files.patch (text/x-diff, inline)]
From cb5f2febd564a2bcb550de537156db59588098c4 Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995 <at> gmail.com>
Date: Fri, 23 Aug 2019 11:06:49 +0800
Subject: [PATCH] gnu: delta: Fix regex in the invokation of 'find-files'.

See <https://bugs.gnu.org/37150> for more information.

* gnu/packages/debug.scm (delta)[arguments]: Fix regex.
---
 gnu/packages/debug.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 82631deef6..e1cba5d3fe 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -75,7 +75,7 @@
                (begin
                  (for-each (lambda (h)
                              (install-file h doc))
-                           `("License.txt" ,@(find-files "www" ".*\\.html")))
+                           `("License.txt" ,@(find-files "www" "\\.html$")))
                  (for-each (lambda (b)
                              (install-file b bin))
                            `("delta" "multidelta" "topformflat"))))
-- 
2.23.0

[Message part 3 (text/plain, inline)]
>> Changes to core packages will need to wait for now, since 'core-updates'
>> is frozen, and 'core-updates-next' should also be considered frozen,
>> since it will become 'core-updates' as soon as Berlin has built it out a
>> bit more.  (The only change in 'core-updates-next' relative to
>> 'core-updates' is that the new bootstrap tarballs have been fixed to be
>> deterministic.)
>>
>> For some of these fixes, it might be best to apply them to 'staging'.
>>
>>> Right now, the erroneous use of regex in CUSTOM-GCC casues the 'bin/'
>>> directory of the output of gccgo, gcc-objc and gcc-objc++ to be empty.
>>
>> I'm uncertain how many rebuilds it would trigger to change 'custom-gcc',
>> and I don't have confidence that "guix refresh -l" is capable of giving
>> us a reliable answer.  In the meantime, would you like to file a bug
>> report for this, so it's not forgotten?
>>
It would probably cause a world rebuild... I will wait for the next
cycle for patch submittion.

>> Thanks for looking into it.
>>
>>      Best,
>>       Mark

You're welcomed!


-- 
Stand with Hong Kong!
#Eye4HK #BoycottMulan
Alex

https://twitter.com/freedomhkg
https://twitter.com/stand_with_hk
[signature.asc (application/pgp-signature, inline)]

Reply sent to Andreas Enge <andreas <at> enge.fr>:
You have taken responsibility. (Tue, 01 Apr 2025 16:43:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Vong <alexvong1995 <at> gmail.com>:
bug acknowledged by developer. (Tue, 01 Apr 2025 16:43:02 GMT) Full text and rfc822 format available.

Message #13 received at 37150-done <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: 37150-done <at> debbugs.gnu.org
Subject: Close
Date: Tue, 1 Apr 2025 18:42:32 +0200
Hello,

I am closing this bug as not concretely actionable.

If you find concrete instances where the regexps do not match and we end
up deleting too many or too few files, for instance, please feel free
to submit patches as separate bugs.

Andreas





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Apr 2025 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.