Open kostya9 opened 1 week ago
Interesting. I'm not a Windows user so this would be hard for me to debug, as you've already determined there's something going wrong here:
local file_path = u.current_file_path()
local parent_dir = vim.fn.fnamemodify(file_path, ":h:h:h:h")
state.settings.bin_path = parent_dir
state.settings.bin = parent_dir .. (u.is_windows() and "\\bin.exe" or "/bin")
if not override then
local binary_exists = vim.loop.fs_stat(state.settings.bin)
if binary_exists ~= nil then
return
end
end
local cmd = u.is_windows() and "cd %s\\cmd && go build -o bin.exe && move bin.exe ..\\"
or "cd %s/cmd && go build -o bin && mv bin ../bin"
local command = string.format(cmd, state.settings.bin_path)
local null = u.is_windows() and " >NUL" or " > /dev/null"
-- If you add this line we can see the command that's actually being run
print(command .. null)
local installCode = os.execute(command .. null)
if installCode ~= 0 then
u.notify("Could not install gitlab.nvim!", vim.log.levels.ERROR)
return false
end
u.notify("Gitlab.nvim installed successfully!", vim.log.levels.INFO)
return true
To debug this, I'd probably want to know the exact command the plugin is trying to run. You can see that if you change into the plugin directory and edit that function in lua/gitlab/server.lua
to add a print before the command is actually executed.
To find the source code for this plugin, run the following ex command to see where the plugins are on your system. Then change into your Lazy directory, and into the Gitlab directory:
:lua=vim.fn.stdpath("data") # And then switch into lazy, gitlab.nvim...
This is something to do with your setup, if you're able to post more information about the command that's actually running and further debug that Lua file, that'd be great.
With an EC2 instance running Windows and with the basic requirements needed for this plugin (Lazy, Neovim, Go, and the bare bones configuration from the Readme), the plugin created and moved the bin.exe
in the correct location and everything worked as expected for me.
Prerequsities
:h gitlab.nvim.troubleshooting
and followed the steps thereSetup Configuration and Environment
OS: Windows
Bug Description
When installing the plugin, it does not build the server binary. At the same time, building manually via
go build -o bin.exe
works (running in gitlab.nvim/cmd directory).My hypothesis: it tries to build the binary in the wrong directory.
Reproduction Steps
Screenshots