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

Add Windows compatibility #1

Closed
Luxed opened this issue Dec 2, 2019 · 10 comments
Closed

Add Windows compatibility #1

Luxed opened this issue Dec 2, 2019 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@Luxed
Copy link

Luxed commented Dec 2, 2019

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
Copy link
Owner

Olical commented Dec 2, 2019 via email

@Luxed
Copy link
Author

Luxed commented Dec 2, 2019

Actually, I tried some things out:

  • the Makefile isn't compatible with Windows at all (of course), so we would need to add a Windows specific Makefile. That's doable, but then, it also means that we can't have a seemless Windows/Linux user experience.
  • Copying the files works. That's what I'll do for now. I can easily make a quick batch file that fixes the links for me.

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
Copy link
Owner

Olical commented Dec 2, 2019

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:

  • Remove the submodules entirely.
  • Git clone / checkout the required repositories to a git ignored directory at compile time.
  • Copy the required files into the lua directory at compile time.

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 😄

@Olical
Copy link
Owner

Olical commented Dec 2, 2019

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 😄

@Luxed
Copy link
Author

Luxed commented Dec 2, 2019

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 Olical self-assigned this Dec 2, 2019
@Olical Olical added the enhancement New feature or request label Dec 2, 2019
@Olical
Copy link
Owner

Olical commented Dec 2, 2019

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
Copy link
Author

Luxed commented Dec 3, 2019

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
Copy link
Owner

Olical commented Dec 3, 2019 via email

@Luxed
Copy link
Author

Luxed commented Dec 3, 2019

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
Copy link
Owner

Olical commented Dec 3, 2019 via email

@Olical Olical closed this as completed in 29ecdf2 Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants