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

How can I help with Windows support? #43

Closed
Nazeehe opened this issue Nov 19, 2021 · 15 comments
Closed

How can I help with Windows support? #43

Nazeehe opened this issue Nov 19, 2021 · 15 comments

Comments

@Nazeehe
Copy link

Nazeehe commented Nov 19, 2021

Hey @Conni2461,

You may remember me when we you helped me with a couple of PRs for telescope a while ago.

Anyway, I am primarily a Windows user and spend a bunch of my time helping fix Windows issues with the nvim ecosystem. I can see that this plugin here requires "extra" work for Windows users that probably is not needed if we just bundle the dll with. Unlike Linux, this dll will work on Windows unchanged as it's very simple. Probably doesn't need to be built on the user's machine.

How can I help? I can see a couple of challenges:

  • How to keep the dll updated as you make changes. I can help here of course by providing a latest. But I can see that as being a problem for scaling. Having said that, it seems that you're not making frequent changes to the code really.
  • How do you/anyone trust that the dll I am producing is safe? I can inject randomness in there. Not sure how to help with that.

Anyway, I am available to help if it's something you need. This plugin seems almost core to Telescope now from a perf point of view. Windows users will probably not use it since compiling it locally requires extra steps. In the meantime, I will see if there's something I can do to help make building it easier?

Thanks!

@Conni2461
Copy link
Member

We should look into a lua script + download from artifacts/release.

Are you still interested in doing that? I would be happy if the installation process becomes easier for Windows users :)

@Conni2461 Conni2461 mentioned this issue Dec 4, 2021
@Leandros
Copy link
Contributor

I can help out as well!

@loshjawrence
Copy link

On Windows if i install make and llvm via chocolatey, i can run make in my fzf native plugin folder however i need to switch gcc to clang and remove both -Werror and -fpic as they will cause issues.
-Werror will complain about deprecations and -fpic doesn't seem to be a thing for clang on when it targets Windows.

the dll gets created but if i try to open nvim and run a telescope find_files it will fail:
image

@Leandros
Copy link
Contributor

@loshjawrence: Which branch did you use? The main branch is lacking dllexports and hence does not work on Windows. Try this branch: https://github.com/Leandros/telescope-fzf-native.nvim/tree/feature/windows_build_support

@LudoPinelli
Copy link

LudoPinelli commented Jan 7, 2022

Hi,
Sorry if the answer is obvious but I'm pretty new to the programmin/git world, so I'll ask.
I tried to install the "windows_build_support" branch of the plugin, but packer tells me that it fails installing it (I checked and double-checked the path I gave to my local clone of course^^).
When I look to AppData/Local/nvim-data/site/pack/packer/start/ there is just an empty "telescope-fzf-native.nvim" directory.

So I tried to go to the local clone of the plugin and launch make, but I obtain this error (sorry it's in french but basically "the specified file can't be found") :

mkdir build
gcc -O3 -Wall -Werror -fpic -std=gnu99 -shared src/fzf.c -o build/libfzf.dll
process_begin: CreateProcess(NULL, gcc -O3 -Wall -Werror -fpic -std=gnu99 -shared src/fzf.c -o build/libfzf.dll, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
make: *** [Makefile:19: build/libfzf.dll] Error 2

which is very strange since the src/fzf.c is there...
Any idea?

@calvinchoy
Copy link

Is using: https://github.com/Leandros/telescope-fzf-native.nvim/tree/feature/windows_build_support still the easiest/recommended way to get fzf-native working in windows? or should I rather build it from source?

@Leandros
Copy link
Contributor

@calvinchoy: It works for me. I'm currently in process of integrating the feedback of this PR into a new PR but in the meanwhile feel free to use it.

@KiLLeRRaT
Copy link

Hi, is there a way to install this and it comes with the binaries precompiled for Windows? E.g. simply pluginstall and voila.

Thanks!

@calvinchoy
Copy link

@KiLLeRRaT, not sure about the binary but I got it working fine by installing the make tool on windows using choco.

@KiLLeRRaT
Copy link

KiLLeRRaT commented Jan 24, 2022 via email

@calvinchoy
Copy link

If you are using power shell you can use chocolatey to install the make tool on windows:

choco install make

After this you can continue the installation as described in this repo. It will now able to find the make command on post install (i.e. do: make when using vim-plug). This will compile the library for usage in windows.

https://community.chocolatey.org/packages/make

@KiLLeRRaT
Copy link

Sorry for the spam, my previous email reply doesn't support Markdown. Here is the solution that worked for me in Windows. Would be awesome to perhaps list this out as steps in the main readme under a Windows heading.

choco install mingw
choco install make

Then in my C:\Users\Username\AppData\Local\nvim\plugged\telescope-fzf-native.nvim directory I just ran:

make

You may not need to do this if you first do the choco installs, and THEN run the :PlugInstall

This produces the binary build/libfzf.dll which is needed.

Close and reload everything, and now it works :)

Cheers,

@lukebakken
Copy link
Contributor

I can confirm that @KiLLeRRaT's instructions in this comment work on Windows 10.

@Conni2461
Copy link
Member

We just merged cmake support with instructions on how to build it with cmake: 2330a7e

This should make windows builds easier. I've just opened a new issue on prebuild binaries provided over CI or a release. I'll then provide a simple lua script that will download the prebuild binaries providing support for everyone without access to a compiler and or build system: #69

I'll close this issue because it was addressed by 2330a7e

Thanks for all people providing input and workarounds here :)

@HermesSantos
Copy link

We just merged cmake support with instructions on how to build it with cmake: 2330a7e

This should make windows builds easier. I've just opened a new issue on prebuild binaries provided over CI or a release. I'll then provide a simple lua script that will download the prebuild binaries providing support for everyone without access to a compiler and or build system: #69

I'll close this issue because it was addressed by 2330a7e

Thanks for all people providing input and workarounds here :)

it worked, thank you so much!

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

No branches or pull requests

9 participants