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
ack
installs, but reports "use: command not found"
#47302
Comments
Seems to work for me on NixOS unstable.
|
Same, Linux here as well though. Can any Darwin user give this a try? I don't know OSX versions but I do recall some (presumably older-ish?) had some issue with shebang handling, but it'd probably be best to wait for someone who knows more before jumping to any conclusions :). |
I had a similar problem the other day when I got a script for the wrong architecture — it turns out that when calling the interpreter specified in the shebang results in "Exec format error", (at least on linux) the kernel will try to run it with /bin/sh instead. @Calvin-L can you run |
@lheckemann I can, in fact!
|
Seems like it's a problem with shebang handling on Darwin.
This is the nix shebang for
Manually calling So I just removed the duplicate paths from the
Not sure why this problem exists though. Maybe duplicate include directories in shebangs should be fixed in the |
Interestingly, on mac just calling it from cli explicitly works: |
That shebang line is awful long. Could it be that MacOS has some maximum length for the shebang line? That would explain why shortening the line makes it work. If Bash has a longer maximum command length, then it also explains why invoking perl directly from Bash works. |
This issue might be a duplicate of #35353, which is looking into |
This stackoverflow solution is an interesting workaround - could maybe considered as wrapper logic for
|
I can confirm modifying the shebang to remove the duplicate includes fixes |
@Calvin-L On macos, I was able to install ack with Got the same error though due to shebang line length |
Issue description
The
ack
tool can be installed, but reports errors like "use: command not found". These errors are symptoms of trying to execute a Perl script with Bash; I am not sure why the shebang line in theack
script is not working.(Also, unrelated: while
nix-shell -p ack
works,nix-env -i ack
instead reports "error: selector 'ack' matches no derivations". Perhaps I have some misunderstanding about what the arguments to these commands mean.)Steps to reproduce
Shebang line
Technical details
"x86_64-darwin"
Darwin 17.7.0, macOS 10.13.6
no
no
nix-env (Nix) 2.1.1
"nixpkgs-19.03pre153206.f753852e11d"
/Users/cloncari/.nix-defexpr/channels/nixpkgs
The text was updated successfully, but these errors were encountered: