<ivan>
I think if people looked at the tar source and documentation they would find this agreeable
<ivan>
(gnutar)
<andi->
ivan: yeah, I think I said that back then... the bsd implementation seems much more appropirate.. Many people are probably just used to some weird behaviour of gnutar :/
<ekleog>
-> try on staging & see what happens?
<andi->
go nuts :-)
<ivan>
andi-: it looks like bsdtar makes some effort to be compatible with gnutar options and it's probably not that hard to add another option or two
<ivan>
weird behavior can be restored by putting gnutar in the user environment I hope
<ekleog>
… wait, tar isn't by default in any environment and there's no package named `tar`, or did I miss something?
<andi->
ivan: well, I think part of the effort would be to provide bsdtar as default to users to get rid of that obscure behaviour?
<ivan>
ekleog: gnutar
<ekleog>
what we're speaking about is basically stdenv / fetchurl?
<andi->
ekleog: I think tar is in the default env
<ekleog>
so stdenv's gnutar
<ivan>
andi-: yes, that would be optimal
<ekleog>
importing stdenv by default on all nix-shell is a big mistake anyway :(
<ekleog>
`nix-shell -p`
<andi->
nixos/modules/config/system-path.nix also pulls it in
<andi->
I'd like to make it an option, e.g. `programs.tar.useBrokenAsFuckGnuTar`
<andi->
;-)
<ekleog>
it's called something like `environment.systemPackages = [ (pkgs.hiPrio pkgs.gnutar) ];`, isn't it?
<andi->
it is a simple assignment
<andi->
no priorities
<ekleog>
without priorities it would conflict with pkgs.bsdtar, wouldn't it? unless bsdtar defaults to lowPrio, but I guess as part of the move to bsdtar we'd want to make gnutar lowPrio, not bsdtar
<andi->
thats why I said I'd add a option for it to toggle between them
<ekleog>
the default priority is set in nixpkgs, so it wouldn't be possible to set it via a nixos option, though, would it? unless that becomes a nixpkgs option, but… adding an option just for toggling the default priority sounds not-nice, esp. when it's quite easy to fix from nixos (disclaimer: I somehow feel we're misunderstanding each other right now)
<andi->
ahh, you are talking about the gnutar inclusion into stdenv with the mentioned nix-shell problem. That might get solved using those priorities indeed..
* ekleog
at a loss right now
<ekleog>
what I currently see is: 1. set gnutar as lowPrio, set bsdtar as normal priority, 2. set stdenv's tar to `with pkgs; lowPrio bsdtar`, 3. leave the user who wants gnutar globally use `environment.systemPackages = with pkgs; [ (hiPrio gnutar) ];`
<ekleog>
oh and 2,5. set system-path.nix to bsdtar instead of gnutar
<ekleog>
(or maybe `with pkgs; lowPrio bsdtar`, but I'd like to avoid this kind of hackery as much as possible… stdenv's deps should all be lowPrio, though, IMO, if they aren't already)
<ekleog>
*stdenv* should be lowPrio, so forget my point 2 above
* ekleog
tired
<ekleog>
so to sum up (bis): 1. set gnutar as lowPrio, bsdtar as normal priority, 2. set stdenv's tar to bsdtar, 3. set system-path.nix to bsdtar (or maybe `lowPrio bsdtar` but I kind of don't like), 4. leave the user who wants gnutar globally use `environment.systemPackages = with pkgs; [ (hiPrio gnutar) ];`
<andi->
I kind of feel the other way around.. the user shouldn't have to resort to `hiPrio` to "override" the tar selection.. BUt we are probably reaching bikeshedding state :-)
<ivan>
tarshedding
<ekleog>
yup :D actually upon more thought I dislike `lowPrio bsdtar` but I'd definitely like mapping `lowPrio` on all `system-path.nix`
* ekleog
preparing a PR with that
<ivan>
would `bsdtar` be a new package that installs libarchive and a tar that points at bsdtar?
<ivan>
because libarchive has a bsdtar executable now, not tar
<andi->
isn't that the usecase for multiple outputs? It sounds a bit silly since then packages name starts with `lib`
<ivan>
ah, I haven't looked at multiple outputs
<andi->
`libarchive.bin` or whatever it woudl be then
<ekleog>
would make sense to add a bsdtar alias for it, though, wouldn't it?