NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.96k stars 13.97k forks source link

colordiff: Missing dependency on diffutils #163420

Closed dhoppe closed 2 years ago

dhoppe commented 2 years ago

Describe the bug

I am new to Nix, but I am pretty sure there is a dependency missing.

Steps To Reproduce

Run Docker container:

docker run -ti nixos/nix:2.7.0 /bin/sh

Install colordiff:

sh-4.4# nix-env -iA nixpkgs.colordiff
installing 'colordiff-1.0.20'
these 9 paths will be fetched (16.15 MiB download, 88.22 MiB unpacked):
  /nix/store/1xjldbdb814annhpmcwz7h6z6y3lay15-acl-2.3.1
  /nix/store/4i0gfyhwf63ycz5j489mgkh2nlinnvfi-perl-5.34.0
  /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12
  /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108
  /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10
  /nix/store/9igigiz42g7w2i605dd5k1spxy9nkf48-attr-2.5.1
  /nix/store/dj89pwrdlycn8iyn08v8znmynjz1zsi9-coreutils-9.0
  /nix/store/in6z4sl694ckak0q6zijniaj6ls52vdf-colordiff-1.0.20
  /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2
copying path '/nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10' from 'https://cache.nixos.org'...
copying path '/nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2' from 'https://cache.nixos.org'...
copying path '/nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108' from 'https://cache.nixos.org'...
copying path '/nix/store/9igigiz42g7w2i605dd5k1spxy9nkf48-attr-2.5.1' from 'https://cache.nixos.org'...
copying path '/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12' from 'https://cache.nixos.org'...
copying path '/nix/store/1xjldbdb814annhpmcwz7h6z6y3lay15-acl-2.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/dj89pwrdlycn8iyn08v8znmynjz1zsi9-coreutils-9.0' from 'https://cache.nixos.org'...
copying path '/nix/store/4i0gfyhwf63ycz5j489mgkh2nlinnvfi-perl-5.34.0' from 'https://cache.nixos.org'...
copying path '/nix/store/in6z4sl694ckak0q6zijniaj6ls52vdf-colordiff-1.0.20' from 'https://cache.nixos.org'...
building '/nix/store/x15v64qi8lkv3d5s2b95as1mbhxms94a-user-environment.drv'...

Execute colordiff:

