Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
610 stars 28 forks source link

Add Windows compatibility #1

Closed Luxed closed 4 years ago

Luxed commented 4 years ago

I tried using this for my config today, unfortunately, I see that by default, everything is set up for Linux with the use of symbolic links. This is great for Linux users, but not so great for me as I have to use Windows on my work machine. I also learned that making "links" or "shortcuts" on Windows is made with the "mklink.exe" tool and it only works in "cmd.exe" AND you need to have administrator rights (god I hate Windows). Would there be a simple way to add compatibility for both OSes or should I modify the Makefile to have support for Windows somehow?

Olical commented 4 years ago

Hmm, I don't think it needs to use symlinks... maybe we could get away with copying the whole file? It's just annoying since it'll incur blobs in this repo that aren't required since they're under submodules already. Or maybe Aniseed could copy them from the submodule on startup if they're not found πŸ€”

At a conference right now, I'll have a think! Thanks for raising the issue, I'm sorry you have to use Windows 😬 I'm not a fan, but I'll see what I can do to help!

On Mon, 2 Dec 2019, 03:49 Corentin Brunel, notifications@github.com wrote:

I tried using this for my config today, unfortunately, I see that by default, everything is set up for Linux with the use of symbolic links. This is great for Linux users, but not so great for me as I have to use Windows on my work machine. I also learned that making "links" or "shortcuts" on Windows is made with the "mklink.exe" tool and it only works in "cmd.exe" AND you need to have administrator rights (god I hate Windows). Would there be a simple way to add compatibility for both OSes or should I modify the Makefile to have support for Windows somehow?

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Olical/aniseed/issues/1?email_source=notifications&email_token=AACM6XLX47MA3UGSQBQPOGLQWSAWFA5CNFSM4JTPYV3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5EO36Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACM6XIT7SHTH3OMXWNCYK3QWSAWFANCNFSM4JTPYV3A .

Luxed commented 4 years ago

Actually, I tried some things out:

I can do the Windows integration myself, if you don't use it, you shouldn't have to do it πŸ˜›.

What I think is weird is how you use aniseed as a submodule in your example plugin nvim-local-fennel. That's great, but doesn't that mean that if I have 15 plugins that use Aniseed as a dependency, I will have 15 different versions of Aniseed? Each with their own Fennel and nvim.lua dependencies? I would prefer to have my plugin manager manage Aniseed and nvim.lua itself. And then for Fennel, let the user use his installed version or clone a copy himself? That may be out of scope for this issue, but I'm wondering why you chose to do it this way. I can understand why this would be an issue if plugins use different versions of Aniseed, but is this the best solution?

Olical commented 4 years ago

So with the Makefile part, I don't think that's so bad since that only restricts people from collaborating from Windows. You don't need the Makefile to use Aniseed, only to change and re-compile it. Not great, but not the end of the world?

Glad to hear the copying works! I'll adjust that now, I'm okay with a few stray / duplicated git objects being created if it means better compatibility for others.

With regards to the sub-module: This ensures the correct version is depended on at all times, if I leave it up to the user to depend on it for me (something they have to remember to do!) they then need to keep nvim-local-fennel and Aniseed in sync, breaking changes would be something they would need to deeply understand.

Aniseed and nvim-local-fennel are absolutely tiny repositories so I'm okay with duplicating them a few times, think npm compared to maven. npm duplicates every package every time, even if you have the same version on disk, but avoids a lot of the super annoying errors maven can throw.

Aniseed's repo is about 6mb right now and most of that is made up of the submodules. I'll do this:

This will keep the repo size to an absolute minimum, it'll be smaller than any cached images your browser is storing right now :D (unless they're optimised SVGs I guess...)

Thank you for prompting these thoughts! I'll then go tweak nvim-local-fennel so that it depends on aniseed in a similar way. I still want to keep this kind of version locked dependency though, just to ensure each commit of this repository will always work and doesn't depend on two repos being kept in sync etc. That's a recipe for disaster in my experience.

I hope this addresses most of your thoughts in a good way! if not, fire away and we can chat about it :smile:

Olical commented 4 years ago

Okay, changes are on develop, no more submodules and no more symlinks. The required code is copied into the repo and committed, I think that's an okay thing to do considering it's basically compiled output distributed via git. This ensures every commit of Aniseed will always work since it doesn't depend on any other repos to be downloaded and executed, just how I like my software!

