Closed Ryuu-64 closed 2 months ago
What does your set up look like? What compiler toolchain are you using, how did you configure LuaRocks?
Thanks for your reply.
This is my Lua Path:
This is my MinGW Path:
I found that the dependencies are compiled, but the compiler says things like "ENABLE_VIRTUAL_TERMINAL_INPUT" and "DISABLE_NEWLINE_AUTO_RETURN." are undeclared.
This causes the Lua system install to fail. Do you know how I can fix this? I am looking forward to hearing back from you.
what windows version are you on?
Also; make sure your paths are clean (do not mix different compilers) just to be sure. That zipfile has vc17
in the filename. Which means it was compiled using MS Visual C, and probably uses a different runtime than the MinGW compiler does.
You might want to give this a try;
I ran into this as well when using hererocks (to install any lua version, luarocks seems to be 3.8.0) in a github actions windows-2019
environment. Changing to windows-2022
avoided the issue.
That would explain it. This functionality was added to windows 10 somewhere 2019. Which is by now 5 years ago...
Would it be fair to state that one should stick to an older luasystem version, or upgrade to a later toolchain?
Would it be fair to state that one should stick to an older luasystem version, or upgrade to a later toolchain?
It would be ideal to have some #if blocks to avoid this issue. I've only had a brief look at the code, but maybe you could just set it to zero if it isn't set? e.g.
#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT
#define ENABLE_VIRTUAL_TERMINAL_INPUT 0
#endif
This seems in line with the comment here: https://github.com/lunarmodules/luasystem/blob/45499248cea9e23b7e4d8478759414e01c645809/src/term.c#L106-L108
If that can't be a solution, then having a note somewhere to specify which luasystem versions are supported on which toolchains would be useful.
Since this is an OS version that is 5 years old, is out of support (and hence insecure), and usage will be diminishing, I'd vote to not add those #if
blocks, but rather document it.
wdyt @o-lim, @alerque ?
Since this is an OS version that is 5 years old, is out of support (and hence insecure), and usage will be diminishing, I'd vote to not add those
#if
blocks, but rather document it.wdyt @o-lim, @alerque ?
That depends. What happens if this constant is not defined (or zero)? Would the term module still work as expected? Would any tests fail? Is enabling this feature critical to the functionality of the Lua module? I'm not familiar with the Windows terminal, so I don't know enough to answer any of these questions.
If the module just "doesn't work right" without this constant/feature, then is it possible to generate a more appropriate compile error message when the Windows version is too low? Something like:
#if WINVER < XXX
#error Windows version not supported, need at least version YYY for terminal support
#endif
It would not work. Even worse, if you run it on a recent version of windows, but with the 2019 compiler. It would compile but not work. Very confusing imho.
I think @o-lim s suggestion of generating a more descriptive compile time error is probably the best option.
I think @o-lim s suggestion of generating a more descriptive compile time error is probably the best option.
That sounds good to me.
@Ryuu-64 @tobil4sk would you mind giving #32 a try? Doesn't fix your problem, but should get you a more descriptive error message.
what windows version are you on?
My Windows version is: Windows 11 Professional 23H2 22631.3880 Windows Feature Experience Pack 1000.22700.1020.0
@Ryuu-64 @tobil4sk would you mind giving #32 a try? Doesn't fix your problem, but should get you a more descriptive error message.
Thank you for your reply; I will give it a try.
My Windows version is: Windows 11 Professional 23H2 22631.3880 Windows Feature Experience Pack 1000.22700.1020.0
@Ryuu-64 I think it's more related to the toolchain, than the actual Windows version. Since Windows does binary distributions, the actual OS doesn't include the header files for development. You only get those with the Windows SDK or with Visual Studio installation.
So what toolchain version were you using?
@Ryuu-64 @tobil4sk would you mind giving https://github.com/lunarmodules/luasystem/pull/32 a try? Doesn't fix your problem, but should get you a more descriptive error message.
With this change, the first error displayed is the new error message: 2019 and older toolchains are not supported. Update the toolchain or revert to Luasystem < 0.4
, followed by the undeclared define errors.
For the windows-2019
github actions image, it looks like the issue is due to an outdated mingw version. It is using a build that is missing this definition. It was only added in: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/1b29d1bc58910a4c21ff2c5c804bf06821032348/. So for mingw users, this can be solved by using a newer mingw version.
Hopefully the windows-2019
image can be updated with a newer mingw build: https://github.com/actions/runner-images/issues/10352
I'm using "x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z"
@Ryuu-64 This is the same version that the windows-2019
image is downloading from sourceforge. v6 of the mingw runtime is very old (from 2018), which is why it is missing these definitions. There are newer builds available here with newer versions of the mingw runtime: https://github.com/niXman/mingw-builds-binaries/releases. Using one of these should be the solution to the issue.
@tobil4sk thx for all the digging in this issue!
Here is the console log. I wonder why it failed. I'm using "x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z" "lua-5.4.2_Win64_vc17_lib.zip" and "lua-5.4.2_Win64_bin.zip". Would anyone be able to help?