Skip to content

Commit

Permalink
chore: debug segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Mar 25, 2024
1 parent d0e55b2 commit 2e2ff1c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
41 changes: 38 additions & 3 deletions .github/resources/init-windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,41 @@ local luarocks_cpath = {
}
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")

vim.opt.runtimepath:append(
vim.fs.joinpath(vim.g.rocks_nvim.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*")
)
local log = require("rocks.log")
log.trace("loading nio")
local nio = require("nio")
log.trace("loading rocks.adapter")
local adapter = require("rocks.adapter")
log.trace("loading rocks config")
local config = require("rocks.config.internal")

-- Set up the Rocks user command
require("rocks.commands").create_commands()

local env_path_seperator = vim.uv.os_uname().sysname:lower():find("windows") and ";" or ":"

-- Append the binary directory to the system path.
log.trace("Appending luarocks binary directory to the system path")
vim.env.PATH = vim.fs.joinpath(config.rocks_path, "bin") .. env_path_seperator .. vim.env.PATH

if not config.lazy then
log.trace("Populating caches")
nio.run(function()
local cache = require("rocks.cache")
nio.gather({
cache.populate_cached_rocks,
cache.populate_removable_rock_cache,
})
end)
end

adapter.init()

--- We don't want to run this async, to ensure proper initialisation order
local user_rocks = config.get_user_rocks()
require("rocks.api.hooks").run_preload_hooks(user_rocks)
require("rocks.runtime").source_start_plugins(user_rocks)

-- vim.opt.runtimepath:append(
-- vim.fs.joinpath(vim.g.rocks_nvim.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*")
-- )
3 changes: 1 addition & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
mkdir rocks
luarocks --tree rocks --lua-version 5.1 --server='https://nvim-neorocks.github.io/rocks-binaries/' install rocks.nvim
- name: Run neovim with rocks.nvim
shell: bash
run: |
nvim -u .github/resources/init-windows.lua -c "lua io.write(require('rocks.config.internal').config_path)" +q 2>&1
nvim -u .github/resources/init-windows.lua -c "lua print(vim.uv.os_uname().sysname:lower())" +q
cat rocks/rocks.log
1 change: 0 additions & 1 deletion plugin/rocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ end
local log = require("rocks.log")
log.trace("loading nio")
local nio = require("nio")
error("NIO LOADED")
log.trace("loading rocks.adapter")
local adapter = require("rocks.adapter")
log.trace("loading rocks config")
Expand Down

0 comments on commit 2e2ff1c

Please sign in to comment.