Hi Ian, 

On May 19, 2025 6:51:33 AM GMT+02:00, Ian Eure <[email protected]> wrote:
>Hi Guixers,
>
>I’m trying to native-compile the Emacs packages in my Guix Home configuration. 
> My understanding is that will happen automatically when you specify the 
>`emacs' package to the emacs-build-system’s arguments (instead of the default 
>`emacs-minimal').
>
>I wrote a procedure which transforms any packages using emacs-build-system to 
>use `emacs':
>
>   (define (with-full-emacs pkg)
>     (if (eq? (package-build-system pkg) emacs-build-system)
>         (package
>           (inherit pkg)
>           (arguments
>            (ensure-keyword-arguments
>             (package-arguments pkg)
>             (list #:emacs emacs))))
>         pkg))
>
>And a function which uses `package-mapping' to apply this to all the packages 
>in my home-environment:
>
>   (define (+emacs-native-comp home-env)
>     (let ((xform (package-mapping with-full-emacs #:deep? #t)))
>       (home-environment
>         (inherit home-env)
>         (packages
>          (map xform (home-environment-packages home-env))))))
>
>This all seems sensible to me, but when I `guix home reconfigure', I get:

This will map the packages in packages list, but it doesn't have to be all 
packages in the profile. The packages also come from services extending the 
home-profile-service-type. I can't really think of an easy way to map it over 
all packages other than going through all the service records and mapping all 
fields (people already wrote code for that). And even that won't work if 
packages are hard coded somewhere.

>
>   guix home: error: profile contains conflicting entries for    emacs-s
>   guix home: error:   first entry: [email protected]    
> /gnu/store/gv32m8dn3l7f3678vy2v4dy5kzk7a7q6-emacs-s-1.13.0
>   guix home: error:    ... propagated from [email protected]
>   guix home: error:    ... propagated from    [email protected]
>   guix home: error:   second entry: [email protected]    
> /gnu/store/vgs5nsgjf2n5x8f3bfavqxq6srnmz2fk-emacs-s-1.13.0
>   guix home: error:    ... propagated from [email protected]
>
>The second package, the one propagated by emacs-lemon, is the untransformed 
>package:
>
>   $ guix build emacs-s
>   /gnu/store/vgs5nsgjf2n5x8f3bfavqxq6srnmz2fk-emacs-s-1.13.0
>
>What am I missing?  Does `package-mapping' not change propagated-inputs?  Does 
>anyone have a working setup they can share?


It definitely does, otherwise you wouldn't get any of the propagated inputs 
changed. 

Are you sure you don't have the emacs package emacs-lemon added from any of the 
services? 

Rutherther 

Reply via email to