Subject: [bug#77266] [PATCH v4 1/2] gnu: Merge xorg configurations when extending.

From: Ludovic Courtès <[email-masked]>
Date: Sun, 18 May 2025 11:30:59 +0200

Hello,

Ian Eure <[email-masked]> writes:

> Ludovic Courtès <[email-masked]> writes:
>
>> Hi Ian,
>>
>> Ian Eure <[email-masked]> 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.

My point is that ‘delete-duplicates’ cannot be applied on file-like
objects, as is the case for ‘modules’, ‘fonts’, and ‘drivers’ in the
excerpt above.  That’s why I said in this case ‘delete-duplicates’
should be moved to the “build side”.

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

The doc says:

     ‘extra-config’ (default: ‘'()’)
          This is a list of strings or objects appended to the
          configuration file.  It is used to pass extra text to be added
          verbatim to the configuration file.

Ludo’.