pl.path requires LuaFileSystem error
linrongbin16 opened this issue · comments
first thanks to your work so I could do unit test with lua on Neovim.
Here's a CI pipeline I want to do vusted unit tests on Windows, to support Neovim plugin running on Windows: linrongbin16/commons.nvim#148
Here's the action runs: https://github.com/linrongbin16/commons.nvim/actions/runs/7382472681/job/20082321700
![image](https://private-user-images.githubusercontent.com/6496887/293630727-7abd927a-08b0-41e0-8d8d-9a9986ac5208.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAxNjE0NDksIm5iZiI6MTcxMDE2MTE0OSwicGF0aCI6Ii82NDk2ODg3LzI5MzYzMDcyNy03YWJkOTI3YS0wOGIwLTQxZTAtOGQ4ZC05YTk5ODZhYzUyMDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMTFUMTI0NTQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjA5ZDBjZTgwZTA2M2Q0MjkzOTE3MjlhY2RkNTRjNTMxOWI2YTk5NGZkY2JiODdlMDYzNzgxYWNiZjBiZmIyMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.VsG3J5CWaelyxg1-vYtTeYgEd2ernDKuP80UdHKlP7g)
in the CI pipeline, I installed lua-5.1 and luarocks via the hererocks, then install all the vusted dependencies, they all succeed, but vusted failed to run with error:
pre-vimrc command line..script D:\a\commons.nvim\commons.nvim\env\bin/vusted_entry.vim, line 20
Vim(lua):E5108: Error executing lua
...commons.nvim\commons.nvim\env\/share/lua/5.1/pl\path.lua:26: pl.path requires LuaFileSystem
stack traceback: [C]: in function 'error'
...commons.nvim\commons.nvim\env\/share/lua/5.1/pl\path.lua:26: in main chunk [C]: in function 'require'
...s.nvim\commons.nvim\env\/share/lua/5.1/busted\runner.lua:3: in main chunk [C]: in function 'require'
...mons.nvim\commons.nvim\env\/share/lua/5.1/vusted/run.lua:18: in function <...mons.nvim\commons.nvim\env\/share/lua/5.1/vusted/run.lua:1>
[string ":lua"]:10: in main chunk
I'm not sure why that happened, would you please help on that?
Hi! This is LuaFileSystem's limitation.
On Windows, the C runtime used to compile LuaFileSystem must be the same runtime that Lua uses, or some LuaFileSystem functions will not work.
https://lunarmodules.github.io/luafilesystem/manual.html#building
FYI: I use the following workaround.
https://github.com/notomo/action-setup-nvim-lua/blob/cc7bc230b4ed5c9cbb2df9570bb749f560b69001/src/luarocks.js#L57-L65
hi @notomo , really thanks to your reply, I had updated my CI yaml file: https://github.com/linrongbin16/commons.nvim/pull/148/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR63-R85.
It's now:
windows_unit_test:
name: Windows Unit Test
strategy:
matrix:
nvim_version: [stable, nightly, v0.6.0, v0.7.0]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
id: vim
with:
neovim: true
version: ${{ matrix.nvim_version }}
- uses: ilammy/msvc-dev-cmd@v1
- uses: notomo/action-setup-nvim-lua@v1
- run: |
luarocks install busted
luarocks install vusted
vusted --shuffle ./test
It does following steps:
- checkout git repo source code, it's the plugin source code I will test.
- setup 'nvim'.
- setup MSVC (the
cl
) VC++ compiler. - use action-setup-nvim-lua@v1 you mentioned above (I think it's going to install
luarocks
andluajit-2
). - setup
busted
andvusted
, then run the unit tests.
But there's 2 more errors in action runs: https://github.com/linrongbin16/commons.nvim/actions/runs/7383346276/job/20084404068
The Error-1: failed to install luasystem
library.
![image](https://private-user-images.githubusercontent.com/6496887/293647567-9fdda240-0508-4247-aea7-21aea839951f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAxNjE0NTAsIm5iZiI6MTcxMDE2MTE1MCwicGF0aCI6Ii82NDk2ODg3LzI5MzY0NzU2Ny05ZmRkYTI0MC0wNTA4LTQyNDctYWVhNy0yMWFlYTgzOTk1MWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMTFUMTI0NTUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmRkMzkwYjNjODc2ODc2MmRiOTQ0ZjM3OTM4MzM4MGU4ZWVlY2I1N2Q4Zjg0MzkxZWJiNzRmNDA1MzAwOTM4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.-qiuGYD1bEhCmaurQB9dJ6IBwpPwVSMW4gF1E-57L3o)
The Error-2: failed to find vusted
executable.
![image](https://private-user-images.githubusercontent.com/6496887/293647704-6c0f859b-6920-4682-b7f1-e3acd56ddbfd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAxNjE0NTAsIm5iZiI6MTcxMDE2MTE1MCwicGF0aCI6Ii82NDk2ODg3LzI5MzY0NzcwNC02YzBmODU5Yi02OTIwLTQ2ODItYjdmMS1lM2FjZDU2ZGRiZmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMTFUMTI0NTUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmUwYTY3MmE1ZGM3MGRiYjY5MTgzZGQ4NGU2NmIzNjEwZGY5NzE4NmRhOWZlOWZkYjliMzk5OGQ4NzUyODFjYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.qZ5slqE_INlf8umtemTo8q0S22QYFnn4wDQNc63X9rw)
I guess the error rootcause is failed to install luasystem
, would you please help me?
hmm. I reproduced this.
But this is hard to resolve for now.
I'll look into it when I have time.
This may be action-setup-nvim-lua's problem.
hi @notomo , FYI:
cannot remember the exact resource, but I believe I had seem some thing say that, we should compile lua/luajit/luarocks with ilammy/msvc-dev-cmd (the MSVC VC++ compiler, e.g. the cl
binary). Because default mingw/GCC has some issue, that could be the root cause of failure of luasystem
.
There's also hererocks, a python pip package to help install lua/luajit/luarocks on Windows.
There's also a PR PR-14 in gh-actions-luarocks, which is relate to luarocks support in Windows.
cc: @linrongbin16
Released workaround!
https://github.com/notomo/vusted/releases/tag/v2.3.4
It's working here: https://github.com/linrongbin16/commons.nvim/actions/runs/7394420875/job/20115783971!!!