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

Windows support #14

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Windows support #14

wants to merge 11 commits into from

Conversation

hishamhm
Copy link

@hishamhm hishamhm commented Jul 29, 2022

Installs from the LuaRocks source package on Unix and uses the precompiled binaries on Windows.

CI: Test matrix runs it with Lua 5.1 (oldest supported), 5.4 (newest supported) and LuaJIT; being based on gh-actions-lua, it uses MSVC for PUC-Rio Lua runs and Mingw for the LuaJIT run. In principle this action should work with any combination of Lua version and supported Windows compiler, even though gh-actions-lua currently doesn't (it would be rather annoying to support the full Windows matrix on gh-actions-lua because the LuaJIT Makefile works out of the box with Mingw and my handwritten implementation for building PUC Lua targets MSVC and would have to be rewritten for Mingw).

Closes #13.

hishamhm added 2 commits July 29, 2022 00:16
`luarocks path` on its own does not set the paths, it just
displays the variables to be set. `luarocks config` is a more
useful test as it prints the whole internal configuration.
@msteinbeck
Copy link

Any progress here?

@hishamhm
Copy link
Author

hishamhm commented Feb 7, 2023

@leafo You can see it running on my fork's CI here: https://github.com/hishamhm/gh-actions-luarocks/actions/runs/2758104388

@msteinbeck
Copy link

So this PR could be merged?

@magneto538
Copy link

Up — can this be merged? Seems like it should address #17 and I'd need that.

@magneto538
Copy link

Up?

@TheComamba
Copy link

@hishamhm Could you make a release on your fork? Then we could simply use your version for the moment.

Comment on lines +146 to 154
lrCpath = lrCpath.trim()

