Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pxz: execution of xz binary failed: No such file or directory #34

Open
USBhost opened this issue May 12, 2019 · 4 comments · May be fixed by #40
Open

pxz: execution of xz binary failed: No such file or directory #34

USBhost opened this issue May 12, 2019 · 4 comments · May be fixed by #40

Comments

@USBhost
Copy link

USBhost commented May 12, 2019

PXZ cant seem to find the xz binary since fa3194e
Basically making it useless as no compressing or decompressing works.

Tested on Ubuntu 18.04.2

@ole-tange
Copy link

ole-tange commented Jun 23, 2020

Reproducible on Ubuntu 20.04.

Workaround:

It seems to look for xz in current directory - not in $PATH. So if you copy xz to . it works. Or you can do (cd /usr/bin; pxz -dc).

@ole-tange
Copy link

ole-tange commented Jun 23, 2020

This fixes it:

diff --git a/pxz.c b/pxz.c
index 4240b6e..6da940c 100644
--- a/pxz.c
+++ b/pxz.c
@@ -133,7 +133,7 @@ const struct option long_opts[] = {
 };
 
 void __attribute__((noreturn)) run_xz( char **argv, char **envp ) {
-   execve(XZ_BINARY, argv, envp);
+ execvp(XZ_BINARY, argv);
        error(0, errno, "execution of "XZ_BINARY" binary failed");
        exit(EXIT_FAILURE);
 }

@robert-scheck
Copy link
Contributor

I personally started to prefer export CFLAGS="$CFLAGS -DXZ_BINARY='\"/usr/bin/xz\"'" rather than reverting the commit.

@TobiasFaller
Copy link

TobiasFaller commented Dec 19, 2022

I personally started to prefer export CFLAGS="$CFLAGS -DXZ_BINARY='\"/usr/bin/xz\"'" rather than reverting the commit.

I would be in favour to even go a step further and replace the default value of XZ_BINARY with something that is know to work.
By changing the default value of XZ_BINARY in pzx.c to /usr/bin/xz pxz should be able to run again on most distributions.
Distributions with non-default executable location can then override the definition with the CFLAGS argument if needed.

Reported bug for Gentoo package app-arch/pxz: https://bugs.gentoo.org/887255

@TobiasFaller TobiasFaller linked a pull request Dec 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants