Subject: [bug#77033] [PATCH] deploy: Support --target and --system.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 21 Mar 2025 11:12:27 +0900

Hi Sergey,

Sergey Trofimov <[email-masked]> writes:

[...]

>> Perhaps 'guix deploy' could have a '--cross-build' option, or the record
>> could have a 'cross-build?' field, or both, with the CLI taking
>> precedence over the later, and the target type would be inferred from
>> the system via platform-system->target?
>>
>
> Consider such case:
>
> deployer = x86_64, (aarch64 via binfmt)
> builder1 = x86_64, (aarch64 via binfmt)
> builder2 = aarch64, (x86_64 via binfmt)
> remote1 = x86_64
> remote2 = aarch64
>
> The user intends to run `guix deploy all-remotes.scm` on `deployer` to
> deploy both `remote1` and `remote2`.
>
> There are many ways how to build the derivations - deployer and builders
> could all build native/emulated/cross, remotes could build for
> themselves (`build-locally?` to `#f`). I am not sure to what extent this
> should be configurable, however here are a couple things I'd change:
> - add `platform` to `machine` record
> - remove `system` from `machine-ssh-configuration`
> - remove `build-locally?` from `machine-ssh-configuration`
> - add `build-options` to `machine`
>   - `build-host` = `local|offload|remote`
>   - `build-type` = `native|cross`

This seems reasonable; I suppose 'remote' means the machine being
deployed to?

`build-type` having just two values, it could be more simply expressed
as a boolean (e.g.; cross-build?)

> Additionally `guix-daemon` should know all the systems the host
> supports. Currently it knows only the native one (`--system` parameter).

I've never used such feature, so I wouldn't know of how useful that
would be :-).  Perhaps useful if the machine is to be used exclusively
for cross-compiling by default?  You could also set that via 'export
GUIX_BUILD_OPTIONS=--target=$gnu-triplet', no?

-- 
Thanks,
Maxim