if (luaPath != "") {
core.exportVariable("LUA_PATH", ";;" + luaPath)
if (lrPath != "") {
core.exportVariable("LUA_PATH", ";;" + lrPath)
}

if (luaCpath != "") {
core.exportVariable("LUA_CPATH", ";;" + luaCpath)
if (lrCpath != "") {
core.exportVariable("LUA_CPATH", ";;" + lrCpath)
}
Copy link

@mrcjkb mrcjkb Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hishamhm I've been using your fork, and this seems to generate a unix style path (with semicolons as separators, instead of colons).

> printenv
LUA_PATH=;;C:\Users\runneradmin\AppData\Roaming/luarocks/share/lua/5.1/?.lua;C:\Users\runneradmin\AppData\Roaming/luarocks/share/lua/5.1/?/init.lua

PATH=/c/Program Files/PowerShell/7:/c/Users/runneradmin/AppData/Roaming/luarocks/bin:/d/a/rocks-binaries/rocks-binaries/.luarocks/bin:/d/a/rocks-binaries/rocks-binaries/.lua/bin:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/Extensions/Microsoft/IntelliCode/CLI:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/VC/VCPackages:/c/Program Files (x86)/Microsoft Visual 
...

As a result (I think), build-time dependencies can't be found (e.g. when installing toml-edit, which depends on luarocks-build-rust-mlua).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrcjkb did you solve this issue?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrcjkb LUA_PATH uses ; on both Windows and Unix, and PATH uses : on Unix and ; on Windows. I don't think the semicolons are the cause of your issue, but there were issues related to build dependency lookup that were fixed in 3.10.0.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 I can confirm it works when I add

with:
    luarocksVersion: "3.10.0"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, no it doesn't. I was looking at the Linux builder.
The Windows builder still fails when trying to use the luarocks-build-rust-mlua build backend:

Error: Failed initializing build back-end for build type 'rust-mlua': module 'luarocks.build.rust-mlua' not found:
	No LuaRocks module found for luarocks.build.rust-mlua

https://github.com/nvim-neorocks/rocks-binaries/actions/runs/8168782585/job/22331528480#step:11:1256

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/nvim-neorocks/rocks-binaries/actions/runs/8168782585/job/22331528480#step:11:1256

Ok, this looks like the same problem as the one @Tieske is facing in lunarmodules/luasystem#17

I spent all night digging that down yesterday. I'm going to push a "preview build" later today so we can test if I got it fixed. I'll ping back here when I have more info!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrcjkb Please try again bumping the version number to 3.11.0! I've uploaded a pre-release build but I haven't announced it yet. 🤫 😉

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That has fixed it! 🙏 🙏 🙏
🎉 🚀

@magneto538
Copy link

magneto538 commented Mar 13, 2024

@hishamhm , trying your fork off the tip of master. Upon attempting to install packages via Luarocks on windows-latest using the default Win shell, I'm getting luarocks: command not found. Any advice? I'm using luarocksVersion: "3.11.0" as you recommended above, and all the other actions used are pointing to the latest release at the time of writing.

Edit: fixed by moving the Lua/Luarocks install steps after a repo checkout.

@hishamhm
Copy link
Author

@magneto538 no idea, sorry! it seems to be working for others, so I don't even know what to suggest...

@jonasgeiler
Copy link

jonasgeiler commented Apr 6, 2024

Great work on the windows support and thank you for your fork @hishamhm - everything seems to work perfectly except when I try to require luarocks.loader, which can't be found unfortunately... This only happens for Windows.

Here is my workflow:

on:
  workflow_dispatch:

jobs:
  test-luarocks-loader:
    name: Test LuaRocks Loader
    runs-on: windows-latest

    steps:
      - name: Setup Microsoft Visual C++ Developer Command Prompt
        uses: ilammy/[email protected]

      - name: Setup Lua
        uses: leafo/[email protected]

      - name: Setup LuaRocks
        uses: hishamhm/gh-actions-luarocks@master
        with:
          luarocksVersion: 3.11.0

      - name: Test require luarocks loader
        run: lua -e "require('luarocks.loader');"

And here is the output of the last step above:

2024-04-06T06:47:45.9623061Z D:/a/lua-fenster/lua-fenster/.lua/bin\lua.exe: (command line):1: module 'luarocks.loader' not found:
2024-04-06T06:47:45.9624644Z 	no field package.preload['luarocks.loader']
2024-04-06T06:47:45.9626041Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\lua\luarocks\loader.lua'
2024-04-06T06:47:45.9627431Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\lua\luarocks\loader\init.lua'
2024-04-06T06:47:45.9629064Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\luarocks\loader.lua'
2024-04-06T06:47:45.9631579Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\luarocks\loader\init.lua'
2024-04-06T06:47:45.9633156Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\..\share\lua\5.4\luarocks\loader.lua'
2024-04-06T06:47:45.9634704Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\..\share\lua\5.4\luarocks\loader\init.lua'
2024-04-06T06:47:45.9636184Z 	no file '.\luarocks\loader.lua'
2024-04-06T06:47:45.9637341Z 	no file '.\luarocks\loader\init.lua'
2024-04-06T06:47:45.9638632Z 	no file 'C:\Users\runneradmin\AppData\Roaming/luarocks/share/lua/5.4/luarocks\loader.lua'
2024-04-06T06:47:45.9640845Z 	no file 'C:\Users\runneradmin\AppData\Roaming/luarocks/share/lua/5.4/luarocks\loader/init.lua'
2024-04-06T06:47:45.9642556Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\luarocks\loader.dll'
2024-04-06T06:47:45.9644015Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\..\lib\lua\5.4\luarocks\loader.dll'
2024-04-06T06:47:45.9645342Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\loadall.dll'
2024-04-06T06:47:45.9646255Z 	no file '.\luarocks\loader.dll'
2024-04-06T06:47:45.9647493Z 	no file 'C:\Users\runneradmin\AppData\Roaming/luarocks/lib/lua/5.4/luarocks\loader.dll'
2024-04-06T06:47:45.9648931Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\luarocks.dll'
2024-04-06T06:47:45.9650260Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\..\lib\lua\5.4\luarocks.dll'
2024-04-06T06:47:45.9651596Z 	no file 'D:\a\lua-fenster\lua-fenster\.lua\bin\loadall.dll'
2024-04-06T06:47:45.9652592Z 	no file '.\luarocks.dll'
2024-04-06T06:47:45.9657461Z 	no file 'C:\Users\runneradmin\AppData\Roaming/luarocks/lib/lua/5.4/luarocks.dll'
2024-04-06T06:47:45.9682363Z stack traceback:
2024-04-06T06:47:45.9719912Z 	[C]: in function 'require'
2024-04-06T06:47:45.9743053Z 	(command line):1: in main chunk
2024-04-06T06:47:45.9771143Z 	[C]: in ?

I'm not really using the luarocks loader so it's not a critical issue, just noticed it and wanted to let you know.

EDIT:

Okay I just noticed that requiring my own library after running luarocks build also doesn't seem to work... There is definitely something missing or using the wrong path.
I did not try it, but I assume installing something with luarocks install <rock> and then requiring the installed rock will also not work :/

EDIT 2:

Seems like I have found another issue. When running luarocks build with LuaJIT on Windows it can't find the Lua library. This only happens when I set luaVersion to luajit in leafo/gh-actions-lua, but works for 5.1, 5.2, 5.3, 5.4 and Linux.
There are two different outputs with the same meaning, depending on whether I already ran luarocks/luarocks config once before:

Error: Build error: Failed finding the Lua library. You can use `luarocks config variables.LUA_LIBDIR <path>` to set the correct location.
testlib dev-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)

or:

Error: Failed finding Lua library. You may need to configure LUA_LIBDIR.

This could very likely be an issue with leafo/gh-actions-lua and not with your fork, but I'll let you know anyway.

@magneto538
Copy link

magneto538 commented Apr 7, 2024

I have a problem related to packages not found too. My workflow requires the lfs Lua module. When attempting to run a script that requires the lfs module after having installed it, I'm getting The specified module could not be found, as per log attached. Any advice?

name: foo

on:
  workflow_dispatch:

jobs:
  tests:
    runs-on: windows-latest
    steps:
      - uses: actions/[email protected]

      - name: Setup Microsoft Visual C++ Developer Command Prompt
        uses: ilammy/[email protected]

      - name: Setup Lua
        uses: leafo/[email protected]

      - name: Setup LuaRocks
        uses: hishamhm/gh-actions-luarocks@master
        with:
          luarocksVersion: 3.11.0

      - name: Environment setup
        run: |
          luarocks install luacheck
          luacheck --version
          luarocks install busted
          luarocks install luafilesystem
          luarocks install serpent  
          lua runScript.lua ## this script requires luafilesystem (lfs)

Log from Environment setup step:


lfs.c
Microsoft (R) Incremental Linker Version 14.38.33135.0
Copyright (C) Microsoft Corporation.  All rights reserved.
   Creating library C:\Users\RUNNER~1\AppData\Local\Temp\luarocks_build-LuaFileSystem-1.8.0-1-8365456\lfs.lib and object C:\Users\RUNNER~1\AppData\Local\Temp\luarocks_build-LuaFileSystem-1.8.0-1-8365456\lfs.exp
No existing manifest. Attempting to rebuild...
Installing https://luarocks.org/luacheck-1.1.2-1.src.rock
Missing dependencies for luacheck 1.1.2-1:
   argparse >= 0.6.0 (not installed)
   luafilesystem >= 1.6.3 (not installed)
luacheck 1.1.2-1 depends on lua >= 5.1 (5.4-1 provided by VM: success)
luacheck 1.1.2-1 depends on argparse >= 0.6.0 (not installed)
Installing https://luarocks.org/argparse-0.7.1-1.src.rock
argparse 0.7.1-1 depends on lua >= 5.1, < 5.5 (5.4-1 provided by VM: success)
argparse 0.7.1-1 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT)
luacheck 1.1.2-1 depends on luafilesystem >= 1.6.3 (not installed)
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock
luafilesystem 1.8.0-1 depends on lua >= 5.1 (5.4-1 provided by VM: success)
cl /nologo /MD /O2 -c -Fosrc/lfs.obj -ID:/a/myrepo/myrepo/.lua/include src/lfs.c
link -dll -def:lfs.def -out:C:\Users\RUNNER~1\AppData\Local\Temp\luarocks_build-LuaFileSystem-1.8.0-1-8365456\lfs.dll D:\a\myrepo\myrepo\.lua\lib\lua54.lib src/lfs.obj
luafilesystem 1.8.0-1 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT/X11)
luacheck 1.1.2-1 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT)
D:\a\myrepo\myrepo\.lua\bin\lua.exe: error loading module 'lfs' from file 'C:\Users\runneradmin\AppData\Roaming\luarocks\lib\lua\5.4\lfs.dll':
	The specified module could not be found.
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	...n\AppData\Roaming\luarocks\share\lua\5.4\luacheck\fs.lua:3: in main chunk
	[C]: in function 'require'
	...ppData\Roaming\luarocks\share\lua\5.4\luacheck\cache.lua:1: in main chunk
	[C]: in function 'require'
	...AppData\Roaming\luarocks\share\lua\5.4\luacheck\main.lua:2: in main chunk
	[C]: in function 'require'
	...cks\lib\luarocks\rocks-5.4\luacheck\1.1.2-1\bin\luacheck:2: in main chunk
	[C]: in ?
