Closed cognominal closed 6 days ago
Enabled extracting backends [git unzip path] don't understand /var/folders/n0/_8g462950vgdhwl4s_h_jysw0000gn/T//.zef/1710712745.5407/1710712765.5407.3645.7283472892477/0869ab01c0d73b78b04600d0b6c5d73359af8914.tar.gz
This implies you don't have the tar
command available in your PATH
. You can look at https://github.com/ugexe/zef/blob/main/lib/Zef/Service/Shell/tar.rakumod for an example of the code that gets run. Specifically the probe
method, when it returns true, tells zef that it can find tar and use it.
FWIW I've installed fresh rakudos on various M1/M2/M3 macbooks and used zef successfully as-is, so it is strange that tar
seems to not be findable on your system.
Thx. Tar is accessible thru PATH env var. But something may be indeed wrong with my system. I have seen strange error messages when running docker failing to fork stuff thru bin/sh or whatever. That does not affect docker otherwise. This may be related.
Problem solved, thx to your help. Zef found a tar executable in PDP11 (!!! see below) format and did not try to find further in the PATH env the path for a correct tar. So zef could be more robust against that kind of time travel so I don't close the bug report. But really that's on me.
This is really comical. I deserve tar and feathers. And it is indeed doubly a tar problem. A few days ago, I pulled the tar of v7 unix because I wanted to see the sources of the prehistoric shell. I untared it in my home directory, which was a mistake because the tar has no prefix so the /bin
files ended up in ~/bin
. I was searching for the sources and I did not notice the tar contained the binaries as well so I did not clean it up.
$ cd ~/bin
$ file tar
tar: PDP-11 separate I&D executable
$ ls -l tar
-rwxr-xr-x 1 cog staff 17724 May 16 1979 tar
$ which tar
/usr/bin/tar
And speaking of shells. Modern shells are robust. zsh does not even whine and execs the good tar.
I’m not sure what a reasonable action for zef to take is in that scenario. There would have to be a way to determine the type of tar (bsd, gnu, busybox, etc) as well as the version from invoking the command itself, and as far as I know there is no way to do this. I’m also not really a fan of trying every version of a program in PATH to find one that works - that’s not how any shell works when invoking commands so is just as likely to lead to some other confusing behavior for some other edge case. Maybe I’m missing something though… do any other popular tools behave like that?
Like I said, neither modern shells fall in that trap, nor the which
command. So there must be a way to do it. Having my problem (that was clearly my fault) solved, I understand these may be a low priority target for you to work around buggy user settings.
I thank you for your helpful support and for writing zef in the first place.
My real concern would be it is real slow compared to npm
but that may be a rakudo problem.
I mentioned PATH
earlier, but really zef just does the equivalent of run 'tar', '--help
- it doesn't actually crawl PATH
looking for what to run. It sounds like one of your shell files might be setting up PATH for an interactive shell but not for other processes or something. I'm not sure that e.g. which tar
does any magic to find the "right" tar or tries multiple tars.
Once I have suppressed the spurious PDP11 executables in my `~/bin' folder all problems and warning messages have disappeared on my mac. As for calling the right executables when spurious ones appear earlier in the PATH , I don't know the correct idiom and how it would translate rakuwise.
Context
This is a followup on https://github.com/rakudo/star/issues/199
Expected Behavior
Installation of App::Mi6
Actual Behavior
Installation fails
Steps to Reproduce
Your Environment
raku -v
zef list --installed