unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Compiling aarch64-linux packages on x86_64-linux
@ 2025-01-05 18:03 Ian Eure
  2025-01-05 23:26 ` Ian Eure
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Eure @ 2025-01-05 18:03 UTC (permalink / raw)
  To: help-guix

In "(guix) Additional Build Options", documenting the --system 
option,
the Guix manual says:

    Similarly, when transparent emulation with QEMU and 
    ‘binfmt_misc’
    is enabled (*note ‘qemu-binfmt-service-type’: Virtualization
    Services.), you can build for any system for which a QEMU
    ‘binfmt_misc’ handler is installed.

So, I added this -- the exact configuration from "(guix) 
Virtualization Services" in the manual -- to my operating-system’s 
services:

	 (service qemu-binfmt-service-type
			  (qemu-binfmt-configuration
               (platforms (lookup-qemu-platforms "arm" 
               "aarch64"))))

And `guix system reconfigure'd.  The service is running:

    # herd status qemu-binfmt
    Status of qemu-binfmt:
      It is running since Mon Dec 30 20:47:07 2024 (6 days ago).
      Running value is #t.
      It is enabled.
      Provides: qemu-binfmt
      Requires: file-system-/proc/sys/fs/binfmt_misc
      Will be respawned.

If I try to build a package with --system specified, it fails due 
to the wrong architecture:

    $ guix build --system=aarch64-linux guix
    The following derivation will be built:
      /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv
    building 
    /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv...
    @ unsupported-platform 
    /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv 
    aarch64-linux
    while setting up the build environment: a `aarch64-linux' is 
    required to build 
    `/gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv', 
    but I am a `x86_64-linux'
    builder for 
    `/gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv' 
    failed with exit code 1
    build of 
    /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv 
    failed
    View build log at 
    '/var/log/guix/drvs/6w/wbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv.gz'.
    guix build: error: build of 
    `/gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv' 
    failed

The "(guix) Native Builds" part of the manual mentions that this 
error will occur "If the ‘binfmt_misc’ mechanism is not setup 
correctly..."

What is the correct way to set Guix up so I can build 
aarch64-linux packages on x86_64-linux?

Thanks,

  -- Ian


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compiling aarch64-linux packages on x86_64-linux
  2025-01-05 18:03 Compiling aarch64-linux packages on x86_64-linux Ian Eure
@ 2025-01-05 23:26 ` Ian Eure
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Eure @ 2025-01-05 23:26 UTC (permalink / raw)
  To: help-guix

Hi all,

Not sure why this was needed, but running:

    $ sudo herd restart file-system-/proc/sys/fs/binfmt_misc

...solved the problem for me.  I assume a reboot would have as well.  I'm not sure why this was needed -- seems like it shouldn't be -- but at least builds are building for me now.

  -- Ian

On Sun, Jan 5, 2025, at 6:03 PM, Ian Eure wrote:
> In "(guix) Additional Build Options", documenting the --system 
> option,
> the Guix manual says:
>
>     Similarly, when transparent emulation with QEMU and 
>     ‘binfmt_misc’
>     is enabled (*note ‘qemu-binfmt-service-type’: Virtualization
>     Services.), you can build for any system for which a QEMU
>     ‘binfmt_misc’ handler is installed.
>
> So, I added this -- the exact configuration from "(guix) 
> Virtualization Services" in the manual -- to my operating-system’s 
> services:
>
> 	 (service qemu-binfmt-service-type
> 			  (qemu-binfmt-configuration
>                (platforms (lookup-qemu-platforms "arm" 
>                "aarch64"))))
>
> And `guix system reconfigure'd.  The service is running:
>
>     # herd status qemu-binfmt
>     Status of qemu-binfmt:
>       It is running since Mon Dec 30 20:47:07 2024 (6 days ago).
>       Running value is #t.
>       It is enabled.
>       Provides: qemu-binfmt
>       Requires: file-system-/proc/sys/fs/binfmt_misc
>       Will be respawned.
>
> If I try to build a package with --system specified, it fails due 
> to the wrong architecture:
>
>     $ guix build --system=aarch64-linux guix
>     The following derivation will be built:
>       
> /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv
>     building 
>     
> /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv...
>     @ unsupported-platform 
>     
> /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv 
>     aarch64-linux
>     while setting up the build environment: a `aarch64-linux' is 
>     required to build 
>     
> `/gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv', 
>     but I am a `x86_64-linux'
>     builder for 
>     
> `/gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv' 
>     failed with exit code 1
>     build of 
>     
> /gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv 
>     failed
>     View build log at 
>     
> '/var/log/guix/drvs/6w/wbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv.gz'.
>     guix build: error: build of 
>     
> `/gnu/store/6wwbzsry0c3sm5s0aifgj4sfzahmkk30-guix-1.4.0-31.121e96d.drv' 
>     failed
>
> The "(guix) Native Builds" part of the manual mentions that this 
> error will occur "If the ‘binfmt_misc’ mechanism is not setup 
> correctly..."
>
> What is the correct way to set Guix up so I can build 
> aarch64-linux packages on x86_64-linux?
>
> Thanks,
>
>   -- Ian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-05 23:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-05 18:03 Compiling aarch64-linux packages on x86_64-linux Ian Eure
2025-01-05 23:26 ` Ian Eure

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).