Skip to content

Fix luajit rolling release build in msys shell#54

Open
tobil4sk wants to merge 1 commit intoluarocks:masterfrom
tobil4sk:fix/windows-msys-shell
Open

Fix luajit rolling release build in msys shell#54
tobil4sk wants to merge 1 commit intoluarocks:masterfrom
tobil4sk:fix/windows-msys-shell

Conversation

@tobil4sk
Copy link

The SHELL=cmd argument is needed when running hererocks from cmd or powershell, because in that case luajit will use dos commands.

However, if MSYSTEM or TERM are defined (e.g. in a msys shell) then luajit will build using bash commands and the build will fail with the error below.

To fix this, this patch respects the same variables that luajit uses to decide whether to use dos or unix commands. SHELL=cmd is no longer set in a unix environment, but still is in a dos environment.

See luajit src/Makefile:
https://github.com/LuaJIT/LuaJIT/blob/26fd1a7d6770b2237240a071e6f01132877a2425/src/Makefile#L157

Current build error:

Building LuaJIT @26fd1a7 (target: mingw)
"==== Building LuaJIT 2.1 ===="
mingw32-make -C src
mingw32-make[1]: Entering directory 'C:/Users/RUNNER~1/AppData/Local/Temp/tmpadzy1my3/LuaJIT/src'
"HOSTCC    host/minilua.o"
"HOSTLINK  host/minilua.exe"
"VERSION   luajit.h"
Error: host/genversion.lua:14: run from the wrong directory
mingw32-make[1]: *** [Makefile:673: luajit.h] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/RUNNER~1/AppData/Local/Temp/tmpadzy1my3/LuaJIT/src'
mingw32-make: *** [Makefile:127: default] Error 2
Error: got exitcode 2 from command mingw32-make SHELL=cmd

Closes #53.

Related to #26.

cc: @un-def

The SHELL=cmd argument is needed when running hererocks from cmd or
powershell, because in that case luajit will use dos commands.

However, if MSYSTEM or TERM are defined (e.g. in a msys shell) then
luajit will build using bash commands and the build will fail with the
error below.

To fix this, this patch respects the same variables that luajit uses to
decide whether to use dos or unix commands. SHELL=cmd is no longer set
in a unix environment, but still is in a dos environment.

See luajit src/Makefile:
https://github.com/LuaJIT/LuaJIT/blob/26fd1a7d6770b2237240a071e6f01132877a2425/src/Makefile#L157

Current build error:
```
Building LuaJIT @26fd1a7 (target: mingw)
"==== Building LuaJIT 2.1 ===="
mingw32-make -C src
mingw32-make[1]: Entering directory 'C:/Users/RUNNER~1/AppData/Local/Temp/tmpadzy1my3/LuaJIT/src'
"HOSTCC    host/minilua.o"
"HOSTLINK  host/minilua.exe"
"VERSION   luajit.h"
Error: host/genversion.lua:14: run from the wrong directory
mingw32-make[1]: *** [Makefile:673: luajit.h] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/RUNNER~1/AppData/Local/Temp/tmpadzy1my3/LuaJIT/src'
mingw32-make: *** [Makefile:127: default] Error 2
Error: got exitcode 2 from command mingw32-make SHELL=cmd
```
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.

Failing to build luajit rolling release on windows

1 participant