From 24276270dd64ad58ffc80cef5f08167e002b151f Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sun, 3 Apr 2016 22:55:44 +0300 Subject: [PATCH 1/8] switch appveyor build to hererocks --- .appveyor/install.bat | 217 ------------------------------------------ appveyor.yml | 34 +++---- 2 files changed, 13 insertions(+), 238 deletions(-) delete mode 100644 .appveyor/install.bat diff --git a/.appveyor/install.bat b/.appveyor/install.bat deleted file mode 100644 index 59b1ed7..0000000 --- a/.appveyor/install.bat +++ /dev/null @@ -1,217 +0,0 @@ -@echo off - -cd %APPVEYOR_BUILD_FOLDER% - -:: ========================================================= -:: Set some defaults. Infer some variables. -:: -:: These are set globally -if "%LUA_VER%" NEQ "" ( - set LUA=lua - set LUA_SHORTV=%LUA_VER:~0,3% -) else ( - set LUA=luajit - set LJ_SHORTV=%LJ_VER:~0,3% - set LUA_SHORTV=5.1 -) - -:: defines LUA_DIR so Cmake can find this Lua install -if "%LUA%"=="luajit" ( - set LUA_DIR=c:\lua\%platform%\lj%LJ_SHORTV% -) else ( - set LUA_DIR=c:\lua\%platform%\%LUA_VER% -) - -:: Now we declare a scope -Setlocal EnableDelayedExpansion EnableExtensions - -set LUAROCKS_SHORTV=%LUAROCKS_VER:~0,3% - -if not defined LUAROCKS_URL set LUAROCKS_URL=http://keplerproject.github.io/luarocks/releases -if not defined LUAROCKS_REPO set LUAROCKS_REPO=http://rocks.moonscript.org -if not defined LUA_URL set LUA_URL=http://www.lua.org/ftp -if defined NOCOMPAT ( - set COMPATFLAG=--nocompat -) else ( - set COMPATFLAG= -) -if not defined LUAJIT_GIT_REPO set LUAJIT_GIT_REPO=https://github.com/LuaJIT/LuaJIT.git -if not defined LUAJIT_URL set LUAJIT_URL=https://github.com/LuaJIT/LuaJIT/archive - -if not defined LR_EXTERNAL set LR_EXTERNAL=c:\external -if not defined LUAROCKS_INSTALL set LUAROCKS_INSTALL=%LUA_DIR%\LuaRocks -if not defined LR_ROOT set LR_ROOT=%LUAROCKS_INSTALL%\%LUAROCKS_SHORTV% -if not defined LR_SYSTREE set LR_SYSTREE=%LUAROCKS_INSTALL%\systree - -if not defined SEVENZIP set SEVENZIP=7z -:: -:: ========================================================= - -:: first create some necessary directories: -mkdir downloads 2>NUL - -:: Download and compile Lua (or LuaJIT) -if "%LUA%"=="luajit" ( - if not exist %LUA_DIR% ( - if "%LJ_SHORTV%"=="2.1" ( - :: Clone repository and checkout 2.1 branch - set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER% - if not exist !lj_source_folder! ( - echo Cloning git repo %LUAJIT_GIT_REPO% !lj_source_folder! - git clone %LUAJIT_GIT_REPO% !lj_source_folder! || call :die "Failed to clone repository" - ) - cd !lj_source_folder!\src - git checkout v2.1 || call :die - ) else ( - set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER% - if not exist !lj_source_folder! ( - echo Downloading... %LUAJIT_URL%/v%LJ_VER%.tar.gz - curl --location --silent --fail --max-time 120 --connect-timeout 30 %LUAJIT_URL%/v%LJ_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads - ) - cd !lj_source_folder!\src - ) - :: Compiles LuaJIT - call msvcbuild.bat - - mkdir %LUA_DIR% 2> NUL - for %%a in (bin bin\lua bin\lua\jit include lib) do ( mkdir "%LUA_DIR%\%%a" ) - - for %%a in (luajit.exe lua51.dll) do ( move "!lj_source_folder!\src\%%a" "%LUA_DIR%\bin" ) - copy "%LUA_DIR%\bin\luajit.exe" "%LUA_DIR%\bin\lua.exe" - - move "!lj_source_folder!\src\lua51.lib" "%LUA_DIR%\lib" - for %%a in (lauxlib.h lua.h lua.hpp luaconf.h lualib.h luajit.h) do ( - copy "!lj_source_folder!\src\%%a" "%LUA_DIR%\include" - ) - - copy "!lj_source_folder!\src\jit\*.lua" "%LUA_DIR%\bin\lua\jit" - - ) else ( - echo LuaJIT %LJ_VER% already installed at %LUA_DIR% - ) -) else ( - if not exist %LUA_DIR% ( - :: Download and compile Lua - if not exist downloads\lua-%LUA_VER% ( - curl --silent --fail --max-time 120 --connect-timeout 30 %LUA_URL%/lua-%LUA_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads - ) - - mkdir downloads\lua-%LUA_VER%\etc 2> NUL - if not exist downloads\lua-%LUA_VER%\etc\winmake.bat ( - curl --silent --location --insecure --fail --max-time 120 --connect-timeout 30 https://github.com/Tieske/luawinmake/archive/master.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% e -si -ttar -aoa -odownloads\lua-%LUA_VER%\etc luawinmake-master\etc\winmake.bat - ) - - cd downloads\lua-%LUA_VER% - call etc\winmake %COMPATFLAG% - call etc\winmake install %LUA_DIR% - ) else ( - echo Lua %LUA_VER% already installed at %LUA_DIR% - ) -) - -if not exist %LUA_DIR%\bin\%LUA%.exe call :die "Missing Lua interpreter at %LUA_DIR%\bin\%LUA%.exe" - -set PATH=%LUA_DIR%\bin;%PATH% -call !LUA! -v - - - -:: ========================================================= -:: LuaRocks -:: ========================================================= - -if not exist "%LR_ROOT%" ( - :: Downloads and installs LuaRocks - cd %APPVEYOR_BUILD_FOLDER% - - if not exist downloads\luarocks-%LUAROCKS_VER%-win32.zip ( - echo Downloading LuaRocks... - curl --silent --fail --max-time 120 --connect-timeout 30 --output downloads\luarocks-%LUAROCKS_VER%-win32.zip %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip - %SEVENZIP% x -aoa -odownloads downloads\luarocks-%LUAROCKS_VER%-win32.zip - ) - - cd downloads\luarocks-%LUAROCKS_VER%-win32 - call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%" -) - -if not exist "%LR_ROOT%" call :die "LuaRocks not found at %LR_ROOT%" - -set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH% - -:: Lua will use just the system rocks -set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua -set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua -set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua -set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll - -call luarocks --version || call :die "Error with LuaRocks installation" -call luarocks list - - -if not exist "%LR_EXTERNAL%" ( - mkdir "%LR_EXTERNAL%" - mkdir "%LR_EXTERNAL%\lib" - mkdir "%LR_EXTERNAL%\include" -) - -set PATH=%LR_EXTERNAL%;%PATH% - -:: Exports the following variables: -:: (beware of whitespace between & and ^ below) -endlocal & set PATH=%PATH%&^ -set LR_SYSTREE=%LR_SYSTREE%&^ -set LUA_PATH=%LUA_PATH%&^ -set LUA_CPATH=%LUA_CPATH%&^ -set LR_EXTERNAL=%LR_EXTERNAL% - -echo. -echo ====================================================== -if "%LUA%"=="luajit" ( - echo Installation of LuaJIT %LJ_VER% and LuaRocks %LUAROCKS_VER% done. -) else ( - echo Installation of Lua %LUA_VER% and LuaRocks %LUAROCKS_VER% done. - if defined NOCOMPAT echo Lua was built with compatibility flags disabled. -) -echo Platform - %platform% -echo LUA - %LUA% -echo LUA_SHORTV - %LUA_SHORTV% -echo LJ_SHORTV - %LJ_SHORTV% -echo LUA_PATH - %LUA_PATH% -echo LUA_CPATH - %LUA_CPATH% -echo. -echo LR_EXTERNAL - %LR_EXTERNAL% -echo ====================================================== -echo. - -goto :eof - - - - - - - - - - - - - - - - - - -:: This blank space is intentional. If you see errors like "The system cannot find the batch label specified 'foo'" -:: then try adding or removing blank lines lines above. -:: Yes, really. -:: http://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e - -:: helper functions: - -:: for bailing out when an error occurred -:die %1 -echo %1 -exit /B 1 -goto :eof - diff --git a/appveyor.yml b/appveyor.yml index a32d0c7..8af7be8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,22 +1,19 @@ version: 0.0.1.{build}-test +shallow_clone: true + os: - Windows Server 2012 R2 -shallow_clone: true - environment: - LUAROCKS_VER: 2.2.2 + LuaRocks: 2.3.0 matrix: - - LUA_VER: 5.1.5 - - LUA_VER: 5.2.4 - - LUA_VER: 5.2.4 - NOCOMPAT: true - - LUA_VER: 5.3.0 - - LUA_VER: 5.3.0 - NOCOMPAT: true - - LJ_VER: 2.0.3 - - LJ_VER: 2.1 + - Lua: lua 5.3 + - Lua: luajit 2.0 + +configuration: + - vs + - mingw platform: - x86 @@ -27,23 +24,18 @@ matrix: # LuaJIT crashes on C++ exception on x86 allow_failures: - platform: x86 - LJ_VER: 2.0.3 - - platform: x86 - LJ_VER: 2.1 + Lua: luajit 2.0 cache: #- c:\lua -> appveyor.yml - c:\external -> appveyor.yml - c:\blast -> appveyor.yml -init: -# Setup Lua development/build environment -# Make VS 2013 command line tools available -- call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %platform% - install: # Setup Lua development/build environment -- call .appveyor\install.bat +- PATH %CD%\here\bin;C:\mingw\bin;%PATH% +- curl --location --silent --fail --max-time 120 --connect-timeout 30 https://raw.githubusercontent.com/mpeterv/hererocks/latest/hererocks.py > hererocks.py +- python hererocks.py here --%Lua% --luarocks=%LuaRocks% --verbose --target=%Configuration% --no-git-cache # Downloand and install blast to c:\blast - call .appveyor\install_blast.bat - luarocks install "https://gist.githubusercontent.com/starius/719b194bb34ce612458c/raw/7ab5aa457164c5dccef2c06e0e06ffbed09319df/mediator_lua-1.1.1-0.rockspec" From 2c172c3b71e7f2f7cf6fabbc22ca4d2d1b43faf9 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sun, 3 Apr 2016 23:39:51 +0300 Subject: [PATCH 2/8] appveyor: use hererocks from master --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8af7be8..df83d3f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ cache: install: # Setup Lua development/build environment - PATH %CD%\here\bin;C:\mingw\bin;%PATH% -- curl --location --silent --fail --max-time 120 --connect-timeout 30 https://raw.githubusercontent.com/mpeterv/hererocks/latest/hererocks.py > hererocks.py +- curl --location --silent --fail --max-time 120 --connect-timeout 30 https://raw.githubusercontent.com/mpeterv/hererocks/master/hererocks.py > hererocks.py - python hererocks.py here --%Lua% --luarocks=%LuaRocks% --verbose --target=%Configuration% --no-git-cache # Downloand and install blast to c:\blast - call .appveyor\install_blast.bat From d754352205b79aa912ee997f4dd0e828b7580ac9 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sun, 3 Apr 2016 23:40:06 +0300 Subject: [PATCH 3/8] appveyor: use vs_32 and vs_64 --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index df83d3f..8772c3c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,9 @@ environment: - Lua: luajit 2.0 configuration: - - vs - mingw + - vs_32 + - vs_64 platform: - x86 From edf2337834977ecc0b4cc45c08c56371c8d3d6bb Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 4 Apr 2016 00:46:58 +0300 Subject: [PATCH 4/8] appveyor: remove platform section --- appveyor.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8772c3c..0730dad 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,10 +16,6 @@ configuration: - vs_32 - vs_64 -platform: - - x86 - - x64 - # this is how to allow failing jobs in the matrix matrix: # LuaJIT crashes on C++ exception on x86 From f26d7590e0bfd00115f90d814de02e04ce0c0217 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 4 Apr 2016 00:58:53 +0300 Subject: [PATCH 5/8] appveyor: don't pass VS CFLAGS to MinGW --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0730dad..50bfe92 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,7 +45,9 @@ install: - luarocks install tree build_script: -- luarocks make BOOST_INCDIR=c:\Libraries\boost "CFLAGS=/nologo /MD /O2 /EHa" +- set lua_npge_cflags="/nologo /MD /O2 /EHa" +- if "%Configuration%" EQU "mingw" ( set lua_npge_cflags="-O2" ) +- luarocks make BOOST_INCDIR=c:\Libraries\boost CFLAGS=%lua_npge_cflags% test_script: - cd %APPVEYOR_BUILD_FOLDER% From bfa7eee4872d69387ed8a8b7beb44bfa43ce1025 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 4 Apr 2016 08:31:38 +0300 Subject: [PATCH 6/8] appveyor: remove allow_failures --- appveyor.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 50bfe92..8b4147f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,13 +16,6 @@ configuration: - vs_32 - vs_64 -# this is how to allow failing jobs in the matrix -matrix: - # LuaJIT crashes on C++ exception on x86 - allow_failures: - - platform: x86 - Lua: luajit 2.0 - cache: #- c:\lua -> appveyor.yml - c:\external -> appveyor.yml From 53bfa32a34ee2131af4fd08f4edac3d24434b024 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sat, 9 Apr 2016 21:55:29 +0300 Subject: [PATCH 7/8] appveyor: use Lua 5.3.1 instead of Lua 5.3.2 Lua 5.3.2 introduces a bug [1] which hits my code [2]. [1] http://permalink.gmane.org/gmane.comp.lang.lua.general/120954 [2] https://travis-ci.org/npge/lua-npge/jobs/116739679#L1848 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8b4147f..60fd8ed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ os: environment: LuaRocks: 2.3.0 matrix: - - Lua: lua 5.3 + - Lua: lua 5.3.1 - Lua: luajit 2.0 configuration: From 23e310df5d2ebf80b24ddf657f3e6473f11991c0 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Thu, 30 Jun 2016 23:19:47 +0300 Subject: [PATCH 8/8] appveyor: use hererocks from pip --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 60fd8ed..ab53923 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,8 +24,8 @@ cache: install: # Setup Lua development/build environment - PATH %CD%\here\bin;C:\mingw\bin;%PATH% -- curl --location --silent --fail --max-time 120 --connect-timeout 30 https://raw.githubusercontent.com/mpeterv/hererocks/master/hererocks.py > hererocks.py -- python hererocks.py here --%Lua% --luarocks=%LuaRocks% --verbose --target=%Configuration% --no-git-cache +- python -m pip install hererocks +- python -m hererocks here --%Lua% --luarocks=%LuaRocks% --verbose --target=%Configuration% --no-git-cache # Downloand and install blast to c:\blast - call .appveyor\install_blast.bat - luarocks install "https://gist.githubusercontent.com/starius/719b194bb34ce612458c/raw/7ab5aa457164c5dccef2c06e0e06ffbed09319df/mediator_lua-1.1.1-0.rockspec"