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

PackagesQuery::iter doesn't fail on error #187

Open
edude03 opened this issue Jul 1, 2022 · 0 comments
Open

PackagesQuery::iter doesn't fail on error #187

edude03 opened this issue Jul 1, 2022 · 0 comments

Comments

@edude03
Copy link
Contributor

edude03 commented Jul 1, 2022

I've been hacking on this today "in anger" because I was trying to get nix-index working on my m1 mac but it doesn't due to haskellPackages not evaluating:

$ nix-env -qa -f '<nixpkgs>' -A haskellPackages --xml
error: attribute 'streamly_0_8_1_1' missing

       at /nix/store/1plvwhmv48whaypzixdlahjvwv19nz7h-nixpkgs/nixpkgs/pkgs/development/haskell-modules/configuration-darwin.nix:259:6:

          258|     ] ++ (drv.libraryFrameworkDepends or []);
          259|   }) super.streamly_0_8_1_1;
             |      ^
          260|

I figured I could quickly jump in and make nix-index ignore sets that don't evaluate however, it ends up in an infinite loop when the parser fails.

I'm not sure exactly what the intention here was:

https://github.com/bennofs/nix-index/blob/e7c66ba52fcfba6bfe51adb5400c29a9622664a2/src/nixpkgs.rs#L112-L136

But in case of an error, it returns Some(Err), which tells rust there are more items in the iter.

as a quick hack to test my theory I added something like

if let Some(Err(_)) = opt {
  return None
}

opt

which works, but I'm not sure what the proper solution is.

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

1 participant