core.c
compat.c
time.c
environment.c
random.c
link -dll -def:core.def -out:C:\Users\RUNNER~1\AppData\Local\Temp\luarocks_build-lua-term-0.8-1-[62](https://github.com/<hidden>)
lua-term 0.8-1 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT/X11)
busted 2.2.0-1 depends on penlight >= 1.3.2 (not installed)
Installing https://luarocks.org/penlight-1.13.1-1.src.rock
penlight 1.13.1-1 depends on luafilesystem (1.8.0-1 installed: success)
penlight 1.13.1-1 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT/X11)
busted 2.2.0-1 depends on mediator_lua >= 1.1.1 (not installed)
Installing https://luarocks.org/mediator_lua-1.1.2-0.rockspec
mediator_lua 1.1.2-0 depends on lua >= 5.1 (5.4-1 provided by VM: success)
mediator_lua 1.1.2-0 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT <http://opensource.org/licenses/MIT>)
busted 2.2.0-1 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT <http://opensource.org/licenses/MIT>)
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock
luafilesystem 1.8.0-1 is already installed in C:\Users\runneradmin\AppData\Roaming\luarocks
Use --force to reinstall.
Cloning into 'serpent'...
Note: switching to 'd78[68](https://github.com/<hidden>)
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to eate a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
  git switch -c <new-branch-name>