sh-4.4# colordiff -Naur /tmp/file1 /tmp/file2
colordiff 1.0.20 (http://www.colordiff.org/)
(C)2002-2022 Dave Ewart, davee@sungate.co.uk

Can't exec "diff": No such file or directory at /root/.nix-profile/bin/colordiff line 393.
readline() on closed filehandle $inputhandle at /root/.nix-profile/bin/colordiff line 419.
Use of uninitialized value $pid in waitpid at /root/.nix-profile/bin/colordiff line 656.

Install diffutils:

sh-4.4# nix-env -iA nixpkgs.diffutils
installing 'diffutils-3.8'
this path will be fetched (0.05 MiB download, 0.21 MiB unpacked):
  /nix/store/rm10h940y46i7rxjhrx2dy94g6dy174y-diffutils-3.8-info
copying path '/nix/store/rm10h940y46i7rxjhrx2dy94g6dy174y-diffutils-3.8-info' from 'https://cache.nixos.org'...
building '/nix/store/qscqvnkny55jbh9qv0qaz4yz14x3x444-user-environment.drv'...

Expected behavior

sh-4.4# colordiff -Naur /tmp/file1 /tmp/file2
colordiff 1.0.20 (http://www.colordiff.org/)
(C)2002-2022 Dave Ewart, davee@sungate.co.uk

--- /tmp/file1  2022-03-09 08:42:04.526418000 +0000
+++ /tmp/file2  2022-03-09 08:42:11.309418000 +0000
@@ -1 +1 @@
-foo
+bar

Additional context

The Perl script itself uses the diff command. https://github.com/daveewart/colordiff/blob/current/colordiff.pl#L35

Notify maintainers

@SuperSandro2000

Metadata

sh-4.4# nix-shell -p nix-info --run "nix-info -m"
these 35 paths will be fetched (53.55 MiB download, 246.92 MiB unpacked):
  /nix/store/043lz8mvyx5vxl058c1i586yqc8ax4ig-glibc-2.33-108-bin
  /nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0
  /nix/store/3pa0xk3mgmx7hqskg63gxviyw7f217i6-bash-interactive-5.1-p12
  /nix/store/4ql2il8lig400vq83jv2m2w7jbs5j5yw-linux-headers-5.16
  /nix/store/5w407jwmhxdd24xxzisv5nzmqlmvbxwb-pcre-8.45
  /nix/store/6d7iaz7ylvp118f3pc7yympdirxnhbdr-bash-interactive-5.1-p12-doc
  /nix/store/6n2skcd82lmq6ncpvn5viw2zf2j95ibj-diffutils-3.8
  /nix/store/7qb6jpzwpcmq04xdmqgdk5ckw9q6cwml-bash-interactive-5.1-p12-man
  /nix/store/940bg5plrnh2zpmf7p7vyvs2annb4bda-patch-2.7.6
  /nix/store/aqnv5ay0wxl11bkfm9qp6l8qr2yg1zvq-gawk-5.1.1
  /nix/store/ar8h49vw49k9w0n86jgvwx9abn527hbw-xz-5.2.5
  /nix/store/bdhm9wxl5mndc8pr5l6ab7a8pvcxi0jz-findutils-4.8.0
  /nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11
  /nix/store/civp2i2znh80127yx3ic8q1xrwx9jjsr-bzip2-1.0.6.0.2-bin
  /nix/store/fdmd7x56kqgz60agaj1d2hlwa87snlyl-ncurses-6.3
  /nix/store/fwcjqi04xx8hyq45d7dfag5mnhfsxxr6-binutils-wrapper-2.35.2
  /nix/store/h6bva8mkj6xfp7za4v3jpp59i58wqs9f-stdenv-linux
  /nix/store/hcpp0sgqrdd8gc2fya3lf5yibk1n1a87-gnugrep-3.7
  /nix/store/igy02sn8h6xsmwy9n318n473v546672s-ed-1.17
  /nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3
  /nix/store/ix20p57nyz6hdcfbnbhxwsmdh8a2r6rh-gzip-1.11
  /nix/store/izkxjfa4vw8hj71nryw29iylansdj36m-gnused-4.8
  /nix/store/l13lf625iabdax27gha8qvd0q3g8cbrx-patchelf-0.14.3
  /nix/store/n7z6qxrfrfy9ifpk9n0m866bjc5kh994-bash-interactive-5.1-p12-info
  /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib
  /nix/store/nsgg55q1kh1ala68pas78hzfxsb3bnjk-bzip2-1.0.6.0.2
  /nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0
  /nix/store/q124axggd6wl6fh9508sxgkknkifrl0z-nix-info
  /nix/store/qggprwbjq1hq7f7rd8jrl9jw4sj0wg3z-xz-5.2.5-bin
  /nix/store/sga0l55gm9nlwglk79lmihwb2bpv597j-binutils-2.35.2
  /nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev
  /nix/store/vdjvk42vbl9wliqvypi1k3qrjq3kkscp-expand-response-params
  /nix/store/xpsby2ij67wc9jms5m3c8fd1jlsq9h0d-gnutar-1.34
  /nix/store/xsgq8c5pg6lpjils5qvg67crrv6sy247-bash-interactive-5.1-p12-dev
  /nix/store/y8h6rxikfqpbs1qyklxg25bwb2sba1pi-readline-8.1p0
copying path '/nix/store/6d7iaz7ylvp118f3pc7yympdirxnhbdr-bash-interactive-5.1-p12-doc' from 'https://cache.nixos.org'...
copying path '/nix/store/n7z6qxrfrfy9ifpk9n0m866bjc5kh994-bash-interactive-5.1-p12-info' from 'https://cache.nixos.org'...
copying path '/nix/store/7qb6jpzwpcmq04xdmqgdk5ckw9q6cwml-bash-interactive-5.1-p12-man' from 'https://cache.nixos.org'...
copying path '/nix/store/nsgg55q1kh1ala68pas78hzfxsb3bnjk-bzip2-1.0.6.0.2' from 'https://cache.nixos.org'...
copying path '/nix/store/6n2skcd82lmq6ncpvn5viw2zf2j95ibj-diffutils-3.8' from 'https://cache.nixos.org'...
copying path '/nix/store/civp2i2znh80127yx3ic8q1xrwx9jjsr-bzip2-1.0.6.0.2-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/igy02sn8h6xsmwy9n318n473v546672s-ed-1.17' from 'https://cache.nixos.org'...
copying path '/nix/store/vdjvk42vbl9wliqvypi1k3qrjq3kkscp-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/bdhm9wxl5mndc8pr5l6ab7a8pvcxi0jz-findutils-4.8.0' from 'https://cache.nixos.org'...
copying path '/nix/store/aqnv5ay0wxl11bkfm9qp6l8qr2yg1zvq-gawk-5.1.1' from 'https://cache.nixos.org'...
copying path '/nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/043lz8mvyx5vxl058c1i586yqc8ax4ig-glibc-2.33-108-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/is8wg3j77z9ndpsvkm85sfbrlvvqd66l-gnumake-4.3' from 'https://cache.nixos.org'...
copying path '/nix/store/izkxjfa4vw8hj71nryw29iylansdj36m-gnused-4.8' from 'https://cache.nixos.org'...
copying path '/nix/store/xpsby2ij67wc9jms5m3c8fd1jlsq9h0d-gnutar-1.34' from 'https://cache.nixos.org'...
copying path '/nix/store/ix20p57nyz6hdcfbnbhxwsmdh8a2r6rh-gzip-1.11' from 'https://cache.nixos.org'...
copying path '/nix/store/4ql2il8lig400vq83jv2m2w7jbs5j5yw-linux-headers-5.16' from 'https://cache.nixos.org'...
copying path '/nix/store/fdmd7x56kqgz60agaj1d2hlwa87snlyl-ncurses-6.3' from 'https://cache.nixos.org'...
copying path '/nix/store/vccvfa5bjb9dv4x6zq5gjf1yp58y4brg-glibc-2.33-108-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/940bg5plrnh2zpmf7p7vyvs2annb4bda-patch-2.7.6' from 'https://cache.nixos.org'...
copying path '/nix/store/l13lf625iabdax27gha8qvd0q3g8cbrx-patchelf-0.14.3' from 'https://cache.nixos.org'...
copying path '/nix/store/5w407jwmhxdd24xxzisv5nzmqlmvbxwb-pcre-8.45' from 'https://cache.nixos.org'...
copying path '/nix/store/y8h6rxikfqpbs1qyklxg25bwb2sba1pi-readline-8.1p0' from 'https://cache.nixos.org'...
copying path '/nix/store/hcpp0sgqrdd8gc2fya3lf5yibk1n1a87-gnugrep-3.7' from 'https://cache.nixos.org'...
copying path '/nix/store/3pa0xk3mgmx7hqskg63gxviyw7f217i6-bash-interactive-5.1-p12' from 'https://cache.nixos.org'...
copying path '/nix/store/q124axggd6wl6fh9508sxgkknkifrl0z-nix-info' from 'https://cache.nixos.org'...
copying path '/nix/store/xsgq8c5pg6lpjils5qvg67crrv6sy247-bash-interactive-5.1-p12-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/ar8h49vw49k9w0n86jgvwx9abn527hbw-xz-5.2.5' from 'https://cache.nixos.org'...
copying path '/nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11' from 'https://cache.nixos.org'...
copying path '/nix/store/qggprwbjq1hq7f7rd8jrl9jw4sj0wg3z-xz-5.2.5-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/sga0l55gm9nlwglk79lmihwb2bpv597j-binutils-2.35.2' from 'https://cache.nixos.org'...
copying path '/nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/fwcjqi04xx8hyq45d7dfag5mnhfsxxr6-binutils-wrapper-2.35.2' from 'https://cache.nixos.org'...
copying path '/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/h6bva8mkj6xfp7za4v3jpp59i58wqs9f-stdenv-linux' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.76-linuxkit`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.7.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
SuperSandro2000 commented 2 years ago

@Artturin thanks for taking this. I think we just want to replace $diff_cmd in line 35. Please give me a ping when you open a PR.