Skip to content

Resholve doesn’t understand sudo --verison #113

@Jayman2000

Description

@Jayman2000

Resholve’s parser for sudo is supposed to support sudo --version, but it doesn’t work. This Nix expression:

{ pkgs ? import <nixpkgs> { } }:
pkgs.resholve.writeScript "sudo-fix-example" {
  inputs = [ pkgs.sudo ];
  fix = [ "sudo" ];
  interpreter = "${pkgs.bash}/bin/bash";
} ''
  sudo --version
''

fails to build with the following error:

[resholve context] : invoking resholve with PWD=/build
[resholve context] RESHOLVE_LORE=/nix/store/yhc5n7zv9sw87nbfn3qhnv05jifvpj76-more-binlore
[resholve context] RESHOLVE_FIX=sudo
[resholve context] RESHOLVE_INPUTS=/nix/store/q56d1m0ws1kf8vddfw71d8nfagnv0x6g-sudo-1.9.15p2/bin
[resholve context] RESHOLVE_INTERPRETER=/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin/bash
[resholve context] /nix/store/c99gv3kyb0qzqhppsb4iqijnzqx475vh-resholve-0.9.0/bin/resholve --overwrite /nix/store/bqah3m79k7wyrq3cah4sjbxwppm42xqk-sudo-fix-example
WARNING:__main__:CommandParser CommandParser(prog='sudo (generic)', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=False) passing instead of 'too few arguments'
WARNING:__main__:CommandParser CommandParser(prog='sudo (generic)', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=False) passing instead of 'argument commands is required'
  sudo --version
  ^~~~
'/nix/store/bqah3m79k7wyrq3cah4sjbxwppm42xqk-sudo-fix-example':2: 'sudo' executes its arguments in some circumstances, and none of my command-specific rules for figuring out if this specific invocation does or not succeeded. Look above for warning messages with more context on what went wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions