Skip to content

Commit

Permalink
put things in place for 32-bit testing and builds on both appveyor an…
Browse files Browse the repository at this point in the history
…d travis

pray it doesn't shatter
  • Loading branch information
ThePhD committed Jan 20, 2018
1 parent 1a64ba0 commit bfe696d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 37 deletions.
36 changes: 18 additions & 18 deletions .travis.yml
Expand Up @@ -35,7 +35,7 @@ before_install:
script:
- export SOL2_DIR=${TRAVIS_BUILD_DIR}
- sudo docker image pull thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
- sudo docker run --rm --interactive --tty --name "sol2.test" -v "${SOL2_DIR}:/root/sol2" --env "CI=${CI}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
- sudo docker run --rm --interactive --tty --name "sol2.test" -v "${SOL2_DIR}:/root/sol2" --env "CI=${CI}" --env "PLATFORM=${PLATFORM}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
- sudo docker rmi $(sudo docker image ls -q)

matrix:
Expand All @@ -47,111 +47,111 @@ matrix:
- env:
- LUA_VERSION=5.3.4
GCC_VERSION=4.9
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=5.3.4
GCC_VERSION=5
CI=true
platform=x64
PLATFORM=x64

- env:
- LUA_VERSION=5.3.4
GCC_VERSION=6
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=5.3.4
GCC_VERSION=7
platform=x64
PLATFORM=x64
CI=true

# LLVM 3.6.x -> 5.0.x
- env:
- LUA_VERSION=5.3.4
LLVM_VERSION=3.6.2
platform=x64
PLATFORM=x64
CI=true
ALLOW_FAILURE=true

- env:
- LUA_VERSION=5.3.4
LLVM_VERSION=3.7.1
platform=x64
PLATFORM=x64
CI=true
ALLOW_FAILURE=true

- env:
- LUA_VERSION=5.3.4
LLVM_VERSION=3.8.1
platform=x64
PLATFORM=x64
CI=true
ALLOW_FAILURE=true

- env:
- LUA_VERSION=5.3.4
LLVM_VERSION=3.9.1
platform=x64
PLATFORM=x64
CI=true
ALLOW_FAILURE=true

- env:
- LUA_VERSION=5.3.4
LLVM_VERSION=4.0.1
platform=x64
PLATFORM=x64
CI=true
ALLOW_FAILURE=true

- env:
- LUA_VERSION=5.3.4
LLVM_VERSION=5.0.1
platform=x64
PLATFORM=x64
CI=true
ALLOW_FAILURE=true

# Lua Versions 5.2.4, 5.1.5, and LuaJIT (as well as x86)
- env:
- LUA_VERSION=5.2.4
GCC_VERSION=7
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=5.1.5
GCC_VERSION=7
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=luajit-2.0.4
GCC_VERSION=7
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=luajit-2.0.5
GCC_VERSION=7
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=luajit-2.1.0-beta3
GCC_VERSION=7
platform=x64
PLATFORM=x64
CI=true

- env:
- LUA_VERSION=luajit-2.0.5
GCC_VERSION=7
platform=x86
PLATFORM=x86
CI=true

- env:
- LUA_VERSION=luajit-2.1.0-beta3
GCC_VERSION=7
platform=x86
PLATFORM=x86
CI=true

notifications:
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -59,6 +59,14 @@ if (MSVC)
add_compile_options(/MP)
endif()
else()
if (x86)
list(APPEND CMAKE_C_FLAGS "-m32")
list(APPEND CMAKE_CXX_FLAGS "-m32")
list(APPEND CMAKE_EXE_LINKER_FLAGS "-m32")
list(APPEND CMAKE_MODULE_LINKER_FLAGS "-m32")
list(APPEND CMAKE_STATIC_LINKER_FLAGS "-m32")
list(APPEND CMAKE_SHARED_LINKER_FLAGS "-m32")
endif()
add_compile_options(-Wno-unknown-warning -Wno-unknown-warning-option -Wall -Wextra -Wpedantic -pedantic -pedantic-errors)
endif()

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Expand Up @@ -51,9 +51,10 @@ VOLUME /root/sol2
ARG CI=true
ARG GCC_VERSION
ARG LLVM_VERSION
ARG PLATFORM=x64

