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

Do not put common DLLs in the same directory as the executable #21209

Closed
friedlinguini opened this issue Nov 27, 2022 · 6 comments · Fixed by #23668
Closed

Do not put common DLLs in the same directory as the executable #21209

friedlinguini opened this issue Nov 27, 2022 · 6 comments · Fixed by #23668
Labels
distribution packaging and distributing Nvim to users enhancement feature request platform:windows
Milestone

Comments

@friedlinguini
Copy link

Feature already in Vim?

No response

Feature description

I recently tried to upgrade Neovim on Windows (via Chocolatey), but the upgrade script was unable to delete some libraries, including libEGL.dll, libGLESv2.dll, and some others. It turned out that these were being kept open by another application.

My guess is that because nvim.exe is in the system path, the other application was trying to use similar libraries (my suspicion is because it was using Qt5), found these libraries on the system path, and held them open. While the other application is the main culprit (I've filed a bug with them as well), keeping local copies of these DLLs in a different directory off the system path is probably wise.

@friedlinguini friedlinguini added the enhancement feature request label Nov 27, 2022
@zeertzjq zeertzjq added the distribution packaging and distributing Nvim to users label Nov 27, 2022
@justinmk
Copy link
Member

justinmk commented Jan 9, 2023

keeping local copies of these DLLs in a different directory off the system path is probably wise.

is this a change we need to make in our MSI / WIX installer ? @3N4N

@justinmk justinmk added this to the backlog milestone Jan 9, 2023
@3N4N
Copy link
Contributor

3N4N commented Jan 9, 2023

keeping local copies of these DLLs in a different directory off the system path is probably wise.

is this a change we need to make in our MSI / WIX installer ?

I don't know. I'll see if I can find the answer. On a related note, there is an open ticket #14552 for possibly removing nvim-qt. If that's done, neovim won't need these DLLs (they're all dependencies of nvim-qt), making this current ticket unnecessary.

@justinmk justinmk modified the milestones: backlog, unplanned Jan 9, 2023
@3N4N
Copy link
Contributor

3N4N commented May 9, 2023

keeping local copies of these DLLs in a different directory off the system path is probably wise.

is this a change we need to make in our MSI / WIX installer ?

I forgot to check back in. My findings can be summarized as this: if the DLLs are not in the same folder as nvim.exe or in the $PATH, then nvim won't be able to find those DLLs either. I may be wrong; read and experiment this doc for more confidence.

In short: the issue cannot be fixed in the way the ticket title suggests. Other ways may be effective (e.g., not putting nvim's bin folder in $PATH), but that's more of a how-to-use-Windows question than a how-to-use-neovim question.

I think we can close this.

@friedlinguini
Copy link
Author

You can't LoadLibrary the relevant DLLs? Or link the libraries to nvim-qt.exe statically?

IIRC, the Chocolatey installer is what put nvim.exe on the path, so implying that I'm using Windows wrong by following the installer directions on the neovim site is a bit disingenuous. Given that nvim.exe is a console application, saying that it shouldn't be on the path makes it difficult to use it as such anyway.

@3N4N
Copy link
Contributor

3N4N commented May 10, 2023

First let's get the interpersonal point out of the way, I didn't mean to imply you're using Windows wrong. I realize my wording was suspect, but look at it this way: there is no right way to use Windows. It's all crap all around, every way you use it.

You can't LoadLibrary the relevant DLLs? Or link the libraries to nvim-qt.exe statically?

(First, nvim-qt is a separate project, created and maintained separately, but other than this--) That can possibly be done. If you are familiar with DLLs (I'm not; I have a Windows computer but my programming laptop runs Ubuntu), you could propose a concrete solution and make a PR.

But before that, could you share some literature (blogs, etc.) discussing software that keeps their DLLs in separate folder? All of the third-party apps I use (e.g., nomacs) keep their required DLLs in the same folder the binary is in, like neovim.

Given that nvim.exe is a console application, saying that it shouldn't be on the path makes it difficult to use it as such anyway.

I use shimming. I don't use chocolatey so I can't speak for that, but its alternative, Scoop, uses this concept. The concept is: you keep one directory for keeping binaries and you put that directory in $PATH. If I want to use nvim, instead of putting C:\PROGRA~2\nvim\bin in $PATH, I put a shim of it in my dedicated bin directory (e.g., C:\bin). When run, the shim will in turn run the binary it points to and relay it the commandline arguments. Not saying it's the "right" way, but there is a reason this concept exists for Windows uniquely. Because Windows is not like other girls OS's.

@justinmk
Copy link
Member

justinmk commented Jun 5, 2023

but the upgrade script was unable to delete some libraries, including libEGL.dll, libGLESv2.dll, and some others

This may be mitigated now since we will no longer will ship neovim-qt and its DLLs. #23668

dundargoc added a commit to dundargoc/neovim that referenced this issue Jun 6, 2023
Neovim QT was originally bundled on Windows as a response to the then
lackluster terminal options. The situation has dramatically changed,
with viable options such as Windows terminal, Alacritty and Wezterm to
name a few. The Windows build no longer needs this special treatment for
neovim to be usable.

Closes neovim#21209.
dundargoc added a commit to dundargoc/neovim that referenced this issue Jun 6, 2023
Neovim QT was originally bundled on Windows as a response to the then
lackluster terminal options. The situation has dramatically changed,
with viable options such as Windows terminal, Alacritty and Wezterm to
name a few. The Windows build no longer needs this special treatment for
neovim to be usable.

Pros:
  - Release builds will be smaller.
  - Less maintenance burden.
  - Clearer separation of responsibility (neovim issues go to the neovim
    repo and neovim-qt issues to the neovim-qt repo).
  - More consistent treatment between platforms.

Cons:
  - Users who've come to expect neovim-qt to be bundled with nvim will
    need to adjust and download neovim-qt from
    https://github.com/equalsraf/neovim-qt instead.
  - Similarly, build scripts will need to be adjusted to reflect this
    change.

Closes neovim#21209.
dundargoc added a commit that referenced this issue Jun 6, 2023
Neovim QT was originally bundled on Windows as a response to the then
lackluster terminal options. The situation has dramatically changed,
with viable options such as Windows terminal, Alacritty and Wezterm to
name a few. The Windows build no longer needs this special treatment for
neovim to be usable.

Pros:
  - Release builds will be smaller.
  - Less maintenance burden.
  - Clearer separation of responsibility (neovim issues go to the neovim
    repo and neovim-qt issues to the neovim-qt repo).
  - More consistent treatment between platforms.

Cons:
  - Users who've come to expect neovim-qt to be bundled with nvim will
    need to adjust and download neovim-qt from
    https://github.com/equalsraf/neovim-qt instead.
  - Similarly, build scripts will need to be adjusted to reflect this
    change.

Closes #21209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distribution packaging and distributing Nvim to users enhancement feature request platform:windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants