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

fix tail: cannot open '+2' for reading: No such file or directory #7

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

nvimtor
Copy link
Contributor

@nvimtor nvimtor commented Sep 7, 2024

Running your template flake gives me this exception:

Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
no configure script, doing nothing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
no Makefile or custom buildPhase, doing nothing
Generating remote plugin manifest
Looking for lua dependencies...
_addToLuaPath called for dir /nix/store/naynwkgl2pwnbl5vmcljys2wiidr568i-nv-rtp
newpath: /nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-luassert-1.9.0-1
_addToLuaPath called for dir /nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-luassert-1.9.0-1
newpath: /nix/store/gdjhjqfhx153xsazmq3d72hvzfcgmkqj-lua5.1-say-1.4.1-3
_addToLuaPath called for dir /nix/store/gdjhjqfhx153xsazmq3d72hvzfcgmkqj-lua5.1-say-1.4.1-3
newpath: /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
_addToLuaPath called for dir /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
newpath: /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
_addToLuaPath called for dir /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
/nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5 already parsed
newpath: /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
_addToLuaPath called for dir /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
/nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5 already parsed
newpath: /nix/store/k0s4b632514y6g950jzvjfdqqzf1jjs7-lua5.1-plenary.nvim-scm-1
_addToLuaPath called for dir /nix/store/k0s4b632514y6g950jzvjfdqqzf1jjs7-lua5.1-plenary.nvim-scm-1
newpath: /nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-luassert-1.9.0-1
_addToLuaPath called for dir /nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-luassert-1.9.0-1
/nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-luassert-1.9.0-1 already parsed
newpath: /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
_addToLuaPath called for dir /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
/nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5 already parsed
newpath: /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
_addToLuaPath called for dir /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
/nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5 already parsed
newpath: /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
_addToLuaPath called for dir /nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5
/nix/store/h8alfg9b0fqn1yzh9pwy1pmjb4m1ww92-lua-5.1.5 already parsed
#################################################
LUA_PATH: ;;;/nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-luassert-1.9.0-1/share/lua/5.1/?.lua;/nix/store/bhn7kr9rscvnjy5kxbhvw7ixdjwhnkg1-lua5.1-lua>
LUA_CPATH: ;;
#################################################
tail: cannot open '+2' for reading: No such file or directory

I tracked it down to neovimWrapper generating a bash script with this command:

tail +2 ${placeholder "out"}/bin/${name} >> $BASHCACHE

it seems that tail interprets +2 as the file on my system for some reason, but to be fair tail +n without the -n option has been obsolete for quite some time.

I am running macOS.

I just added the -n and it fixed it.

Out of curiosity, what system are you using?

Thanks for writing nv by the way

@NicoElbers
Copy link
Owner

For your curiosity, I'm running Linux. I'm no expert on tail, so I just copied what I saw in nixCats (@BirdeeHub, you might have the same issue). I'll try to build locally and then accept your pr :)

@NicoElbers NicoElbers merged commit 0331a51 into NicoElbers:main Sep 7, 2024
@BirdeeHub
Copy link

BirdeeHub commented Sep 7, 2024

Yeah someone PR'd this same fix to nixCats a while back. Was my fault, didnt have a mac to test on but I should have fully spelled it out rather than relying on the shorthand version XD

@BirdeeHub
Copy link

BirdeeHub commented Sep 7, 2024

Also, all that does is set an environment variable that tells you where the wrapper itself is for stuff like vim-startuptime where you actually want the path to the wrapper rather than the path to nvim itself. I expose the value of it here

In nixCats you can also add more things to it in categoryDefinitions if you want to run more shell code before the wrapper runs. I wouldnt necessarily suggest doing so and there isnt much reason to when you can do most things via extraWrapperArgs, but like, maybe someone needs it idk.

The reason I am clarifying is that there is a comment about not knowing why thats there.

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 this pull request may close these issues.

3 participants