# Potential environment variables
ENV GCC_VERSION=${GCC_VERSION} LLVM_VERSION=${LLVM_VERSION} CI=${CI} SOL2_DIR=/root/sol2
ENV CI=${CI} PLATFORM=${PLATFORM} GCC_VERSION=${GCC_VERSION} LLVM_VERSION=${LLVM_VERSION} SOL2_DIR=/root/sol2

RUN ["/usr/bin/env", "zsh", "-e", "/root/sol2-scripts/preparation.linux.sh"]

Expand Down
2 changes: 0 additions & 2 deletions appveyor.yml
Expand Up @@ -70,8 +70,6 @@ matrix:
# Also does not have MinGW x64 for 5.3.0
- image: Visual Studio 2017
MINGW_VERSION: 6.3.0
- platform: x86
MINGW_VERSION: 6.3.0
# LLVM exists in all images, and we only want the VS 2017 x64 versions
- image: Visual Studio 2015
LLVM_VERSION: 4.0.0
Expand Down
15 changes: 7 additions & 8 deletions scripts/build.linux.sh
Expand Up @@ -52,25 +52,24 @@ else
fi

echo "====== ======= ======= ======= ======"
echo "====== Pushing All Docker Images ======"
echo "====== Building All Docker Images ======"
echo "====== ======= ======= ======= ======"

for i in $gcc_versions; do
GCC_VERSION=$i
unset LLVM_VERSION
echo "====== Pushing Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} ======="
docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
echo "====== Building Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} ======="
docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}"
done

for i in $llvm_versions; do
LLVM_VERSION=$i
unset GCC_VERSION
echo "====== Pushing Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} ======="
docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
echo "====== Building Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} ======="
docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}"
done

unset LLVM_VERSION
unset GCC_VERSION
echo "====== Pushing Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} ======="
docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}

echo "====== Building Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} ======="
docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}"
12 changes: 6 additions & 6 deletions scripts/preparation.linux.sh
Expand Up @@ -32,7 +32,7 @@ build_dir="$(pwd)"
echo "#\!/usr/bin/env zsh\n\n" > "sol2.compiler.vars"

# # Initial and necessary installations
apt-get -y install ninja-build libreadline6 libreadline6-dev python3 wget curl libcurl3 cmake git
apt-get update && apt-get -y install ninja-build libreadline6 libreadline6-dev lib32readline6 lib32readline6-dev python3 wget curl libcurl3 cmake git

# # LLVM and GCC updates
# Grab LLVM or GCC
Expand Down Expand Up @@ -93,13 +93,13 @@ then
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get -y update
apt-get -y dist-upgrade
apt-get -y install gcc-$GCC_VERSION g++-$GCC_VERSION
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 60 --slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION
apt-get -y install gcc-${GCC_VERSION} g++-${GCC_VERSION} gcc-${GCC_VERSION}-multilib g++-${GCC_VERSION}-multilib
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 60 --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION}
update-alternatives --config gcc
export CC=gcc-$GCC_VERSION
export CXX=g++-$GCC_VERSION
export CC=gcc-${GCC_VERSION}
export CXX=g++-${GCC_VERSION}
else
apt-get -y install build-essential
apt-get -y install build-essential gcc-multilib g++-multilib
export CC=cc
export CXX=c++
fi
Expand Down
4 changes: 2 additions & 2 deletions scripts/run.linux.sh
Expand Up @@ -70,7 +70,7 @@ echo -en "travis_fold:end:build_preparation.2\r"

echo -en "travis_fold:start:build.debug\r"
cd Debug
cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON
cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -D${PLATFORM}=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON
cmake --build . --config Debug
echo -en "travis_fold:end:build.debug\r"
echo -en "travis_fold:start:test.debug\r"
Expand All @@ -80,7 +80,7 @@ echo -en "travis_fold:end:test.debug\r"

echo "travis_fold:start:build.release\r"
cd Release
cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON
cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -D${PLATFORM}=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON
cmake --build . --config Release
echo -en "travis_fold:end:build.release\r"
echo -en "travis_fold:start:test.release\r"
Expand Down

0 comments on commit bfe696d

Please sign in to comment.