Subject: bug#76582: closed (Re: [bug#76582] [PATCH] build-system: asdf: Don't search and replace inputs when unnecessary.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 03 Mar 2025 14:34:02 +0000

Your bug report

#76582: [PATCH] build-system: asdf: Don't search and replace inputs when unnecessary.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76582: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76582
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#76582] [PATCH] build-system: asdf: Don't search and replace inputs when unnecessary.
From: Christopher Baines <[email-masked]>
To: Guillaume Le Vaillant <[email-masked]>
Cc: [email-masked]
Date: Mon, 03 Mar 2025 14:33:23 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Guillaume Le Vaillant <[email-masked]> writes:

> Christopher Baines <[email-masked]> skribis:
>
>> If the new-name matches the original name, just use the original package.
>> This avoids situations where there are several packages matching the name and
>> the behaviour will be inconsistent, occasionally picking different packages.
>>
>> Since there are multiple glibc packages currently, I'm seeing this behaviour
>> with cl-posix-mqueue and ecl-cl-posix-mqueue, occasionally they'll use the
>> hurd glibc variant.
>>
>> * guix/build-system/asdf.scm (package-with-build-system): Use the original
>> input packages unless the new-name differs.
>>
>> Change-Id: I08a1f3ad1290689b5497d31950ada4dc0bfa3a3a
>> ---
>>  guix/build-system/asdf.scm | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
>> index 26b5a5008a..ad0fb993f6 100644
>> --- a/guix/build-system/asdf.scm
>> +++ b/guix/build-system/asdf.scm
>> @@ -155,9 +155,13 @@ (define* (package-with-build-system from-build-system to-build-system
>>  
>>    (define (find-input-package pkg)
>>      (let* ((name (package-name pkg))
>> -           (new-name (transform-package-name name))
>> -           (pkgs (find-packages-by-name new-name)))
>> -      (if (null? pkgs) #f (list-ref pkgs 0))))
>> +           (new-name (transform-package-name name)))
>> +      (if (string=? name new-name)
>> +          pkg
>> +          (let ((pkgs (find-packages-by-name new-name)))
>> +            (if (null? pkgs)
>> +                #f
>> +                (list-ref pkgs 0))))))
>>  
>>    (define transform
>>      (mlambda (pkg)
>>
>> base-commit: 90ee330bafc5a95493f9cdae2e32ddf740104ebc
>
> Yes, that seems logical. I have not yet tried recompiling packages with
> this patch, but visually it looks good to me.

Thanks for taking a look, with the minimal testing I've done locally it
seems OK, so I've pushed this as
15615db61b106c6e77cfabe042edb9e77d578c95.

Chris

Subject: [PATCH] build-system: asdf: Don't search and replace inputs when unnecessary.
From: Christopher Baines <[email-masked]>
To: [email-masked]
Date: Wed, 26 Feb 2025 10:38:30 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

If the new-name matches the original name, just use the original package.
This avoids situations where there are several packages matching the name and
the behaviour will be inconsistent, occasionally picking different packages.

Since there are multiple glibc packages currently, I'm seeing this behaviour
with cl-posix-mqueue and ecl-cl-posix-mqueue, occasionally they'll use the
hurd glibc variant.

* guix/build-system/asdf.scm (package-with-build-system): Use the original
input packages unless the new-name differs.

Change-Id: I08a1f3ad1290689b5497d31950ada4dc0bfa3a3a
---
 guix/build-system/asdf.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index 26b5a5008a..ad0fb993f6 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -155,9 +155,13 @@ (define* (package-with-build-system from-build-system to-build-system
 
   (define (find-input-package pkg)
     (let* ((name (package-name pkg))
-           (new-name (transform-package-name name))
-           (pkgs (find-packages-by-name new-name)))
-      (if (null? pkgs) #f (list-ref pkgs 0))))
+           (new-name (transform-package-name name)))
+      (if (string=? name new-name)
+          pkg
+          (let ((pkgs (find-packages-by-name new-name)))
+            (if (null? pkgs)
+                #f
+                (list-ref pkgs 0))))))
 
   (define transform
     (mlambda (pkg)

base-commit: 90ee330bafc5a95493f9cdae2e32ddf740104ebc
-- 
2.48.1