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

hackage2nix: user error (Error in $: Failed reading: not a valid json value. Expecting object value at '}') #123600

Closed
teto opened this issue May 19, 2021 · 3 comments

Comments

@teto
Copy link
Member

teto commented May 19, 2021

Describe the bug
A clear and concise description of what the bug is.
follow up of #122719 (comment)

on commit be1e5f9 with nixExperimental (flakes enabled), I get

maintainers/scripts/haskell/regenerate-hackage-packages.sh
❯ maintainers/scripts/haskell/update-hackage.sh                                                                                                                                                                                                      
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5423  100  5423    0     0  22881      0 --:--:-- --:--:-- --:--:-- 22881
warning: unknown setting 'experimental-features'
[57.8 MiB DL]
path is '/nix/store/vp6dy5a94hbkrmvsl51n6x2k14qh04xs-45a46e6deaf5d304b5f604035fc301b4d5a957a3.tar.gz'
nixpkgs2 on  haskell-updates took 13s 
➜ maintainers/scripts/haskell/regenerate-hackage-packages.sh                                                                                                                                                                                         
warning: unknown setting 'experimental-features'
these derivations will be built:
  /nix/store/658ks0xlvr6zc7mz2g6dpd50d8l7yqay-unpacked-cabal-hashes.drv
Starting hackage2nix to regenerate pkgs/development/haskell-modules/hackage-packages.nix ...
warning: unknown setting 'experimental-features'
error: `stdenv.lib` is a deprecated alias for `lib`
(use '--show-trace' to show detailed location information)
hackage2nix: user error (Error in $: Failed reading: not a valid json value. Expecting object value at '}')

nix-env -qaP --json -f /path/to/nixpkgs --arg config "{ allowAliases = false; overlays = []; }" returns a seemlingly valid (visually) json but is followed by

error: `stdenv.lib` is a deprecated alias for `lib`
(use '--show-trace' to show detailed location information)
}%                   

To Reproduce
Steps to reproduce the behavior:

git checkout be1e5f9698b04dbf6e4d6f0a122348ef1ac69955
maintainers/scripts/haskell/regenerate-hackage-packages.sh
 maintainers/scripts/haskell/regenerate-hackage-packages.sh         

Expected behavior
no error

@sternenseemann
Copy link
Member

Can you rerun with --show-trace. Also note that overlays should be passed as its own option and not in the config set.

@teto
Copy link
Member Author

teto commented May 19, 2021

ofc let's say I was tired xD nix-env -qaP --json -f ~/nixpkgs2 --arg config "{ allowAliases = false; }" --arg overlays '[]' solved my issue.

@teto teto closed this as completed May 19, 2021
@sternenseemann
Copy link
Member

We probably should unset the nix related environment in the script (NIX_PATH, NIXPKGS_*).

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

No branches or pull requests

3 participants