FS#66744 - [zstd] Should zstdmt be a symlink to zstd, not a unique binary?

Attached to Project: Arch Linux
Opened by Troy Engel (TE) - Friday, 22 May 2020, 16:54 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 25 May 2020, 21:34 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Based on what I'm seeing, the `zstdmt` binary in our package is a duplicate of the `zstd` binary, but using a symlink (like `zstdcat` and `unzstd`) works as expected as documented in the man page.

$ ls -l /usr/bin/*zstd*
-rwxr-xr-x 1 root root 694328 Nov 28 00:23 /usr/bin/pzstd
lrwxrwxrwx 1 root root 4 Nov 28 00:23 /usr/bin/unzstd -> zstd
-rwxr-xr-x 1 root root 809144 Nov 28 00:23 /usr/bin/zstd
lrwxrwxrwx 1 root root 4 Nov 28 00:23 /usr/bin/zstdcat -> zstd
-rwxr-xr-x 1 root root 3881 Nov 28 00:23 /usr/bin/zstdgrep
-rwxr-xr-x 1 root root 30 Nov 28 00:23 /usr/bin/zstdless
-rwxr-xr-x 1 root root 809144 Nov 28 00:23 /usr/bin/zstdmt

$ sha256sum /usr/bin/zstd /usr/bin/zstdmt
6e10693f4643b9807cc1bc572063a5e950e7b5bebcedd5078e5436f284365a30 /usr/bin/zstd
6e10693f4643b9807cc1bc572063a5e950e7b5bebcedd5078e5436f284365a30 /usr/bin/zstdmt

$ cd $HOME
$ ln -s /usr/bin/zstd ./zstdmt
$ ./zstdmt -v iso/rhel-server-7.6-x86_64-dvd.iso -o test.zstd
*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
Note: 2 physical core(s) detected

(notice the "two physical cores detected" - this is not present when running with `zstd`). I can then watch it create threads for each core (watch -n 1 "ps -T -p $(pidof zstdmt)"), so I then tested it on a different quad-core device and it is detected and used as well when launched with a symlink:

$ ./zstdmt -v iso/SLE-15-SP1-Installer-DVD-x86_64-GM-DVD1.iso -o test.zstd
*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
Note: 4 physical core(s) detected

This aligns to the man page of what I should expect to happen, and it's documented in the same stanza as zstdcat and unzstd are, which are also symlinks as shown above. I _think_ we could use a symlink instead of shipping the same binary twice in the package under different names?


Additional info:

$ pacman -Q zstd
zstd 1.4.4-1

Steps to reproduce:

(outlined above)
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Monday, 25 May 2020, 21:34 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in trunk.

Loading...