I want these things to continue to work forever given a good sha :smile:

Luxed commented 4 years ago

So with the Makefile part, I don't think that's so bad since that only restricts people from collaborating from Windows. You don't need the Makefile to use Aniseed, only to change and re-compile it. Not great, but not the end of the world?

Agreed. On top of that, once Aniseed works, I can use it to compile itself ^^.

With regards to the sub-module: This ensures the correct version is depended on at all times

To me, this should be the Plugin Manager's job. But dependencies haven't really been a thing in the Vim world as I understand it. Maybe there is an occasion for a Plugin Manager that also does dependency management, but that's another level of (unneeded) complexity.

Copy the required files into the lua directory at compile time.

Are you allowed to distribute copied versions of those files if they don't have the same license or have a more restrictive license?

This will keep the repo size to an absolute minimum, it'll be smaller than any cached images your browser is storing right now :D (unless they're optimised SVGs I guess...)

That's a good point. Vim plugins are usually really small so it doesn't really matter. I just like to keep it to a minimum when possible.

I think I still have a few questions/comments, but I'll test things out with develop before going any further.

Olical commented 4 years ago

Yeah, plugins depending on plugins / libraries (Aniseed is both!) is a kind of undefined scenario within the Vim plugin world. You're very right to point out the licencing, I didn't think of that, I think I'll specify explicit exemptions in the README, that some files are not mine and purely here for distribution. I do mention that some modules are just libraries but now I'll mention that they're copied in, thanks for the prompt.

Let me know how you find develop then I'll push forward with this approach. I would test it myself but I don't even know how I'd run Neovim on my Windows machine 😬 I only use it for gaming.

Luxed commented 4 years ago

Let me know how you find develop then I'll push forward with this approach. I would test it myself but I don't even know how I'd run Neovim on my Windows machine 😬 I only use it for gaming.

I am slowly going away from gaming and more into programming in my free time so I might switch back to Linux with i3 relatively soonℒ️.

I wanted to test the new branch but you copied fennelview.fnl to view.lua instead of taking the compiled lua file πŸ˜›

Olical commented 4 years ago

I can highly recommend Arch + i3, that's what my dotfiles are for, feel free to take anything that looks useful if you do!

Haha thanks for pointing that out, that's what I get for rushing something after a conference while ill :D I'll correct that then we should be good to go.

Luxed commented 4 years ago

I can highly recommend Arch + i3, that's what my dotfiles are for, feel free to take anything that looks useful if you do!

I'll have a look, but I already have an entire set-up that works for Antergos Minimal. I love tinkering with linux and my personnal home server is on Arch too (after some weirdness/old packages with Ubuntu server).

Haha thanks for pointing that out, that's what I get for rushing something after a conference while ill :D I'll correct that then we should be good to go.

You shouldn't have! This wasn't a pressing issue, I'm still new to Lisp and haven't started converting the part of my config that is dedicated to plugins.

@Olical I just tested it by just compiling a single file and it looks like it works! That's good enough for me, thank you very much for all the changes. I'll let you close the issue when you want.

Olical commented 4 years ago

Ah yeah, antergos is great! That and manjaro are really nice Arch installs.

Glad it works now! Yeah, let's close this issue and I'll get it on master soon, glad it works on windows now :D

On Tue, 3 Dec 2019, 13:27 Corentin Brunel, notifications@github.com wrote:

I can highly recommend Arch + i3, that's what my dotfiles are for, feel free to take anything that looks useful if you do!

I'll have a look, but I already have an entire set-up that works for Antergos Minimal. I love tinkering with linux and my personnal home server is on Arch too (after some weirdness/old packages with Ubuntu server).

Haha thanks for pointing that out, that's what I get for rushing something after a conference while ill :D I'll correct that then we should be good to go.

You shouldn't have! This wasn't a pressing issue, I'm still new to Lisp and haven't started converting the part of my config that is dedicated to plugins.

@Olical https://github.com/Olical I just tested it by just compiling a single file and it looks like it works! That's good enough for me, thank you very much for all the changes. I'll let you close the issue when you want.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Olical/aniseed/issues/1?email_source=notifications&email_token=AACM6XMUDOSLS2YOTNZNMILQWZNCTA5CNFSM4JTPYV3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZLVEA#issuecomment-561166992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACM6XJI2XIVHWJS4VPJEA3QWZNCTANCNFSM4JTPYV3A .