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

'called with unexpected argument 'hash'' #73

Open
rmcgibbo opened this issue Feb 24, 2021 · 3 comments
Open

'called with unexpected argument 'hash'' #73

rmcgibbo opened this issue Feb 24, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@rmcgibbo
Copy link
Collaborator

at 8aafc3a

# bzip2 builds okay
[nix-shell:~/projects/nixpkgs]$ nix build -f . bzip2 && echo "Success"
Success

# but hammer crashes
[nix-shell:~/projects/nixpkgs]$ nix run -f /home/mcgibbon/projects/nixpkgs-hammering -c nixpkgs-hammer -f . --json bzip2
error: --- TypeError ------------------------------------------------------------------------------------------------------------- nix-instantiate
at: (26:6) in file: /home/mcgibbon/projects/nixpkgs/pkgs/development/interpreters/python/fetchpypi.nix

    25|     url = computeUrl (builtins.removeAttrs attrs ["sha256" "hash"]) ;
    26|   in fetchurl {
      |      ^
    27|     inherit url sha256 hash;

anonymous function at /home/mcgibbon/projects/nixpkgs/pkgs/build-support/fetchurl/boot.nix:5:1 called with unexpected argument 'hash'
(use '--show-trace' to show detailed location information)
Traceback (most recent call last):
  File "/nix/store/dnma1329bwy5fn4id4v1i9w4bdkdws7h-nixpkgs-hammer/bin/.nixpkgs-hammer-wrapped", line 318, in <module>
    main(args)
  File "/nix/store/dnma1329bwy5fn4id4v1i9w4bdkdws7h-nixpkgs-hammer/bin/.nixpkgs-hammer-wrapped", line 238, in main
    overlay_data = nix_eval_json(all_messages_nix, args.show_trace)
  File "/nix/store/dnma1329bwy5fn4id4v1i9w4bdkdws7h-nixpkgs-hammer/bin/.nixpkgs-hammer-wrapped", line 70, in nix_eval_json
    result = subprocess.check_output(args, encoding="utf-8", input=expr)
  File "/nix/store/wkw6fsjasr7jbbrlakxxpbiapa8hws42-python3-3.8.7/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/nix/store/wkw6fsjasr7jbbrlakxxpbiapa8hws42-python3-3.8.7/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['nix-instantiate', '--strict', '--json', '--eval', '-']' returned non-zero exit status 1.
@rmcgibbo rmcgibbo added the bug Something isn't working label Feb 24, 2021
@rmcgibbo
Copy link
Collaborator Author

It seems completely unrelated to nixpkgs-hammering -- like there's a bug in how fetchpypi.nix calls fetchurl, but I'm not sure.

@jtojnar
Copy link
Owner

jtojnar commented Feb 25, 2021

Yeah, I have seen that in nixpkgs with flakes sometimes (e.g. NixOS/nixpkgs#97176). The bootstrapping fetchurl defined in boot.nix does not accept all the arguments fetchurl does. Not sure how to avoid triggering that though.

@rmcgibbo
Copy link
Collaborator Author

This is another attr that triggers this crash:

nixpkgs-hammer -f . --json --exclude attribute-ordering --exclude explicit-phases --exclude attribute-typo --exclude no-build-output gccForLibs
error: --- TypeError ------------------------------------------------------------------------------------------------------------- nix-instantiate
at: (17:2) in file: /home/mcgibbon/projects/nixpkgs/pkgs/build-support/fetchzip/default.nix

    16| 
    17| (fetchurl ({
      |  ^
    18|   inherit name;

anonymous function at /home/mcgibbon/projects/nixpkgs/pkgs/build-support/fetchurl/boot.nix:5:1 called with unexpected argument 'meta'
(use '--show-trace' to show detailed location information)
Traceback (most recent call last):
  File "/nix/store/sgyxvyzm85siv7ivwv6cca7v29hf430l-nixpkgs-hammer/bin/.nixpkgs-hammer-wrapped", line 399, in <module>
    main(args)
  File "/nix/store/sgyxvyzm85siv7ivwv6cca7v29hf430l-nixpkgs-hammer/bin/.nixpkgs-hammer-wrapped", line 326, in main
    overlay_data = nix_eval_json(all_messages_nix, args.show_trace)
  File "/nix/store/sgyxvyzm85siv7ivwv6cca7v29hf430l-nixpkgs-hammer/bin/.nixpkgs-hammer-wrapped", line 136, in nix_eval_json
    json_text = subprocess.check_output(args, text=True, input=expr)
  File "/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['nix-instantiate', '--strict', '--json', '--eval', '-']' returned non-zero exit status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants