Fix Travis build (#4101)
Stop using gdb on osx - was breaking the build Add clang 3.5 build as travis now defaults to 5.0 Fix unknown-warning-option errors on AppleClang ProtoProxy: Use nullptr UrlClientTest: add override to callback destructor Update jsoncpp to use nullptr
This commit is contained in:
parent
a9c8ad9ce2
commit
832b394715
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -21,7 +21,7 @@
|
|||||||
ignore = dirty
|
ignore = dirty
|
||||||
[submodule "lib/jsoncpp"]
|
[submodule "lib/jsoncpp"]
|
||||||
path = lib/jsoncpp
|
path = lib/jsoncpp
|
||||||
url = https://github.com/open-source-parsers/jsoncpp.git
|
url = https://github.com/cuberite/jsoncpp.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
[submodule "lib/TCLAP"]
|
[submodule "lib/TCLAP"]
|
||||||
path = lib/TCLAP
|
path = lib/TCLAP
|
||||||
|
77
.travis.yml
77
.travis.yml
@ -1,40 +1,73 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
os:
|
# Use Linux by default
|
||||||
- linux
|
os: linux
|
||||||
- osx
|
|
||||||
|
|
||||||
compiler:
|
|
||||||
- clang
|
|
||||||
- gcc
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
exclude:
|
include:
|
||||||
|
# AppleClang
|
||||||
|
# OSX workers are slower to start up. Having these first in the build matrix makes travis faster overall.
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: gcc
|
compiler: clang
|
||||||
|
env: &Release
|
||||||
addons:
|
- TRAVIS_CUBERITE_BUILD_TYPE=RELEASE CUBERITE_PATH=./Cuberite
|
||||||
|
- os: osx
|
||||||
|
compiler: clang
|
||||||
|
env: &Debug
|
||||||
|
- TRAVIS_CUBERITE_BUILD_TYPE=DEBUG CUBERITE_PATH=./Cuberite_debug
|
||||||
|
# Default clang
|
||||||
|
- compiler: clang
|
||||||
|
addons: &gdb
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- gdb
|
||||||
|
env: *Release
|
||||||
|
- compiler: clang
|
||||||
|
addons: *gdb
|
||||||
|
env: *Debug
|
||||||
|
# clang 3.5
|
||||||
|
- compiler: clang
|
||||||
|
addons: &clang35
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.5
|
||||||
|
packages:
|
||||||
|
- clang++-3.5
|
||||||
|
- clang-3.5
|
||||||
|
- gdb
|
||||||
|
before_install:
|
||||||
|
- CC=clang-3.5;CXX=clang++-3.5
|
||||||
|
env: *Release
|
||||||
|
- compiler: clang
|
||||||
|
addons: *clang35
|
||||||
|
before_install:
|
||||||
|
- CC=clang-3.5;CXX=clang++-3.5
|
||||||
|
env: *Debug
|
||||||
|
# gcc 4.8
|
||||||
|
- compiler: gcc
|
||||||
|
addons: &gcc48
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
|
- gcc-4.8
|
||||||
- gdb
|
- gdb
|
||||||
|
before_install:
|
||||||
|
- CC=gcc-4.8;CXX=g++-4.8
|
||||||
before_script:
|
env: *Release
|
||||||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
- compiler: gcc
|
||||||
brew update;
|
addons: *gcc48
|
||||||
brew install gdb;
|
before_install:
|
||||||
fi
|
- CC=gcc-4.8;CXX=g++-4.8
|
||||||
|
env: *Debug
|
||||||
|
|
||||||
script: ./CIbuild.sh
|
script: ./CIbuild.sh
|
||||||
|
|
||||||
env:
|
|
||||||
- TRAVIS_CUBERITE_BUILD_TYPE=RELEASE CUBERITE_PATH=./Cuberite
|
|
||||||
- TRAVIS_CUBERITE_BUILD_TYPE=DEBUG CUBERITE_PATH=./Cuberite_debug
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
on_success: change
|
on_success: change
|
||||||
|
23
CIbuild.sh
23
CIbuild.sh
@ -6,11 +6,6 @@ export CUBERITE_BUILD_SERIES_NAME="Travis $CC $TRAVIS_CUBERITE_BUILD_TYPE"
|
|||||||
export CUBERITE_BUILD_ID=$TRAVIS_JOB_NUMBER
|
export CUBERITE_BUILD_ID=$TRAVIS_JOB_NUMBER
|
||||||
export CUBERITE_BUILD_DATETIME=`date`
|
export CUBERITE_BUILD_DATETIME=`date`
|
||||||
|
|
||||||
if [ "$CXX" == "g++" ]; then
|
|
||||||
# This is a temporary workaround to allow the identification of GCC-4.8 by CMake, required for C++11 features
|
|
||||||
# Travis Docker containers don't allow sudo, which update-alternatives needs, and it seems no alternative to this command is provided, hence:
|
|
||||||
export CXX="/usr/bin/g++-4.8"
|
|
||||||
fi
|
|
||||||
cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1;
|
cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1;
|
||||||
|
|
||||||
echo "Building..."
|
echo "Building..."
|
||||||
@ -22,22 +17,22 @@ echo -e "define hook-quit\n\tset confirm off\nend\n" > ~/.gdbinit
|
|||||||
|
|
||||||
echo "Testing..."
|
echo "Testing..."
|
||||||
|
|
||||||
# OSX builds need sudo because gdb isn't signed
|
# OSX builds don't have gdb
|
||||||
if [ "$TRAVIS_OS_NAME" = osx ]; then
|
if [ "$TRAVIS_OS_NAME" = osx ]; then
|
||||||
GDB_COMMAND="sudo gdb"
|
GDB_COMMAND=""
|
||||||
else
|
else
|
||||||
GDB_COMMAND="gdb"
|
GDB_COMMAND="gdb -return-child-result -ex run -ex \"bt\" -ex \"info threads\" -ex \"thread apply all bt\" -ex \"quit\" --args"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd Server/;
|
cd Server/;
|
||||||
touch apiCheckFailed.flag
|
touch apiCheckFailed.flag
|
||||||
if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then
|
if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then
|
||||||
${GDB_COMMAND} -return-child-result -ex run -ex "bt" -ex "info threads" -ex "thread apply all bt" -ex "quit" --args $CUBERITE_PATH << EOF
|
${GDB_COMMAND} ${CUBERITE_PATH} <<- EOF
|
||||||
load APIDump
|
load APIDump
|
||||||
apicheck
|
apicheck
|
||||||
restart
|
restart
|
||||||
stop
|
stop
|
||||||
EOF
|
EOF
|
||||||
if [ -f ./NewlyUndocumented.lua ]; then
|
if [ -f ./NewlyUndocumented.lua ]; then
|
||||||
echo "ERROR: Newly undocumented API symbols found:"
|
echo "ERROR: Newly undocumented API symbols found:"
|
||||||
cat ./NewlyUndocumented.lua
|
cat ./NewlyUndocumented.lua
|
||||||
|
@ -77,7 +77,7 @@ Install git, make, cmake and clang (or gcc), using your platform's package manag
|
|||||||
```
|
```
|
||||||
sudo apt-get install git make cmake clang
|
sudo apt-get install git make cmake clang
|
||||||
```
|
```
|
||||||
Ensure that you have modern C++ compiler and linker (Clang 3.4+, GCC 4.8+, or VS 2013+).
|
Ensure that you have modern C++ compiler and linker (Clang 3.5+, GCC 4.8+, or VS 2013+).
|
||||||
|
|
||||||
### Getting the Source
|
### Getting the Source
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ struct sChunkMeta
|
|||||||
|
|
||||||
cConnection::cConnection(SOCKET a_ClientSocket, cServer & a_Server) :
|
cConnection::cConnection(SOCKET a_ClientSocket, cServer & a_Server) :
|
||||||
m_ItemIdx(0),
|
m_ItemIdx(0),
|
||||||
m_LogFile(NULL),
|
m_LogFile(nullptr),
|
||||||
m_Server(a_Server),
|
m_Server(a_Server),
|
||||||
m_ClientSocket(a_ClientSocket),
|
m_ClientSocket(a_ClientSocket),
|
||||||
m_ServerSocket(-1),
|
m_ServerSocket(-1),
|
||||||
@ -252,7 +252,7 @@ void cConnection::Run(void)
|
|||||||
FD_SET(m_ServerSocket, &ReadFDs);
|
FD_SET(m_ServerSocket, &ReadFDs);
|
||||||
FD_SET(m_ClientSocket, &ReadFDs);
|
FD_SET(m_ClientSocket, &ReadFDs);
|
||||||
SOCKET MaxSocket = std::max(m_ServerSocket, m_ClientSocket);
|
SOCKET MaxSocket = std::max(m_ServerSocket, m_ClientSocket);
|
||||||
int res = select(MaxSocket + 1, &ReadFDs, NULL, NULL, NULL);
|
int res = select(MaxSocket + 1, &ReadFDs, nullptr, nullptr, nullptr);
|
||||||
if (res <= 0)
|
if (res <= 0)
|
||||||
{
|
{
|
||||||
printf("select() failed: %d; aborting client", SocketError);
|
printf("select() failed: %d; aborting client", SocketError);
|
||||||
@ -2571,7 +2571,7 @@ bool cConnection::HandleServerUpdateTileEntity(void)
|
|||||||
AString fnam;
|
AString fnam;
|
||||||
Printf(fnam, "%s_tile_%08x.nbt", m_LogNameBase.c_str(), m_ItemIdx++);
|
Printf(fnam, "%s_tile_%08x.nbt", m_LogNameBase.c_str(), m_ItemIdx++);
|
||||||
FILE * f = fopen(fnam.c_str(), "wb");
|
FILE * f = fopen(fnam.c_str(), "wb");
|
||||||
if (f != NULL)
|
if (f != nullptr)
|
||||||
{
|
{
|
||||||
fwrite(Data.data(), 1, Data.size(), f);
|
fwrite(Data.data(), 1, Data.size(), f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@ -2730,7 +2730,7 @@ bool cConnection::ParseSlot(cByteBuffer & a_Buffer, AString & a_ItemDesc)
|
|||||||
AString fnam;
|
AString fnam;
|
||||||
Printf(fnam, "%s_item_%08x.nbt", m_LogNameBase.c_str(), m_ItemIdx++);
|
Printf(fnam, "%s_item_%08x.nbt", m_LogNameBase.c_str(), m_ItemIdx++);
|
||||||
FILE * f = fopen(fnam.c_str(), "wb");
|
FILE * f = fopen(fnam.c_str(), "wb");
|
||||||
if (f != NULL)
|
if (f != nullptr)
|
||||||
{
|
{
|
||||||
fwrite(Metadata.data(), 1, Metadata.size(), f);
|
fwrite(Metadata.data(), 1, Metadata.size(), f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 81cf237917b6873decd27e15b7fe8473003a2762
|
Subproject commit d5ba7e7332ca05aa0a9740b497f914be27181774
|
@ -168,7 +168,7 @@ set_source_files_properties(${BINDING_OUTPUTS} PROPERTIES GENERATED TRUE)
|
|||||||
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/Bindings/Bindings.cpp PROPERTIES COMPILE_FLAGS -Wno-error)
|
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/Bindings/Bindings.cpp PROPERTIES COMPILE_FLAGS -Wno-error)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) # Workaround for VERSION_GREATER_EQUAL, which is only supported on CMake 3.7+
|
if(NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) # Workaround for VERSION_GREATER_EQUAL, which is only supported on CMake 3.7+
|
||||||
set(ADDITIONAL_FLAGS "-Wno-zero-as-null-pointer-constant")
|
set(ADDITIONAL_FLAGS "-Wno-zero-as-null-pointer-constant")
|
||||||
endif()
|
endif()
|
||||||
set_source_files_properties(Bindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast -Wno-missing-prototypes ${ADDITIONAL_FLAGS}")
|
set_source_files_properties(Bindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast -Wno-missing-prototypes ${ADDITIONAL_FLAGS}")
|
||||||
|
10
src/main.cpp
10
src/main.cpp
@ -73,10 +73,12 @@ bool cRoot::m_RunAsService = false;
|
|||||||
|
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
// Because SIG_DFL or SIG_IGN could be NULL instead of nullptr, we need to disable the Clang warning here
|
// Because SIG_DFL or SIG_IGN could be NULL instead of nullptr, we need to disable the Clang warning here
|
||||||
#if __clang_major__ >= 5
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||||
|
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||||
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||||
#endif
|
#endif // __clang__
|
||||||
|
|
||||||
static void NonCtrlHandler(int a_Signal)
|
static void NonCtrlHandler(int a_Signal)
|
||||||
{
|
{
|
||||||
@ -122,9 +124,9 @@ static void NonCtrlHandler(int a_Signal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __clang_major__ >= 5
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif // __clang__
|
||||||
#endif // _DEBUG
|
#endif // _DEBUG
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
~cCallbacks()
|
virtual ~cCallbacks() override
|
||||||
{
|
{
|
||||||
LOGD("Deleting the cCallbacks instance at %p", reinterpret_cast<void *>(this));
|
LOGD("Deleting the cCallbacks instance at %p", reinterpret_cast<void *>(this));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user