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

bug: cache lookup fails for modules under symlinked directories #233

Closed
swsnr opened this issue Dec 29, 2022 · 7 comments · Fixed by #197
Closed

bug: cache lookup fails for modules under symlinked directories #233

swsnr opened this issue Dec 29, 2022 · 7 comments · Fixed by #197

Comments

@swsnr
Copy link

swsnr commented Dec 29, 2022

Following up on #220, I think cache lookup fails for modules under symlinked directories.


Anyway, I've just being doing env XDG_CONFIG_HOME=pwd nvim, and it indeed fixed the issue. It also works, if I copy the nvim/lua/swsnr to ~/.config/nvim/lua/swsnr.

However, my install script uses symlinks instead, i.e. symlinks the nvim/lua/swsnr subdirectory to ~/.config/nvim/lua/swsnr.

And when I do that, things start to fall apart, and I see the above error message again, and a bit of print debugging indicates, that lazy fails to find my swsnr.plugins modules in its cache.

So I tend to believe that there's some path normalization going wrong in lazy.

Originally posted by @swsnr in #220 (comment)

@folke
Copy link
Owner

folke commented Dec 29, 2022

Fixed! :)

@swsnr
Copy link
Author

swsnr commented Dec 29, 2022

😲 🎉 ❤️ You're… fast 😅 👏🏿

Thanks a lot for your help and your support, and for lazy itself!

@AnoRebel
Copy link

@folke
Hi, I think I have a somewhat similar issue as this one. I tried debugging on my own but I cant seem to find the issue.
So, basically I was switching from Packer, but I'm stuck where even my modules aren't being loaded and the only plugin being loaded is Lazy.
One of the prevalent error being:

Error detected while processing /home/dev/.local/share/anonvim/avim/init.lua:
E5113: Error while calling lua chunk: /home/dev/.local/share/anonvim/avim/init.lua:15: module 'avim.autocmds' not found:
	no field package.preload['avim.autocmds']module avim.autocmds not found
	no file './avim/autocmds.lua'
	no file '/usr/share/luajit-2.1.0-beta3/avim/autocmds.lua'
	no file '/usr/local/share/lua/5.1/avim/autocmds.lua'
	no file '/usr/local/share/lua/5.1/avim/autocmds/init.lua'
	no file '/usr/share/lua/5.1/avim/autocmds.lua'
	no file '/usr/share/lua/5.1/avim/autocmds/init.lua'
	no file './avim/autocmds.so'
	no file '/usr/local/lib/lua/5.1/avim/autocmds.so'
	no file '/usr/lib/lua/5.1/avim/autocmds.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
	no file './avim.so'
	no file '/usr/local/lib/lua/5.1/avim.so'
	no file '/usr/lib/lua/5.1/avim.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	/home/dev/.local/share/anonvim/avim/init.lua:15: in main chunk

I think It's a runtime path thing but I cant seem to figure out how or why as it was working OK with Packer.
Here is my config, I use a custom path like Lunarvim since I was trying to make my own IDE layer.

Sorry in advance if it's something stupid I missed. I didn't open an issue as this looked almost similar.

@folke
Copy link
Owner

folke commented Dec 30, 2022

@AnoRebel you're changing the rtp so you should disable reset rtp for lazy or your changes won't survive

@AnoRebel
Copy link

@AnoRebel you're changing the rtp so you should disable reset rtp for lazy or your changes won't survive

But I think I added most of my custom paths to the rtp lazy options. Does that not help.?
I didn't disable reset since you commented it as improving startuptime.

@folke
Copy link
Owner

folke commented Dec 30, 2022

I have no idea, but that is likely your issue. I'm not going to debug everyone's configs. That's for you

@AnoRebel
Copy link

AnoRebel commented Dec 30, 2022

Okay, I will try and see if it fixes it. Thanks.
Ohw, I understand, that wasn't my intention.

PS: Was finally able to get it to work. It seems I wasn't passing the correct base_dir for my config. A stupid mistake, i know.
Also, I didn't need to set the runtime path to false, I just added my paths and let it reset and it works now. Thanks again. Sorry for the inconvenience.

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.

3 participants