Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when missing remote building feature forbids build #2238

Closed
nh2 opened this issue Jun 17, 2018 · 7 comments
Closed

Improve error message when missing remote building feature forbids build #2238

nh2 opened this issue Jun 17, 2018 · 7 comments

Comments

@nh2
Copy link
Contributor

nh2 commented Jun 17, 2018

I tried today to build a big package (chromium) remotely on a powerful machine with

nix-store --realise --builders 'ssh://[email protected] x86_64-linux' /nix/store/i0kwyxpihg1gcp9jg4qwp7qcrpagj818-chromium-67.0.3396.87.drv /nix/store/bmigs53iryqpqjsy5w4qjfndlh6hxbms-chromium-67.0.3396.87.drv

but it would build only locally. Trying to force the remote build with -j0:

nix-store --realise --builders 'ssh://[email protected] x86_64-linux' -j0 /nix/store/i0kwyxpihg1gcp9jg4qwp7qcrpagj818-chromium-67.0.3396.87.drv /nix/store/bmigs53iryqpqjsy5w4qjfndlh6hxbms-chromium-67.0.3396.87.drv

got me:

unable to start any build; either increase '--max-jobs' or enable remote builds

But I have remote build enabled -- --builders is given right there!

On IRC I learned that it's because chromium has requiredSystemFeatures = [ "big-parallel" ];, and I need to declare that my remote machine is big-parallel.

Solution:

nix-store --realise --builders 'ssh://[email protected] x86_64-linux - - - big-parallel' -j0 /nix/store/i0kwyxpihg1gcp9jg4qwp7qcrpagj818-chromium-67.0.3396.87.drv /nix/store/bmigs53iryqpqjsy5w4qjfndlh6hxbms-chromium-67.0.3396.87.drv

But ideally we would improve the error message, perhaps

  • not suggesting or enable remote builds when it's enabled
  • printing a helpful warning/info message when when a builder with fitting architecture isn't selected just because it doesn't have a special flag like big-parallel
@shonfeder-da
Copy link

shonfeder-da commented Dec 17, 2018

The second option seems much more user friendly to me.

An error along these lines would have been the most helpful for me:

considering building on remote machine 'ssh://vm'
hook reply is 'decline'
this build requires system features [foo,...]
the remote machine is only declared as supporting [...]
if the remote machine supports it, add foo to the requiredSystemsFeatures of the `builders` configuration

@domenkozar
Copy link
Member

Similarly for local builds: #2238

@colemickens
Copy link
Member

I hit another variant of this, sort of. It's easy to make a syntax error and not notice or be warned, unless your Nix evaluator contains a @lheckemann who might then point it out. For those who don't, maybe this will help:

For example, this will work for building my system configuration:

"ssh://azurenixosuser@${azmachine} x86_64-linux - - - big-parallel,kvm"

But this will not:

"ssh://azurenixosuser@${azmachine} x86_64-linux - - - big-parallel kvm"

(Why my system needs kvm to build is a different question for another day...)

@domenkozar
Copy link
Member

Fixed!

@colemickens
Copy link
Member

I'm stumped again. Why does it seem like it's not even trying the remote builder I'm offering up?

> nix build .#packages.aarch64-linux.drm-howto --builders ssh-ng://[email protected] --verbose
warning: Git tree '/home/cole/code/nixcfg' is dirty
info: --- Remote build --- build-remote
Failed to find a machine for remote build!

derivation: ziz2sfr9h5w1sss2w2bzhjf4vl2g314g-source.drv
required (system, features): (aarch64-linux, )
1 available machines:
(systems, maxjobs, supportedFeatures, mandatoryFeatures)
(x86_64-linux, 1, , )
error: --- Error ------------------------------------------------------------------------------------------------------------------------ nix
error: --- Error --- nix-daemon
a 'aarch64-linux' with features {} is required to build '/nix/store/ziz2sfr9h5w1sss2w2bzhjf4vl2g314g-source.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

@lheckemann
Copy link
Member

You need to specify that it's aarch64 in the builders string: --builders ssh-ng://[email protected] aarch64-linux

@573
Copy link

573 commented Mar 28, 2022

You need to specify that it's aarch64 in the builders string: --builders ssh-ng://[email protected] aarch64-linux

Originally posted by @lheckemann in #2238 (comment)

This was what I needed in my ~/.config/nix/nix.conf (or any of the other possible alternative config locations), had builders = ssh-ng://builder and extra-platforms = aarch64-linux there, now with builders = ssh-ng://builder aarch64-linux the remote builder is picked (https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants