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

List the features a derivation requires when it cannot be built locally #2037

Closed
wants to merge 1 commit into from

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Apr 2, 2018

error: a 'aarch64-linux' is required to build '/nix/store/2r9r8m2pf8j0kjwfxk02gx5siyl4m9ks-hello-2.10.drv', but I am a 'x86_64-linux'

okay .... but ...

$ cat /etc/nix/machines
root@myaarch64 aarch64-linux /root/foobar 96 1 big-parallel

applies patch

error: a 'aarch64-linux' with the system feature 'magic-pixie-dust' is required to build '/nix/store/2r9r8m2pf8j0kjwfxk02gx5siyl4m9ks-hello-2.10.drv', but I am a 'x86_64-linux'

ah ha!

@grahamc grahamc added the UX The way in which users interact with Nix. Higher level than UI. label Apr 2, 2018
@grahamc
Copy link
Member Author

grahamc commented Apr 2, 2018

P.S. this is literally the first C++ I've ever written, so ...

@shlevy shlevy self-assigned this Apr 2, 2018
@shlevy shlevy added the triaged label Apr 2, 2018
@shlevy
Copy link
Member

shlevy commented Apr 2, 2018

Hmm... So one thought is that the requred system features stuff is technically part of the build-remote build hook, and as of today build.cc is technically build-hook agnostic. There's #1221 which may be the right way to go here, or maybethis should instead be part of build-remote when it fails to find a matching machine?

@grahamc
Copy link
Member Author

grahamc commented Apr 2, 2018

I think you're right, it is a bit outside of the responsibilities here. Perhaps a more C++-skilled dev would like to take over the idea and carry it forward :)

@shlevy
Copy link
Member

shlevy commented Apr 2, 2018

@edolstra Thoughts on this? Should we remove the concept of build-hooks separate from build-remote?

if (features.size() > 1) {
throw Error(
format("a '%1%' with the system features '%4%' is required to build '%3%', but I am a '%2%'")
% drv->platform % settings.thisSystem % drvPath % concatStringsSep("', '", features));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that format is obsolete, you can just write:

throw Error("a machine of type '%s' is required", drv->platform);

@grahamc
Copy link
Member Author

grahamc commented May 25, 2018

@edolstra I just updated to use the new way, and also added tests to assert the messages come out properly.

@grahamc
Copy link
Member Author

grahamc commented May 25, 2018

If this is acceptable and merges, ideally, we would also backport it.

@grahamc
Copy link
Member Author

grahamc commented May 26, 2018

Shea proposes I move the impl to

for (auto & m : machines) {

@teto
Copy link
Member

teto commented Sep 26, 2018

does that work the other way around ? like explain why a remote builder can't be selected for a package ? anyway looks useful

@domenkozar
Copy link
Member

This was actually committed in 1e7b8de#diff-267a6391980cbd9a743958945ff44ef9R1796

@domenkozar domenkozar closed this May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX The way in which users interact with Nix. Higher level than UI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants