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

fix(jsregexp): fix install_jsregexp on Windows #1252

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

xudyang1
Copy link
Contributor

@xudyang1 xudyang1 commented Nov 10, 2024

Users on Windows may install neovim by many means:

  1. scoop install neovim: which nvim shows ~/scoop/shims/nvim
  2. winget install neovim or manually download Windows installer and set env: which nvim shows C:/Program Files/Neovim/bin/nvim

Either way, we can use lua51.dll in the original nvim directory ($(scoop prefix neovim)/bin or C:/Program Files/Neovim/bin/)

Care must be taken when path contains spaces. Quotes are needed to let gcc understand -L"C:/Program Files/..." such directories.

Note

Users may also need to set:
SHELL=C:/path/to/Git/usr/bin/sh.exe # if git sh.exe is not in PATH
.SHELLFLAGS=-c # if git sh.exe is not in PATH
CC=gcc # if default cc is not set to any compiler
NEOVIM_BIN_PATH=C:/path/to/Neovim/bin # if Neovim/bin is not detected by the Makefile

Related: #759 #986 #1130 #1190 #1220

@xudyang1
Copy link
Contributor Author

Failed with

-------- Global test environment teardown.
======== 422 tests from 32 test files ran. (26669.85 ms total)
PASSED   421 tests.
FAILED   1 test, listed below:
FAILED   ../../../tests/integration/loaders_spec.lua @ 862: loaders: lazy registration works for vscode (packages).
../../../tests/integration/loaders_spec.lua:909: Row 2 did not match.
Expected:
  |{"snip": {"prefix": "asdf", "body": ["qwer"]}}    |
  |*qwer^                                              |
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{2:-- INSERT --}                                      |
Actual:
  |{"snip": {"prefix": "asdf", "body": ["qwer"]}}    |
  |*asdf^                                              |
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{2:-- INSERT --}                                      |

To print the expect() call that would assert the current screen state, use
screen:snapshot_util(). In case of non-deterministic failures, use
screen:redraw_debug() to show all intermediate screen states.  

stack traceback:
	test/functional/ui/screen.lua:622: in function '_wait'
	test/functional/ui/screen.lua:352: in function 'expect'
	../../../tests/integration/loaders_spec.lua:909: in function <../../../tests/integration/loaders_spec.lua:862>


 1 FAILED TEST
------------------------------------------------------------------------------
$NVIM_LOG_FILE: /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/build/.nvimlog
(empty)
------------------------------------------------------------------------------
-- Tests exited non-zero: Segmentation fault
CMake Error at /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/cmake/RunTests.cmake:101 (message):
  functional tests failed with error: Segmentation fault


-- No output to stderr.
FAILED: test/CMakeFiles/functionaltest /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/build/test/CMakeFiles/functionaltest 
cd /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/build/test && /usr/local/bin/cmake -D BUSTED_PRG=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/.deps/usr/bin/busted -D NVIM_PRG=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/build/bin/nvim -D WORKING_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9 -D BUSTED_OUTPUT_TYPE=nvim -D TEST_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/test -D BUILD_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/build -D DEPS_PREFIX=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/.deps/usr -D TEST_TYPE=functional -D CIRRUS_CI= -D CI_BUILD=ON -P /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9/cmake/RunTests.cmake
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:135: functionaltest] Error 1
make[1]: Leaving directory '/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_0.9'
make: *** [Makefile:104: test] Error 2
Error: Process completed with exit code 2.

@xudyang1
Copy link
Contributor Author

I am not sure if the failing test was due to timeout or snippet file not being saved before running the test case. Those failed snippets work on my local machine.

@xudyang1
Copy link
Contributor Author

