Skip to content

Don't panic if output stream is closed early #69

@Qubasa

Description

@Qubasa

Issue description

nix-locate crashes if you try to pipe the results in bash.
Only breaks if there is more then one result returned by nix-locate.

Steps to reproduce

nix-locate libQt5Xml.so.5 | head -n 1

Technical details

$ nix-locate libQt5Xml.so.5 | head -1
robomongo.out 0 s /nix/store/arnj25h57nqjixwc4nx12ad6fsz8jls1-robo3t-1.1.1/lib/robo3t/lib/libQt5Xml.so.5
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', libstd/io/stdio.rs:692:9
note: Run with RUST_BACKTRACE=1 for a backtrace.

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.19.17, NixOS, 18.09.1985.749a3a0d00b (Jellyfish)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • channels(root): "nixos-18.09.1985.749a3a0d00b, nixos-unstable-19.03pre166987.bc41317e243"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugc: queryingFeatures/bugs in nix-locate, the program to query the database

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions