actboy168 / lua-debug

Lua Debug Adapter for Visual Studio Code
MIT License
440 stars 95 forks source link

Failure to build on Windows 11 #261

Closed Silverlan closed 1 year ago

Silverlan commented 1 year ago

I have recently upgraded to Windows 11, and I can no longer build lua-debug, although I'm not sure the problem is actually related to Windows 11.

I have Visual Studio 2022 Community installed.

I ran the commands from the readme, with no changes:

git clone https://github.com/actboy168/luamake
pushd luamake
git submodule init
git submodule update
./compile/install.bat
popd

git clone https://github.com/actboy168/lua-debug
cd lua-debug
git submodule init
git submodule update

luamake lua compile/download_deps.lua

luamake -mode release

The last command (luamake -mode release) fails with this error:

$ luamake -mode release
`default`: deps `copy_vcredist` undefine.
stack traceback:
        ...ilverlan/Desktop/tmp6/lua-debug/compile/windows/make.lua:37: in main chunk
        C:/Users/Silverlan/Desktop/tmp6/lua-debug/make.lua:14: in main chunk

Here is the entire log:

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6
$ git clone https://github.com/actboy168/luamake
Cloning into 'luamake'...
remote: Enumerating objects: 4522, done.
remote: Counting objects: 100% (1072/1072), done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 4522 (delta 749), reused 1045 (delta 725), pack-reused 3450
Receiving objects: 100% (4522/4522), 1.55 MiB | 6.84 MiB/s, done.
Resolving deltas: 100% (3138/3138), done.

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6
$ pushd luamake
~/Desktop/tmp6/luamake ~/Desktop/tmp6

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/luamake (master)
$ git submodule init
Submodule '3rd/bee.lua' (https://github.com/actboy168/bee.lua) registered for path 'bee.lua'

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/luamake (master)
$ git submodule update
Cloning into 'C:/Users/Silverlan/Desktop/tmp6/luamake/bee.lua'...
Submodule path 'bee.lua': checked out 'e7f8130cf48de894f08934fadbdb8e5ea76c2993'

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/luamake (master)
$ ./compile/install.bat

C:\Users\Silverlan\Desktop\tmp6\luamake>ninja -f build\msvc\compile.ninja
[1/41] Compile C   build/msvc/obj/source_bee/lua-seri.obj
[2/41] Compile C++ build/msvc/obj/source_bee/unlink_win.obj
[3/41] Compile C++ build/msvc/obj/source_bee/atomic_semaphore.obj
[4/41] Compile C++ build/msvc/obj/source_bee/simplethread_win.obj
[5/41] Compile C++ build/msvc/obj/source_bee/unicode_win.obj
[6/41] Compile C++ build/msvc/obj/source_bee/endpoint.obj
[7/41] Compile C++ build/msvc/obj/source_bee/version.obj
[8/41] Compile C++ build/msvc/obj/source_bee/setname.obj
[9/41] Compile C++ build/msvc/obj/source_bee/format.obj
[10/41] Compile C++ build/msvc/obj/source_bee/filewatch_win.obj
[11/41] Compile C++ build/msvc/obj/source_bee/process_select.obj
[12/41] Compile C++ build/msvc/obj/source_bee/spinlock.obj
[13/41] Compile C++ build/msvc/obj/source_bee/error.obj
[14/41] Compile C++ build/msvc/obj/source_bee/socket.obj
[15/41] Compile C++ build/msvc/obj/source_bee/file_handle.obj
[16/41] Compile C++ build/msvc/obj/source_bee/lua_serialization.obj
[17/41] Compile ASM build/msvc/obj/source_lua/fast_setjmp_x86_64.obj
 Assembling: bee.lua/3rd/lua/fast_setjmp_x86_64.s
[18/41] Compile C   build/msvc/obj/source_lua/linit.obj
[19/41] Compile C++ build/msvc/obj/source_bee/module_version_win.obj
[20/41] Compile C++ build/msvc/obj/source_bee/lua_filewatch.obj
[21/41] Compile C   build/msvc/obj/source_lua/utf8_crt.obj
[22/41] Compile C++ build/msvc/obj/source_bee/lua_unicode.obj
[23/41] Compile C++ build/msvc/obj/source_bee/lua_platform.obj
[24/41] Compile C++ build/msvc/obj/source_bee/lua_time.obj
[25/41] Compile C++ build/msvc/obj/source_bee/path_helper.obj
[26/41] Compile C   build/msvc/obj/source_lua/onelua.obj
[27/41] Compile C++ build/msvc/obj/source_bee/lua_socket.obj
[28/41] Compile C++ build/msvc/obj/source_bee/file_handle_win.obj
[29/41] Compile C++ build/msvc/obj/source_bee/lua_filesystem.obj
[30/41] Compile C++ build/msvc/obj/source_bee/subprocess_win.obj
[31/41] Compile C++ build/msvc/obj/source_bee/lua_subprocess.obj
[32/41] Compile C++ build/msvc/obj/source_bee/lua_thread.obj
[33/41] Compile C++ builOS:             windows 10.0.22621
Arch:           x86_64
Compiler:       MSVC 193532216.1
CRT:            MSVC STL 202210L
DEBUG:          false
.............................................................................
.....................
Ran 98 tests in 3.655 seconds, 98 successes, 0 failures
OK
d/msvc/obj/source_bootstrap/main.obj
[34/41] Link    Exe build/msvc/bin/bootstrap.exe
   Creating library build/msvc/obj/bootstrap.lib and object build/msvc/obj/bootstrap.exp
Generating code
Finished generating code
[35/41] Copy build/msvc/bin/bootstrap.exe luamake.exe
[36/41] Copy bee.lua/bootstrap/main.lua build/msvc/bin/main.lua
[36/41] Run test.
[39/41] Link    Dll build/msvc/bin/lua54.dll
   Creating library build/msvc/obj/lua54/lua54.lib and object build/msvc/obj/lua54/lua54.exp
Generating code
Finished generating code
[40/41] Copy build/msvc/bin/lua54.dll tools/lua54.dll

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/luamake (master)
$ popd
~/Desktop/tmp6

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6
$ git clone https://github.com/actboy168/lua-debug
Cloning into 'lua-debug'...
remote: Enumerating objects: 21028, done.
remote: Counting objects: 100% (117/117), done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 21028 (delta 44), reused 96 (delta 38), pack-reused 20911
Receiving objects: 100% (21028/21028), 8.77 MiB | 4.03 MiB/s, done.
Resolving deltas: 100% (14835/14835), done.

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6
$ cd lua-debug

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/lua-debug (master)
$ git submodule init
Submodule '3rd/bee.lua' (https://github.com/actboy168/bee.lua.git) registered for path '3rd/bee.lua'
Submodule '3rd/frida_gum/gumpp' (https://github.com/fesily/gumpp) registered for path '3rd/frida_gum/gumpp'
Submodule '3rd/json.lua' (https://github.com/actboy168/json.lua) registered for path '3rd/json.lua'
Submodule '3rd/lua/luajit' (https://github.com/fesily/luajit2) registered for path '3rd/lua/luajit'

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/lua-debug (master)
$ git submodule update
Cloning into 'C:/Users/Silverlan/Desktop/tmp6/lua-debug/3rd/bee.lua'...
Cloning into 'C:/Users/Silverlan/Desktop/tmp6/lua-debug/3rd/frida_gum/gumpp'...
Cloning into 'C:/Users/Silverlan/Desktop/tmp6/lua-debug/3rd/json.lua'...
Cloning into 'C:/Users/Silverlan/Desktop/tmp6/lua-debug/3rd/lua/luajit'...
Submodule path '3rd/bee.lua': checked out 'cc9c2ed48920ffeac67bc3b388e0fdab9276aebf'
Submodule path '3rd/frida_gum/gumpp': checked out 'bd7de637a9487858b9e9fe347e917a947503f14d'
Submodule path '3rd/json.lua': checked out 'be1d71ff7afe84942eb3f33b76c8bf75306c4635'
Submodule path '3rd/lua/luajit': checked out '2793f67cf6ff66eea324c6b47bea773754e91eac'

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/lua-debug (master)
$ luamake lua compile/download_deps.lua
[1/2]   https://github.com/frida/frida/releases/download/16.0.10/frida-gum-devkit-16.0.10-windows-x86.exe       3rd/frida_gum/16.0.10-windows-x86.exe

7-Zip SFX 22.01 (x86) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15

Extracting archive: C:\Users\Silverlan\Desktop\tmp6\lua-debug\3rd\frida_gum\16.0.10-windows-x86.exe
--
Path = C:\Users\Silverlan\Desktop\tmp6\lua-debug\3rd\frida_gum\16.0.10-windows-x86.exe
Type = 7z

Everything is Ok
[2/2]   https://github.com/frida/frida/releases/download/16.0.10/frida-gum-devkit-16.0.10-windows-x86_64.exe    3rd/frida_gum/16.0.10-windows-x86_64.exe

7-Zip SFX 22.01 (x86) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15

Extracting archive: C:\Users\Silverlan\Desktop\tmp6\lua-debug\3rd\frida_gum\16.0.10-windows-x86_64.exe
--
Path = C:\Users\Silverlan\Desktop\tmp6\lua-debug\3rd\frida_gum\16.0.10-windows-x86_64.exe
Type = 7z

Everything is Ok

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/lua-debug (master)
$ luamake -mode release
`default`: deps `copy_vcredist` undefine.
stack traceback:
        ...ilverlan/Desktop/tmp6/lua-debug/compile/windows/make.lua:37: in main chunk
        C:/Users/Silverlan/Desktop/tmp6/lua-debug/make.lua:14: in main chunk

Silverlan@fw-desktop MINGW64 ~/Desktop/tmp6/lua-debug (master)
$
actboy168 commented 1 year ago

Use cmd or powershell.

Silverlan commented 1 year ago

Use cmd or powershell.

Hm.. that does work on my local OS, but unfortunately not on Windows Server.

In powershell it builds luamake successfully, but then fails to build lua-debug, because it can't locate the executable for luamake. Here is an example on a GitHub runner: https://github.com/Silverlan/lua-debug-build-test/blob/main/.github/workflows/build-windows-ci-pwsh.yml#L27 Log: https://github.com/Silverlan/lua-debug-build-test/actions/runs/5111090254/jobs/9187669436 firefox_pit1bUkjsb

If I try to run it in cmd, it successfully executes everything, including ./compile/install.bat, but then just ignores the remaining commands: https://github.com/Silverlan/lua-debug-build-test/blob/main/.github/workflows/build-windows-ci-cmd.yml#L27 Log: https://github.com/Silverlan/lua-debug-build-test/actions/runs/5111090258/jobs/9187669344 firefox_T0WdqOVpzx

actboy168 commented 1 year ago

You can use actboy168/setup-luamake in GitHub action.