-------- Global test environment teardown.
======== 422 tests from 32 test files ran. (39879.00 ms total)
PASSED   417 tests.
FAILED   2 tests, listed below:
FAILED   ../../../tests/integration/session_spec.lua @ 1468: session All operations work as expected in a longer session.
../../../tests/integration/session_spec.lua:1857: Row 2 did not match.
Expected:
  |/**                                               |
  |* * A /**                                          |
  |*  * A short Description                           |
  |*  */                                              |
  |* ^public void myFunc() { {4:●}                         |
  |*                                                  |
  |* }short Description                               |
  | /**                                              |
  |  * A short Description                           |
  |  */                                              |
  | public void myFunc() {                           |
  |                                                  |
  | }*/                                              |
  |public void myFunc() {                            |
  |                                                  |
  |}                                                 |
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |*{2:-- INSERT --}                                      |
Actual:
  |/**                                               |
  |* * ^A{3: /**}                                          |
  |*{3:  * A short Description}                           |
  |*{3:  */}                                              |
  |*{3: public void myFunc() {} {4:●}                         |
  |*{3:        }                                          |
  |*{3: }short Description}                               |
  | /**                                              |
  |  * A short Description                           |
  |  */                                              |
  | public void myFunc() {                           |
  |                                                  |
  | }*/                                              |
  |public void myFunc() {                            |
  |                                                  |
  |}                                                 |
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |{0:~                                                 }|
  |*{2:-- SELECT --}                                      |
To print the expect() call that would assert the current screen state, use
screen:snapshot_util(). In case of non-deterministic failures, use
screen:redraw_debug() to show all intermediate screen states.
Snapshot:
screen:expect({
  grid = [[
    /**                                               |
     * ^A{3: /**}                                          |
    {3:  * A short Description}                           |
    {3:  */}                                              |
    {3: public void myFunc() {} {4:●}                         |
    {3:        }                                          |
    {3: }short Description}                               |
     /**                                              |
      * A short Description                           |
      */                                              |
     public void myFunc() {                           |
                                                      |
     }*/                                              |
    public void myFunc() {                            |
                                                      |
    }                                                 |
    {0:~                                                 }|*13
    {2:-- SELECT --}                                      |
  ]]
})
stack traceback:
	test/functional/ui/screen.lua:851: in function '_wait'
	test/functional/ui/screen.lua:527: in function 'expect'
	../../../tests/integration/session_spec.lua:1857: in function <../../../tests/integration/session_spec.lua:1468>
