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

nix flake check fails for yarn packages #162528

Open
mkhl opened this issue Mar 2, 2022 · 3 comments
Open

nix flake check fails for yarn packages #162528

mkhl opened this issue Mar 2, 2022 · 3 comments
Labels

Comments

@mkhl
Copy link
Contributor

mkhl commented Mar 2, 2022

Describe the bug

nix flake check fails for yarn packages

Steps To Reproduce

Steps to reproduce the behavior:

  1. git clone https://github.com/mkhl/yarn-flake-check
  2. cd yarn-flake-check
  3. nix flake check

Expected behavior

the checks succeed

Screenshots

error: a 'aarch64-linux' with features {} is required to build '/nix/store/ayfxz488paiyyaiz6sbgcdvv5r063g1a-yarn.nix.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

Additional context

none

Notify maintainers

maybe @jtojnar?

Metadata

> nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.16.11-200.fc35.x86_64, Fedora Linux, 35 (Workstation Edition)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.1`
 - channels(mkhl): `"nixpkgs"`
 - nixpkgs: `/home/mkhl/.nix-defexpr/channels/nixpkgs`
@Artturin
Copy link
Member

Artturin commented Mar 3, 2022

For context

yarn.nix is being built at

# Generates the yarn.nix from the yarn.lock file

@tomberek
Copy link
Contributor

Duplicate of NixOS/nix#4265

simpler reproducer:

{
  outputs = { self, nixpkgs }: {
  checks = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"] (system:
    with nixpkgs.legacyPackages.${system}; {
      hello = import (writeText "hi" "hi");
    });
  };
}

This is due to IFD (import from derivation) being required to perform the evaluation. In some sense the error message is correct: you are unable to be certain that the flake evaluates on a aarch64-linux without performing a build on that architecture. This is a reason IFD can cause problems and should often be avoided. If you had an aarch64-linux builder in your builders option, then a build would be dispatched there and the result used to continue evaluation.

@mkhl
Copy link
Contributor Author

mkhl commented Apr 10, 2022

i see, thank you

although i don't understand why the same issue isn't present for packages, just for checks

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

No branches or pull requests

4 participants