Skip to content

nix-store --print-env improperly escapes the command line arguments of the builder #14327

@matshch

Description

@matshch

Describe the bug

nix-store --print-env uses single quotes both for every argument of the builder, and for the whole _args parameter, causing double quoting of the _args.

Steps To Reproduce

  1. Run nix-store --print-env $(nix-instantiate '<nixpkgs>' -A firefox) | grep _args
  2. Observe double single quotes:
export _args; _args=''-e' '/nix/store/vj1c3wf9c11a0qs6p3ymfvrnsdgsdcbq-source-stdenv.sh' '/nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh''

Expected behavior

export _args; _args='-e /nix/store/vj1c3wf9c11a0qs6p3ymfvrnsdgsdcbq-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'

Metadata

nix-env (Nix) 2.28.5

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions