GNU bug report logs - #77266
[PATCH] gnu: Merge xorg configurations when extending.

Previous Next

Package: guix-patches;

Reported by: Ian Eure <ian <at> retrospec.tv>

Date: Wed, 26 Mar 2025 04:25:02 UTC

Severity: normal

Tags: patch

Done: Ian Eure <ian <at> retrospec.tv>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ian Eure <ian <at> retrospec.tv>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 77266 <at> debbugs.gnu.org
Subject: [bug#77266] [PATCH v4 1/2] gnu: Merge xorg configurations when extending.
Date: Mon, 12 May 2025 07:09:25 -0700
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi Ian,
>
> Ian Eure <ian <at> retrospec.tv> writes:
>
>> +(define (merge-xorg-configurations a b)
>> +  (let ((configs (list b a)))           ; Prefer later 
>> configurations.
>> +    (xorg-configuration
>> +     (modules
>> +      (delete-duplicates (append-map 
>> xorg-configuration-modules configs)))
>> +     (fonts
>> +      (delete-duplicates (append-map xorg-configuration-fonts 
>> configs)))
>> +     (drivers
>> +      (delete-duplicates (append-map 
>> xorg-configuration-drivers configs)))
>> +     (resolutions
>> +      (delete-duplicates (append-map 
>> xorg-configuration-resolutions configs)))
>
> As I mentioned before, since ‘equal?’ cannot be meaningfully 
> applied
> here on file-like objects in general, all these 
> ‘delete-duplicates’
> calls should be removed.

Hmm, I thought your previous comment was about the `extra-config' 
field specifically, and I did update that one.  I agree that’s a 
problem, but I’m not sure about the other ones, ex. `drivers' is 
documented as containing a "list of strings."  I can see an 
argument for consistent behavior of deduplication here, and having 
it all in one place.


>>  (define (xorg-configuration->file config)
>>    "Compute an Xorg configuration file corresponding to CONFIG, 
>>    an
>>  <xorg-configuration> record."
>> @@ -334,9 +362,12 @@ (define (expand modules)
>>                             port)
>>                    (newline port)))
>>  
>> -              (for-each (lambda (config)
>> -                          (display config port))
>> -                        '#$(xorg-configuration-extra-config 
>> config))))))
>> +              (for-each
>> +               (lambda (config)
>> +                 (display config port)
>> +                 (newline port))
>> +               (delete-duplicates
>> +                '#$(xorg-configuration-extra-config 
>> config)))))))
>
> As I wrote before, in ‘xorg-configuration->file’, 
> ‘delete-duplicates’
> should be used for drivers, modules, and fonts, but not for
> ‘extra-config’ (which is merely a string).
>
> Could you update it accordingly?

Can’t `extra-config' be a file-like?

 -- Ian




This bug report was last modified 48 days ago.

Previous Next


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