Cross arch deployments are broken #46

Open
opened 2026-03-19 11:00:10 +00:00 by yureka · 0 comments

Arcana reads the config.deployment.activationProgram attribute from the target config to know which deployment server to start on the deployer.

By naively setting deployment.activationProgram = pkgs.[...], this results in the deployment server for the target architecture being called.

In my case, deploying an x86_64-linux microvm target from an aarch64-linux laptop:

[pid 115843] execve("/nix/store/gcbn5z795zmb4ghiadc9hrhqqs1azxa0-arcana-microvm-server-0.6.0/bin/arcana-microvm-server", ["/nix/store/gcbn5z795zmb4ghiadc9h"..., "127.0.0.1:9000"], 0x555555c22aa0 /* 147 vars */) = -1 ENOENT (No such file or directory)
[pid 115843] +++ exited with 127 +++
[pid 115494] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=115843, si_uid=1000, si_status=127, si_utime=0, si_stime=0} ---
[ERROR] -----
[ERROR] Operation failed with error: Unknown error: Failed to execute activation program: Os { code: 2, kind: NotFound, message: "No such file or directory" }

It tries to start the x86_64-linux microvm server on my laptop, which doesn't exist (and even if it did exist, it would be the wrong architecture).

Resolving this mismatch is more difficult than expected, because there is no way to inject a deployerPkgs into the target configuration in flakes. It is intended in flakes, that properties of the target configuration can not evaluate to different values depending on the deployer who evaluates them.

For this, I suggest to make activationProgram a function which is called with the deployer architecture / packageset to inject the deployer architecture:

deployment.activationProgram = pkgs: pkgs.[...];

Or, if we want to go flakes-style, make it an attribute set with the supported deployer architectures

deployment.activationProgram.x86_64-linux = (import pkgs.path { system = "x86_64-linux"; }).[...];
deployment.activationProgram.aarch64-linux = (import pkgs.path { system = "aarch64-linux"; }).[...];
Arcana reads the `config.deployment.activationProgram` attribute from the target config to know which deployment server to start on the deployer. By naively setting `deployment.activationProgram = pkgs.[...]`, this results in the deployment server for the target architecture being called. In my case, deploying an x86_64-linux microvm target from an aarch64-linux laptop: ``` [pid 115843] execve("/nix/store/gcbn5z795zmb4ghiadc9hrhqqs1azxa0-arcana-microvm-server-0.6.0/bin/arcana-microvm-server", ["/nix/store/gcbn5z795zmb4ghiadc9h"..., "127.0.0.1:9000"], 0x555555c22aa0 /* 147 vars */) = -1 ENOENT (No such file or directory) [pid 115843] +++ exited with 127 +++ [pid 115494] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=115843, si_uid=1000, si_status=127, si_utime=0, si_stime=0} --- [ERROR] ----- [ERROR] Operation failed with error: Unknown error: Failed to execute activation program: Os { code: 2, kind: NotFound, message: "No such file or directory" } ``` It tries to start the x86_64-linux microvm server on my laptop, which doesn't exist (and even if it did exist, it would be the wrong architecture). Resolving this mismatch is more difficult than expected, because there is no way to inject a `deployerPkgs` into the target configuration in flakes. It is intended in flakes, that properties of the target configuration can not evaluate to different values depending on the deployer who evaluates them. For this, I suggest to make activationProgram a _function_ which is called with the deployer architecture / packageset to inject the deployer architecture: ``` deployment.activationProgram = pkgs: pkgs.[...]; ``` Or, if we want to go flakes-style, make it an attribute set with the supported deployer architectures ``` deployment.activationProgram.x86_64-linux = (import pkgs.path { system = "x86_64-linux"; }).[...]; deployment.activationProgram.aarch64-linux = (import pkgs.path { system = "aarch64-linux"; }).[...]; ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arcana/arcana#46
No description provided.