FAILED   ../../../tests/integration/source_spec.lua @ 61: loaders: vscode: error-message when parser not installed.
../../../tests/integration/source_spec.lua:85: Row 8 did not match.
Expected:
  |^{                                                 |
  |        "snip1": {                                |
  |                "prefix": "all1",                 |
  |                "body": [                         |
  |                        "expands? jumps? $1 $2 !" |
  |                ]                                 |
  |        },                                        |
  |*Could not determine ran...help treesitter-parsers |
Actual:
  |^{                                                 |
  |        "snip1": {                                |
  |                "prefix": "all1",                 |
  |                "body": [                         |
  |                        "expands? jumps? $1 $2 !" |
  |                ]                                 |
  |        },                                        |
  |*Could not determine ran...r 2 and language "json" |
To print the expect() call that would assert the current screen state, use
screen:snapshot_util(). In case of non-deterministic failures, use
screen:redraw_debug() to show all intermediate screen states.
Snapshot:
screen:expect({
  grid = [[
    ^{                                                 |
            "snip1": {                                |
                    "prefix": "all1",                 |
                    "body": [                         |
                            "expands? jumps? $1 $2 !" |
                    ]                                 |
            },                                        |
    Could not determine ran...r 2 and language "json" |
  ]]
})
stack traceback:
	test/functional/ui/screen.lua:851: in function '_wait'
	test/functional/ui/screen.lua:527: in function 'expect'
	../../../tests/integration/source_spec.lua:85: in function <../../../tests/integration/source_spec.lua:61>
ERROR    3 errors, listed below:
ERROR    ../../../tests/integration/treesitter_postfix_spec.lua @ 27: treesitter-postfix Default-case works ["live"]
test/functional/testnvim.lua:126: Error executing lua: .../work/LuaSnip/LuaSnip/lua/luasnip/extras/_treesitter.lua:333: attempt to call method 'range' (a nil value)
stack traceback:
	.../work/LuaSnip/LuaSnip/lua/luasnip/extras/_treesitter.lua:333: in function 'match_tsnode'
	...uaSnip/LuaSnip/lua/luasnip/extras/treesitter_postfix.lua:155: in function 'real_resolver'
	...uaSnip/LuaSnip/lua/luasnip/extras/treesitter_postfix.lua:111: in function 'user_resolve'
	...unner/work/LuaSnip/LuaSnip/lua/luasnip/nodes/snippet.lua:38: in function 'resolveExpandParams'
	...unner/work/LuaSnip/LuaSnip/lua/luasnip/nodes/snippet.lua:814: in function 'matches'
	.../LuaSnip/lua/luasnip/session/snippet_collection/init.lua:158: in function 'match_snippet'
	/home/runner/work/LuaSnip/LuaSnip/lua/luasnip/init.lua:334: in function 'expand'
	[string "<nvim>"]:1: in main chunk
stack traceback:
	test/functional/testnvim.lua:126: in function 'exec_lua'
	../../../tests/integration/treesitter_postfix_spec.lua:92: in function <../../../tests/integration/treesitter_postfix_spec.lua:27>
ERROR    ../../../tests/integration/treesitter_postfix_spec.lua @ 27: treesitter-postfix Default-case works ["copy"]
test/functional/testnvim.lua:126: Error executing lua: .../work/LuaSnip/LuaSnip/lua/luasnip/extras/_treesitter.lua:333: attempt to call method 'range' (a nil value)
stack traceback:
	.../work/LuaSnip/LuaSnip/lua/luasnip/extras/_treesitter.lua:333: in function 'match_tsnode'
	...uaSnip/LuaSnip/lua/luasnip/extras/treesitter_postfix.lua:155: in function 'real_resolver'
	...uaSnip/LuaSnip/lua/luasnip/extras/treesitter_postfix.lua:111: in function 'user_resolve'
	...unner/work/LuaSnip/LuaSnip/lua/luasnip/nodes/snippet.lua:38: in function 'resolveExpandParams'
	...unner/work/LuaSnip/LuaSnip/lua/luasnip/nodes/snippet.lua:814: in function 'matches'
	.../LuaSnip/lua/luasnip/session/snippet_collection/init.lua:158: in function 'match_snippet'
	/home/runner/work/LuaSnip/LuaSnip/lua/luasnip/init.lua:334: in function 'expand'
	[string "<nvim>"]:1: in main chunk
stack traceback:
	test/functional/testnvim.lua:126: in function 'exec_lua'
	../../../tests/integration/treesitter_postfix_spec.lua:92: in function <../../../tests/integration/treesitter_postfix_spec.lua:27>
ERROR    ../../../tests/integration/treesitter_postfix_spec.lua @ 27: treesitter-postfix Default-case works [nil]
test/functional/testnvim.lua:126: Error executing lua: .../work/LuaSnip/LuaSnip/lua/luasnip/extras/_treesitter.lua:333: attempt to call method 'range' (a nil value)
stack traceback:
	.../work/LuaSnip/LuaSnip/lua/luasnip/extras/_treesitter.lua:333: in function 'match_tsnode'
	...uaSnip/LuaSnip/lua/luasnip/extras/treesitter_postfix.lua:155: in function 'real_resolver'
	...uaSnip/LuaSnip/lua/luasnip/extras/treesitter_postfix.lua:111: in function 'user_resolve'
	...unner/work/LuaSnip/LuaSnip/lua/luasnip/nodes/snippet.lua:38: in function 'resolveExpandParams'
	...unner/work/LuaSnip/LuaSnip/lua/luasnip/nodes/snippet.lua:814: in function 'matches'
	.../LuaSnip/lua/luasnip/session/snippet_collection/init.lua:158: in function 'match_snippet'
	/home/runner/work/LuaSnip/LuaSnip/lua/luasnip/init.lua:334: in function 'expand'
	[string "<nvim>"]:1: in main chunk
stack traceback:
	test/functional/testnvim.lua:126: in function 'exec_lua'
	../../../tests/integration/treesitter_postfix_spec.lua:92: in function <../../../tests/integration/treesitter_postfix_spec.lua:27>
 2 FAILED TESTS
 3 ERRORS
------------------------------------------------------------------------------
$NVIM_LOG_FILE: /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/.nvimlog
(last 100 lines)
DBG 2024-11-10T19:24:25.822 nvim.41508.0 log_request:46: RPC <- 1: [request]   id=1: nvim_exec_lua
DBG 2024-11-10T19:24:25.822 nvim.41508.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.822 nvim.41508.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.822 nvim.41508.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.823 nvim.41508.0 log_response:51: RPC -> 1: [response]  id=1
DBG 2024-11-10T19:24:25.823 nvim.41508.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.823 nvim.41508.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.823 nvim.41508.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.823 nvim.41508.0 receive_msgpack:206: ch 1: parsing 210 bytes from msgpack Stream: 0x5634c4183540
DBG 2024-11-10T19:24:25.823 nvim.41508.0 log_request:46: RPC <- 1: [request]   id=2: nvim_exec_lua
DBG 2024-11-10T19:24:25.823 nvim.41508.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.823 nvim.41508.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.823 nvim.41508.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.823 nvim.41508.0 log_response:51: RPC -> 1: [response]  id=2
DBG 2024-11-10T19:24:25.823 nvim.41508.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.823 nvim.41508.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.823 nvim.41508.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.824 nvim.41508.0 receive_msgpack:206: ch 1: parsing 194 bytes from msgpack Stream: 0x5634c4183540
DBG 2024-11-10T19:24:25.824 nvim.41508.0 log_request:46: RPC <- 1: [request]   id=3: nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.824 nvim.41508.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 log_response:51: RPC -> 1: [response]  id=3
DBG 2024-11-10T19:24:25.824 nvim.41508.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.824 nvim.41508.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.824 nvim.41508.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.824 nvim.41508.0 receive_msgpack:206: ch 1: parsing 199 bytes from msgpack Stream: 0x5634c4183540
DBG 2024-11-10T19:24:25.824 nvim.41508.0 log_request:46: RPC <- 1: [request]   id=4: nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.824 nvim.41508.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 log_response:51: RPC -> 1: [response]  id=4
DBG 2024-11-10T19:24:25.824 nvim.41508.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.824 nvim.41508.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.824 nvim.41508.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.824 nvim.41508.0 receive_msgpack:206: ch 1: parsing 201 bytes from msgpack Stream: 0x5634c4183540
DBG 2024-11-10T19:24:25.824 nvim.41508.0 log_request:46: RPC <- 1: [request]   id=5: nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.824 nvim.41508.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.824 nvim.41508.0 log_response:51: RPC -> 1: [response]  id=5
DBG 2024-11-10T19:24:25.824 nvim.41508.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.824 nvim.41508.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.825 nvim.41508.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.826 nvim.41508.0 read_cb:121: closing Stream (0x5634c4183540): EOF (end of file)
DBG 2024-11-10T19:24:25.826 nvim.41508.0 receive_msgpack:206: ch 1: parsing 0 bytes from msgpack Stream: 0x5634c4183540
DBG 2024-11-10T19:24:25.826 nvim.41508.0 stream_may_close:107: closing Stream: 0x5634c4183540
DBG 2024-11-10T19:24:25.826 nvim.41508.0 stream_may_close:107: closing Stream: 0x5634c41836f8
INF 2024-11-10T19:24:25.826 nvim.41508.0 chan_close_with_error:508: RPC: ch 1 was closed by the client
INF 2024-11-10T19:24:25.826 nvim.41508.0 os_exit:693: Nvim exit: 1
DBG 2024-11-10T19:24:25.829 ?.41509    rpc_start:90: rpc ch 1 in-stream=0x55872688d6f8 out-stream=0x55872688d540
INF 2024-11-10T19:24:25.829 nvim.41509.0 set_init_2:595: startup runtimepath/packpath value: /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/Xtest_xdg/config/nvim,/etc/xdg/nvim,/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/Xtest_xdg/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/runtime,/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/Xtest_xdg/share/nvim/site/after,/etc/xdg/nvim/after,/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/Xtest_xdg/config/nvim/after
DBG 2024-11-10T19:24:25.832 nvim.41509.0 receive_msgpack:206: ch 1: parsing 60 bytes from msgpack Stream: 0x55872688d540
DBG 2024-11-10T19:24:25.832 nvim.41509.0 log_request:46: RPC <- 1: [request]   id=0: nvim_exec2
DBG 2024-11-10T19:24:25.832 nvim.41509.0 handle_request:346: RPC: scheduled nvim_exec2
INF 2024-11-10T19:24:25.832 nvim.41509.0 main:657: starting main loop
DBG 2024-11-10T19:24:25.832 nvim.41509.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.832 nvim.41509.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.832 nvim.41509.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.832 nvim.41509.0 handle_nvim_exec2:9583: RPC: ch 1: invoke nvim_exec2
DBG 2024-11-10T19:24:25.832 nvim.41509.0 log_response:51: RPC -> 1: [response]  id=0
DBG 2024-11-10T19:24:25.832 nvim.41509.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.832 nvim.41509.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.832 nvim.41509.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.833 nvim.41509.0 receive_msgpack:206: ch 1: parsing 74 bytes from msgpack Stream: 0x55872688d540
DBG 2024-11-10T19:24:25.833 nvim.41509.0 log_request:46: RPC <- 1: [request]   id=1: nvim_exec_lua
DBG 2024-11-10T19:24:25.833 nvim.41509.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.833 nvim.41509.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.833 nvim.41509.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.833 nvim.41509.0 log_response:51: RPC -> 1: [response]  id=1
DBG 2024-11-10T19:24:25.833 nvim.41509.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.833 nvim.41509.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.833 nvim.41509.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.834 nvim.41509.0 receive_msgpack:206: ch 1: parsing 77 bytes from msgpack Stream: 0x55872688d540
DBG 2024-11-10T19:24:25.834 nvim.41509.0 log_request:46: RPC <- 1: [request]   id=2: nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.834 nvim.41509.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 log_response:51: RPC -> 1: [response]  id=2
DBG 2024-11-10T19:24:25.834 nvim.41509.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.834 nvim.41509.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.834 nvim.41509.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.834 nvim.41509.0 receive_msgpack:206: ch 1: parsing 78 bytes from msgpack Stream: 0x55872688d540
DBG 2024-11-10T19:24:25.834 nvim.41509.0 log_request:46: RPC <- 1: [request]   id=3: nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.834 nvim.41509.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 log_response:51: RPC -> 1: [response]  id=3
DBG 2024-11-10T19:24:25.834 nvim.41509.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.834 nvim.41509.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.834 nvim.41509.0 inbuf_poll:512: blocking... events=true
DBG 2024-11-10T19:24:25.834 nvim.41509.0 receive_msgpack:206: ch 1: parsing 79 bytes from msgpack Stream: 0x55872688d540
DBG 2024-11-10T19:24:25.834 nvim.41509.0 log_request:46: RPC <- 1: [request]   id=4: nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 handle_request:346: RPC: scheduled nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 state_enter:99: input: K_EVENT
DBG 2024-11-10T19:24:25.834 nvim.41509.0 handle_nvim_exec_lua:7203: RPC: ch 1: invoke nvim_exec_lua
DBG 2024-11-10T19:24:25.834 nvim.41509.0 log_response:51: RPC -> 1: [response]  id=4
DBG 2024-11-10T19:24:25.834 nvim.41509.0 may_trigger_safestate:301: SafeState: Start triggering
DBG 2024-11-10T19:24:25.835 nvim.41509.0 inbuf_poll:512: blocking... events=false
DBG 2024-11-10T19:24:25.835 nvim.41509.0 inbuf_poll:512: blocking... events=true
------------------------------------------------------------------------------
CMake Error at /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/cmake/RunTests.cmake:103 (message):
  functional tests failed with error: 1
make[1]: *** [Makefile:132: functionaltest] Error 1
make: *** [Makefile:98: test] Error 2
-- Tests exited non-zero: 1
-- Output to stderr:
E5113: Error while calling lua chunk: 
FAILED: test/CMakeFiles/functionaltest /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/test/CMakeFiles/functionaltest 
cd /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/test && /usr/local/bin/cmake -D TEST_TYPE=functional -D BUILD_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build -D CIRRUS_CI= -D CI_BUILD=OFF -D DEPS_INSTALL_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/usr -D NVIM_PRG=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/build/bin/nvim -D TEST_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/test -D WORKING_DIR=/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master -P /home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master/cmake/RunTests.cmake
ninja: build stopped: subcommand failed.
make[1]: Leaving directory '/home/runner/work/LuaSnip/LuaSnip/deps/nvim_multiversion/worktree_master'
Error: Process completed with exit code 2.

@L3MON4D3
Copy link
Owner

Hey, thanks for this PR, I don't have Windows currently, so that's a great help :)
The failing tests should be largely fixed by commits to luasnip-master that are missing in your branch, could you rebase?

@xudyang1 xudyang1 mentioned this pull request Nov 10, 2024
@xudyang1
Copy link
Contributor Author

Hey, thanks for this PR, I don't have Windows currently, so that's a great help :) The failing tests should be largely fixed by commits to luasnip-master that are missing in your branch, could you rebase?

Oh, I forgot that my origin master was too old. Thanks for pointing that out.

@xudyang1 xudyang1 force-pushed the fix/jsregexp branch 2 times, most recently from 2edd3b9 to e3350be Compare November 10, 2024 23:41
@xudyang1
Copy link
Contributor Author

xudyang1 commented Nov 11, 2024

@L3MON4D3 tests passed after rebasing.

Makefile Outdated Show resolved Hide resolved
@L3MON4D3
Copy link
Owner

These changes look really good (shell pwd -> $(PROJECT_ROOT) 👌), and TY for mentioning the necessary steps for windows-users in the README 👌

If you could satisfy my curiosity regarding the && false (just so I understand that quirk :D), I'll be happy to merge :)

@xudyang1
Copy link
Contributor Author

These changes look really good (shell pwd -> $(PROJECT_ROOT) 👌), and TY for mentioning the necessary steps for windows-users in the README 👌

If you could satisfy my curiosity regarding the && false (just so I understand that quirk :D), I'll be happy to merge :)

I took the && false trick from a stackoverflow comment. I also encountered empty outputs from LUASNIP_DETECTED_OS?=$(shell uname) and PROJECT_ROOT:=$(shell pwd). Running make outputs:

process_begin: CreateProcess(NULL, uname, ...) failed.
Makefile:45: pipe: Bad file descriptor
...

Initially, I thought this is a make's bug on non-bash shells (powershell fails, but git bash works). I also tested with $(shell uname 2>/dev/null), which works on both like the trick.

I believe it's better to use 2>/dev/null to redirect stderr, which also outputs $(shell command) successfully.

@L3MON4D3
Copy link
Owner

Ahh gotcha, I didn't catch that these are supposed to catch specific errors, your explaination helped :)
Thank you for the contribution, I hope this fixes the windows-build for good

@KevinNitroG
Copy link

KevinNitroG commented Dec 4, 2024

@xudyang1 I don't know why my windows machine still builds fail. I installed neovim and make by scoop. Here's the building log from Lazy.

make: *** No rule to make target 'install_jsregexp'.  Stop.

My Lazy config

{
  "L3MON4D3/LuaSnip",
  dependencies = "rafamadriz/friendly-snippets",
  build = vim.g.os == "Windows" and "make install_jsregexp CC=gcc.exe SHELL=sh.exe .SHELLFLAGS=-c"
    or "make install_jsregexp",
}

@KevinNitroG
Copy link

LazyNvim support luarocks and jsregexp is installed via luarocks. I guess we can config like this (just guessing...)

{
  "L3MON4D3/LuaSnip",
  dependencies = {
    "rafamadriz/friendly-snippets",
    "kmarius/jsregexp",
  },
}

@mez0ru
Copy link

mez0ru commented Dec 16, 2024

@KevinNitroG It did not work for me, LuaSnip still complains that jsregexp is not installed, even though lazy installed jsregexp successfully.

@KevinNitroG
Copy link

@KevinNitroG It did not work for me, LuaSnip still complains that jsregexp is not installed, even though lazy installed jsregexp successfully.

I don't know how to check have LuaSnip recognized jsregexp installed... How can we do that?

@mez0ru
Copy link

mez0ru commented Dec 16, 2024

@KevinNitroG just execute :checkhealth in neovim and go to luaSnip.

@mez0ru
Copy link

mez0ru commented Dec 16, 2024

@xudyang1 sh.exe (git) doesn't recognize uname command when the build happens.

@KevinNitroG
Copy link

KevinNitroG commented Jan 4, 2025

@mez0ru now it's fine on my win machine with this setup

{
  "L3MON4D3/LuaSnip",
  dependencies = {
    "rafamadriz/friendly-snippets",
  },
  build = vim.g.os == "Windows" and "make install_jsregexp CC=gcc.exe SHELL=sh.exe .SHELLFLAGS=-c"
    or "make install_jsregexp",
}

vim.g.os is my custom detection

image

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

Successfully merging this pull request may close these issues.

4 participants