nix icon indicating copy to clipboard operation
nix copied to clipboard

A way to disable warning about non-existent search path entry

Open mrkkrp opened this issue 7 years ago • 7 comments

Hope I'm filling the issue to the right tracker.

Is there a way to disable the annoying:

warning: Nix search path entry '/home/mark/.nix-defexpr/channels' does not exist, ignoring

Why:

  • I'm on NixOS and I use root channel only. As I understand user channel defaults to that anyway.
  • This thing is very annoying and screws some tools that parse output of other tools. For example stack with nix flag/setting will run/use nix under the hood and another tool that usually parses stack's output now chokes on this "warning" thing. That's just one example.

mrkkrp avatar Jun 02 '18 10:06 mrkkrp

Like this:

$ stack path --dist-dir
warning: Nix search path entry '/home/mark/.nix-defexpr/channels' does not exist, ignoring
.stack-work/dist/x86_64-linux-nix/Cabal-2.0.1.0

Ask yourself, whether or not this warning should really be displayed every time some nix tool is run and just how inconvenient this is.

mrkkrp avatar Jun 02 '18 10:06 mrkkrp

Would handling stderr differently than stdout help here? Haven't checked which we use when precisely but hopefully the part you don't want is on stderr?

Or is something reading stderr looking for errors/warnings/etc. but doesn't understand this one?

dtzWill avatar Jun 02 '18 17:06 dtzWill

I think the code does not expect this sort of thing to be printed in stderr too, it only expects path. If this warning is absolutely necessary from your point of view, it would be great to at least have a way to disable it, it's so annoying and coveys zero useful information.

mrkkrp avatar Jun 02 '18 17:06 mrkkrp

Nix's stderr is not intended to be parsed. I don't think we ever print anything with a specified format on stderr. Thus tools should not be confused by arbitrary diagnostic messages.

Having said that, I wouldn't mind removing this particular warning.

edolstra avatar Aug 10 '18 18:08 edolstra

I marked this as stale due to inactivity. → More info

stale[bot] avatar Feb 23 '21 22:02 stale[bot]

I closed this issue due to inactivity. → More info

stale[bot] avatar Apr 28 '22 00:04 stale[bot]

related: #2982.

fyi, as a workaround i managed to use mkdir ~/.local/state/nix/profiles/channels.

KiaraGrouwstra avatar Jun 18 '25 08:06 KiaraGrouwstra