Or undo this operation with:
  git switch -
Turn off this advice by setting config variable advice.detachedHead to false
Installing https://luarocks.org/serpent-0.30-2.rockspec
D:/a/myrepo/myrepo/.lua/bin\lua.exe: error loading module 'lfs' from file 'C:\Users\runneradmin\AppData\Roaming\luarocks\lib\lua\5.4\lfs.dll':
	The specified module could not be found.
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	ActionsHelpers/myrepo.lua:8: in main chunk
	[C]: in ?
serpent 0.30-2 depends on lua >= 5.1, < 5.5 (5.4-1 provided by VM: success)
serpent 0.30-2 is now installed in C:\Users\runneradmin\AppData\Roaming\luarocks (license: MIT)

@Tieske
Copy link

Tieske commented Apr 8, 2024

@magneto538 are you using @hishamhm s fork? That should fix that issue (see lunarmodules/luasystem#17 (comment)) unless you're hitting a new issue.

@magneto538
Copy link

magneto538 commented Apr 8, 2024

@Tieske Yes, I am, as per the code snippet I've posted.

Luarocks config output for completeness:

Configuration:
   Lua:
      Version    : 5.4
      LUA        : D:/a/myrepo/myrepo/.lua\bin\lua.exe (ok)
      LUA_INCDIR : D:/a/myrepo/myrepo/.lua/include (ok)
      LUA_LIBDIR : D:\a\myrepo\myrepo\.lua\lib (ok)
   Configuration files:
      System  : C:\Program Files\luarocks\config-5.4.lua (not found)
      User    : C:\Users\runneradmin\AppData\Roaming\luarocks\config-5.4.lua
      (ok)
   Rocks trees in use:
      C:\Users\runneradmin\AppData\Roaming\luarocks ("user")

@magneto538
Copy link

@hishamhm bump in case you missed it ^

@hishamhm
Copy link
Author

@magneto538 as a workaround, try adding luarocks config fs_use_modules false before luarocks install luafilesystem

@magneto538
Copy link

@hishamhm thanks. Now lfs would install correctly as per Luarocks' output, however it still fails when called from a script executed after setting up the environment (see the first snippet in this comment for reference):

D:/a/myrepo/myrepo/.lua/bin\lua.exe: runScript.lua:8: module 'lfs' not found:
	no field package.preload['lfs']
	no file 'D:\a\myrepo\myrepo\.lua\bin\lua\lfs.lua'
	no file 'D:\a\myrepo\myrepo\.lua\bin\lua\lfs\init.lua'
	no file 'D:\a\myrepo\myrepo\.lua\bin\lfs.lua'
	no file 'D:\a\myrepo\myrepo\.lua\bin\lfs\init.lua'
	no file 'D:\a\myrepo\myrepo\.lua\bin\..\share\lua\5.4\lfs.lua'
	no file 'D:\a\myrepo\myrepo\.lua\bin\..\share\lua\5.4\lfs\init.lua'
	no file '.\lfs.lua'
	no file '.\lfs\init.lua'
	no file 'C:\Users\runneradmin\AppData\Roaming\luarocks\share\lua\5.4\lfs.lua'
	no file 'C:\Users\runneradmin\AppData\Roaming\luarocks\share\lua\5.4\lfs\init.lua'
	no file 'D:\a\myrepo\myrepo\.lua\bin\lfs.dll'
	no file 'D:\a\myrepo\myrepo\.lua\bin\..\lib\lua\5.4\lfs.dll'
	no file 'D:\a\myrepo\myrepo\.lua\bin\loadall.dll'
	no file '.\lfs.dll'
	no file 'C:\Users\runneradmin\AppData\Roaming\luarocks\lib\lua\5.4\lfs.dll'
stack traceback:
	[C]: in function 'require'
	runScript.lua:8: in main chunk
	[C]: in ?

@hishamhm
Copy link
Author

hishamhm commented Apr 17, 2024

@magneto538 Add eval $(luarocks path) before the lua call?

@magneto538
Copy link

@hishamhm no luck with that one:

eval: D:\a\_temp\019bc3a1-dc0e-4b98-879f-3321a897784e.ps1:8
Line |
   8 |  eval $(luarocks path)
     |  ~~~~
     | The term 'eval' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the
     | spelling of the name, or if a path was included, verify that the path is correct and try again.

@jonasgeiler
Copy link

jonasgeiler commented Apr 18, 2024

@magneto538 he mistakenly gave you the code for Unix, here's how you do it on Windows CMD:

luarocks path > "%temp%\_lrp.bat"
call "%temp%\_lrp.bat" && del "%temp%\_lrp.bat"

(You can find this command by running luarocks path --help)
You might have to set shell: cmd in your GitHub Actions job to use CMD instead of the default PowerShell.

Unfortunately I already tried this without success, but you might be luckier 🤞🏻

EDIT

I have started investigating my issue again and I'm pretty sure that the problem lies within my C module. Maybe I'm not exporting correctly or something is wrong with the .dll file, but everything suggests that Lua CAN find the module file, but CAN'T find the module itself in the file.
Super hard to debug though... Guess I'll have to spin up a VM.

EDIT 2

The Windows build works in my VM, works when I download it from GitHub Actions, and works on my old Windows PC. It just doesn't work on the GitHub Actions Runner itself, which is a Window Server 2022... No idea. But probably not a bug in hishamhm's fork.

@magneto538
Copy link

@jonasgeiler thanks! Actually I did try switching to bash before posting (while keeping the Unix eval call provided by @hishamhm) and got the exact same output I'm getting with PowerShell using your Windows command instead:

Error: Failed installing dependency: https://luarocks.org/luafilesystem-1.8.0-1.src.rock - Build error: Failed compiling module lfs.dll
   argparse >= 0.6.0 (not installed)
   luafilesystem >= 1.6.3 (not installed)

So nope, not working for me either.

@Tieske
Copy link

Tieske commented Apr 25, 2024

@magneto538 GHA defaults to PowerShell as the shell, but you can set it up to switch to cmd iirc. Try adding shell: cmd.

@jonasgeiler I originally also thought the dll was wrong, hence we added this: https://github.com/lunarmodules/luasystem/pull/17/files#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R66
turned out dll was fine in my case. Maybe the code can help you debug your problem.

@magneto538
Copy link

magneto538 commented Apr 26, 2024

@Tieske , I had already tried both PowerShell and cmd to no avail. I reckon I hadn't posted the cmd output here, so here we go:

LFS still isn't being picked up inside the Lua script I'm running.

      - name: Setup
        shell: cmd
        run: |
          luarocks
          luarocks config fs_use_modules false
          luarocks install luacheck
          luarocks install busted
          luarocks install luafilesystem
          luarocks install serpent
          luarocks path > "%temp%\_lrp.bat"
          call "%temp%\_lrp.bat" && del "%temp%\_lrp.bat"
          lua myScript.lua

The above fails when executing myScript.lua, which requires lfs. The installation steps are all successful, but lfs can't be run from that script:

lua: myScript.lua:8: module 'lfs' not found:
	no field package.preload['lfs']
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\lua\lfs.lua'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\lua\lfs\init.lua'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\lfs.lua'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\lfs\init.lua'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\..\share\lua\5.4\lfs.lua'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\..\share\lua\5.4\lfs\init.lua'
	no file '.\lfs.lua'
	no file '.\lfs\init.lua'
	no file 'C:\Users\runneradmin\AppData\Roaming\luarocks\share\lua\5.4\lfs.lua'
	no file 'C:\Users\runneradmin\AppData\Roaming\luarocks\share\lua\5.4\lfs\init.lua'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\lfs.dll'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\..\lib\lua\5.4\lfs.dll'
	no file 'D:\a\myRepo\myRepo\.luarocks\bin\loadall.dll'
	no file '.\lfs.dll'
	no file 'C:\Users\runneradmin\AppData\Roaming\luarocks\lib\lua\5.4\lfs.dll'
stack traceback:
	[C]: in function 'require'
	myScript.lua:8: in main chunk
	[C]: in ?

@jonasgeiler
Copy link

@Tieske wrote:
(at)jonasgeiler I originally also thought the dll was wrong, hence we added this: https://github.com/lunarmodules/luasystem/pull/17/files#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R66 turned out dll was fine in my case. Maybe the code can help you debug your problem.

Thank you for showing me the workflow you use for luasystem! I tried adapting some of your steps and I got the whole thing working once I switched to hishamhm/gh-actions-lua@master instead of leafo/[email protected] 🤔 Seems there are some flaws with leafo's Lua action aswell...

Here is the commit that finally fixed my problem:
jonasgeiler/lua-fenster@5f41f11

Unfortunately I didn't get LuaJIT tests to work on Windows but as long as all the other versions work I think it's fine for now.

@Tieske
Copy link

Tieske commented May 21, 2024

Unfortunately I didn't get LuaJIT tests to work on Windows but as long as all the other versions work I think it's fine for now.

The trick in luasystem is that PuC Lua and LuaJIT are build using different toolchains. One uses MinGW, the other MSVC. So might be worthwhile to try and get it to work, as it provides better test coverage.

@jonasgeiler
Copy link

@Tieske wrote: The trick in luasystem is that PuC Lua and LuaJIT are build using different toolchains. One uses MinGW, the other MSVC. So might be worthwhile to try and get it to work, as it provides better test coverage.

Yeah I did try to skip the MSVC step and force MingW with shell: bash and everything, just like luasystem does, but to no success... I might have missed something though and will probably revisit this problem in the future when my library gains more popularity. I could confirm that it works on LuaJIT on Windows by building it manually, so it's not a big problem.
Thanks anyways!

@jonasgeiler
Copy link

jonasgeiler commented Sep 20, 2024

@hishamhm It seems like you've commited the node_modules folder here... The node_modules folder should definitely stay out of VCS.

Edit: Wait leafo also added the node_modules folder? Why?

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.

Windows support
9 participants