From f320324f091b81c3ec5a26ed16ffc5c0fb49da29 Mon Sep 17 00:00:00 2001 From: Stefan Eilemann Date: Wed, 24 May 2017 13:40:28 +0200 Subject: [PATCH] Release preparations --- .gitexternals | 2 - .gitignore | 1 - .gitmodules | 3 + .gitsubprojects | 6 +- .travis.yml | 2 +- CMake/GitExternal.cmake | 325 ---------------------------------------- CMake/common | 1 + CMakeLists.txt | 7 +- README.md | 4 +- co/connection.h | 2 +- co/connectionSet.cpp | 1 - co/dataIStream.ipp | 1 - co/instanceCache.h | 1 - co/localNode.h | 2 +- co/node.cpp | 10 +- doc/Changelog.md | 2 + 16 files changed, 23 insertions(+), 347 deletions(-) delete mode 100644 .gitexternals create mode 100644 .gitmodules delete mode 100644 CMake/GitExternal.cmake create mode 160000 CMake/common diff --git a/.gitexternals b/.gitexternals deleted file mode 100644 index 7476bdf5a..000000000 --- a/.gitexternals +++ /dev/null @@ -1,2 +0,0 @@ -# -*- mode: cmake -*- -# CMake/common https://github.com/Eyescale/CMake.git 3d5d284 diff --git a/.gitignore b/.gitignore index 6b3f60103..ddb80c860 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,6 @@ tests/client/configVisitor_objc.mm tests/image/images/out_* tt.* tt?.* -CMake/common Lunchbox Pression Servus diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..caa337ef8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "CMake/common"] + path = CMake/common + url = https://github.com/Eyescale/CMake diff --git a/.gitsubprojects b/.gitsubprojects index b3438c139..ac5f8540a 100644 --- a/.gitsubprojects +++ b/.gitsubprojects @@ -1,4 +1,4 @@ # -*- mode: cmake -*- -git_subproject(Servus https://github.com/HBPVIS/Servus.git 36180b5) -git_subproject(Lunchbox https://github.com/Eyescale/Lunchbox.git f05b9c6) -git_subproject(Pression https://github.com/Eyescale/Pression.git bde7574) +git_subproject(Servus https://github.com/HBPVIS/Servus.git eee5765) +git_subproject(Lunchbox https://github.com/Eyescale/Lunchbox.git 867f8d9) +git_subproject(Pression https://github.com/Eyescale/Pression.git 08cd4bf) diff --git a/.travis.yml b/.travis.yml index 1df2f93ec..12b560513 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,5 @@ before_install: script: - mkdir $BUILD_TYPE - cd $BUILD_TYPE - - cmake -GNinja -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. + - cmake -GNinja -DCLONE_SUBPROJECTS=ON -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - ninja all && ninja $PROJECT_NAME-tests && ninja install diff --git a/CMake/GitExternal.cmake b/CMake/GitExternal.cmake deleted file mode 100644 index 2c5e1d367..000000000 --- a/CMake/GitExternal.cmake +++ /dev/null @@ -1,325 +0,0 @@ -# Configures an external git repository -# -# Usage: -# * Automatically reads, parses and updates a .gitexternals file if it only -# contains lines in the form "# ". -# This function parses the file for this pattern and then calls -# git_external on each found entry. Additionally it provides an -# update target to bump the tag to the master revision by -# recreating .gitexternals. -# * Provides function -# git_external( [VERBOSE,SHALLOW] -# [RESET ]) -# which will check out directory in CMAKE_SOURCE_DIR (if relative) -# or in the given absolute path using the given repository and tag -# (commit-ish). -# -# Options which can be supplied to the function: -# VERBOSE, when present, this option tells the function to output -# information about what operations are being performed by git on -# the repo. -# SHALLOW, when present, causes a shallow clone of depth 1 to be made -# of the specified repo. This may save considerable memory/bandwidth -# when only a specific branch of a repo is required and the full history -# is not required. Note that the SHALLOW option will only work for a branch -# or tag and cannot be used for an arbitrary SHA. -# -# Targets: -# * -rebase: fetches latest updates and rebases the given external -# git repository onto it. -# * rebase: Rebases all git externals, including sub projects -# -# Options (global) which control behaviour: -# GIT_EXTERNAL_VERBOSE -# This is a global option which has the same effect as the VERBOSE option, -# with the difference that output information will be produced for all -# external repos when set. -# -# CMake or environment variables: -# GITHUB_USER -# If set, a remote called 'user' is set up for github repositories, pointing -# to git@github.com:/. Also, this remote is used by default -# for 'git push'. - -if(NOT GIT_FOUND) - find_package(Git QUIET) -endif() -if(NOT GIT_EXECUTABLE) - return() -endif() - -include(CMakeParseArguments) -option(GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF) - -if(NOT GITHUB_USER AND DEFINED ENV{GITHUB_USER}) - set(GITHUB_USER $ENV{GITHUB_USER} CACHE STRING - "Github user name used to setup remote for 'user' forks") -endif() - -macro(GIT_EXTERNAL_MESSAGE msg) - if(GIT_EXTERNAL_VERBOSE OR GIT_EXTERNAL_LOCAL_VERBOSE) - message(STATUS "${NAME}: ${msg}") - endif() -endmacro() - -# utility function for printing a list with custom separator -function(JOIN VALUES GLUE OUTPUT) - string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}") - string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping - set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) -endfunction() - -function(GIT_EXTERNAL DIR REPO TAG) - cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;SHALLOW" "" "RESET" ${ARGN}) - - # check if we had a previous external of the same name - string(REGEX REPLACE "[:/]" "_" TARGET "${DIR}") - get_property(OLD_TAG GLOBAL PROPERTY ${TARGET}_GITEXTERNAL_TAG) - if(OLD_TAG) - if(NOT OLD_TAG STREQUAL TAG) - string(REPLACE "${CMAKE_SOURCE_DIR}/" "" PWD - "${CMAKE_CURRENT_SOURCE_DIR}") - git_external_message("${DIR}: already configured with ${OLD_TAG}, ignoring requested ${TAG} in ${PWD}") - return() - endif() - else() - set_property(GLOBAL PROPERTY ${TARGET}_GITEXTERNAL_TAG ${TAG}) - endif() - - if(NOT IS_ABSOLUTE "${DIR}") - set(DIR "${CMAKE_SOURCE_DIR}/${DIR}") - endif() - get_filename_component(NAME "${DIR}" NAME) - get_filename_component(GIT_EXTERNAL_DIR "${DIR}/.." ABSOLUTE) - - if(NOT EXISTS "${DIR}") - # clone - set(_clone_options --recursive) - if(GIT_EXTERNAL_LOCAL_SHALLOW) - list(APPEND _clone_options --depth 1 --branch ${TAG}) - else() - set(_msg_tag "[${TAG}]") - endif() - JOIN("${_clone_options}" " " _msg_text) - message(STATUS "git clone ${_msg_text} ${REPO} ${DIR} ${_msg_tag}") - execute_process( - COMMAND "${GIT_EXECUTABLE}" clone ${_clone_options} ${REPO} ${DIR} - RESULT_VARIABLE nok ERROR_VARIABLE error - WORKING_DIRECTORY "${GIT_EXTERNAL_DIR}") - if(nok) - message(FATAL_ERROR "${DIR} clone failed: ${error}\n") - endif() - - # checkout requested tag - if(NOT GIT_EXTERNAL_LOCAL_SHALLOW) - execute_process( - COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}" - RESULT_VARIABLE nok ERROR_VARIABLE error - WORKING_DIRECTORY "${DIR}") - if(nok) - message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n") - endif() - endif() - - # checkout requested tag - execute_process( - COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}" - RESULT_VARIABLE nok ERROR_VARIABLE error - WORKING_DIRECTORY "${DIR}") - if(nok) - message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n") - endif() - endif() - - # set up "user" remote for github forks and make it default for 'git push' - if(GITHUB_USER AND REPO MATCHES ".*github.com.*") - string(REGEX REPLACE ".*(github.com)[\\/:]().*(\\/.*)" "git@\\1:\\2${GITHUB_USER}\\3" - GIT_EXTERNAL_USER_REPO ${REPO}) - execute_process( - COMMAND "${GIT_EXECUTABLE}" remote add user ${GIT_EXTERNAL_USER_REPO} - OUTPUT_QUIET ERROR_QUIET WORKING_DIRECTORY "${DIR}") - execute_process( - COMMAND "${GIT_EXECUTABLE}" config remote.pushdefault user - OUTPUT_QUIET ERROR_QUIET WORKING_DIRECTORY "${DIR}") - endif() - - file(RELATIVE_PATH __dir ${CMAKE_SOURCE_DIR} ${DIR}) - string(REGEX REPLACE "[:/\\.]" "-" __target "${__dir}") - if(TARGET ${__target}-rebase) - return() - endif() - - set(__rebase_cmake "${CMAKE_CURRENT_BINARY_DIR}/${__target}-rebase.cmake") - file(WRITE ${__rebase_cmake} - "if(NOT IS_DIRECTORY \"${DIR}/.git\")\n" - " message(FATAL_ERROR \"Can't update git external ${__dir}: Not a git repository\")\n" - "endif()\n" - # check if we are already on the requested tag - "execute_process(COMMAND \"${GIT_EXECUTABLE}\" rev-parse --short HEAD\n" - " OUTPUT_VARIABLE currentref OUTPUT_STRIP_TRAILING_WHITESPACE\n" - " WORKING_DIRECTORY \"${DIR}\")\n" - "if(currentref STREQUAL ${TAG}) # nothing to do\n" - " return()\n" - "endif()\n" - "\n" - # reset generated files - "foreach(GIT_EXTERNAL_RESET_FILE ${GIT_EXTERNAL_RESET})\n" - " execute_process(\n" - " COMMAND \"${GIT_EXECUTABLE}\" reset -q \"\${GIT_EXTERNAL_RESET_FILE}\"\n" - " ERROR_QUIET OUTPUT_QUIET\n" - " WORKING_DIRECTORY \"${DIR}\")\n" - " execute_process(\n" - " COMMAND \"${GIT_EXECUTABLE}\" checkout -q -- \"${GIT_EXTERNAL_RESET_FILE}\"\n" - " ERROR_QUIET OUTPUT_QUIET\n" - " WORKING_DIRECTORY \"${DIR}\")\n" - "endforeach()\n" - "\n" - # fetch latest update - "execute_process(COMMAND \"${GIT_EXECUTABLE}\" fetch origin -q\n" - " RESULT_VARIABLE nok ERROR_VARIABLE error\n" - " WORKING_DIRECTORY \"${DIR}\")\n" - "if(nok)\n" - " message(FATAL_ERROR \"Fetch for ${__dir} failed:\n \${error}\")\n" - "endif()\n" - "\n" - # update tag - "execute_process(COMMAND \"${GIT_EXECUTABLE}\" rebase FETCH_HEAD\n" - " RESULT_VARIABLE nok ERROR_VARIABLE error OUTPUT_VARIABLE output\n" - " WORKING_DIRECTORY \"${DIR}\")\n" - "if(nok)\n" - " execute_process(COMMAND \"${GIT_EXECUTABLE}\" rebase --abort\n" - " WORKING_DIRECTORY \"${DIR}\" ERROR_QUIET OUTPUT_QUIET)\n" - " message(FATAL_ERROR \"Rebase ${__dir} failed:\n\${output}\${error}\")\n" - "endif()\n" - "\n" - # checkout requested tag - "execute_process(\n" - " COMMAND \"${GIT_EXECUTABLE}\" checkout -q \"${TAG}\"\n" - " RESULT_VARIABLE nok ERROR_VARIABLE error\n" - " WORKING_DIRECTORY \"${DIR}\")\n" - "if(nok)\n" - " message(FATAL_ERROR \"git checkout ${TAG} in ${__dir} failed: ${error}\n\")\n" - "endif()\n" - ) - - if(NOT GIT_EXTERNAL_SCRIPT_MODE) - add_custom_target(${__target}-rebase - COMMAND ${CMAKE_COMMAND} -P ${__rebase_cmake} - COMMENT "Rebasing ${__dir}") - set_target_properties(${__target}-rebase PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER git) - if(NOT TARGET rebase) - add_custom_target(rebase) - set_target_properties(rebase PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) - endif() - add_dependencies(rebase ${__target}-rebase) - endif() -endfunction() - -set(GIT_EXTERNALS ${GIT_EXTERNALS_FILE}) -if(NOT GIT_EXTERNALS) - set(GIT_EXTERNALS "${CMAKE_CURRENT_SOURCE_DIR}/.gitexternals") -endif() - -if(EXISTS ${GIT_EXTERNALS} AND NOT GIT_EXTERNAL_SCRIPT_MODE) - include(${GIT_EXTERNALS}) - file(READ ${GIT_EXTERNALS} GIT_EXTERNAL_FILE) - string(REGEX REPLACE "\n" ";" GIT_EXTERNAL_FILE "${GIT_EXTERNAL_FILE}") - foreach(LINE ${GIT_EXTERNAL_FILE}) - if(NOT LINE MATCHES "^#.*$") - message(FATAL_ERROR "${GIT_EXTERNALS} contains non-comment line: ${LINE}") - endif() - string(REGEX REPLACE "^#[ ]*(.+[ ]+.+[ ]+.+)$" "\\1" DATA ${LINE}) - if(NOT LINE STREQUAL DATA) - string(REGEX REPLACE "[ ]+" ";" DATA "${DATA}") - list(LENGTH DATA DATA_LENGTH) - if(DATA_LENGTH EQUAL 3) - list(GET DATA 0 DIR) - list(GET DATA 1 REPO) - list(GET DATA 2 TAG) - - # Create a unique, flat name - string(REPLACE "/" "-" GIT_EXTERNAL_NAME ${DIR}_${PROJECT_NAME}) - - if(NOT TARGET update_git_external_${GIT_EXTERNAL_NAME}) # not done - # pull in identified external - git_external(${DIR} ${REPO} ${TAG}) - - # Create update script and target to bump external spec - if(NOT TARGET update) - add_custom_target(update) - endif() - if(NOT TARGET update_git_external) - add_custom_target(update_git_external) - add_custom_target(flatten_git_external) - add_dependencies(update update_git_external) - endif() - - # Create a unique, flat name - file(RELATIVE_PATH GIT_EXTERNALS_BASE ${CMAKE_SOURCE_DIR} - ${GIT_EXTERNALS}) - string(REPLACE "/" "_" GIT_EXTERNAL_TARGET ${GIT_EXTERNALS_BASE}) - - set(GIT_EXTERNAL_TARGET update_git_external_${GIT_EXTERNAL_TARGET}) - if(NOT TARGET ${GIT_EXTERNAL_TARGET}) - set(GIT_EXTERNAL_SCRIPT - "${CMAKE_CURRENT_BINARY_DIR}/${GIT_EXTERNAL_TARGET}.cmake") - file(WRITE "${GIT_EXTERNAL_SCRIPT}" - "file(WRITE ${GIT_EXTERNALS} \"# -*- mode: cmake -*-\n\")\n") - add_custom_target(${GIT_EXTERNAL_TARGET} - COMMAND "${CMAKE_COMMAND}" -DGIT_EXTERNAL_SCRIPT_MODE=1 -P ${GIT_EXTERNAL_SCRIPT} - COMMENT "Recreate ${GIT_EXTERNALS_BASE}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - endif() - - set(GIT_EXTERNAL_SCRIPT - "${CMAKE_CURRENT_BINARY_DIR}/gitupdate${GIT_EXTERNAL_NAME}.cmake") - file(WRITE "${GIT_EXTERNAL_SCRIPT}" " -include(\"${CMAKE_CURRENT_LIST_DIR}/GitExternal.cmake\") -execute_process(COMMAND \"${GIT_EXECUTABLE}\" fetch origin -q - WORKING_DIRECTORY \"${DIR}\") -execute_process( - COMMAND \"${GIT_EXECUTABLE}\" show-ref --hash=7 refs/remotes/origin/master - OUTPUT_VARIABLE newref OUTPUT_STRIP_TRAILING_WHITESPACE - WORKING_DIRECTORY \"${DIR}\") -if(newref) - file(APPEND ${GIT_EXTERNALS} \"# ${DIR} ${REPO} \${newref}\\n\") - git_external(${DIR} ${REPO} \${newref}) -else() - file(APPEND ${GIT_EXTERNALS} \"# ${DIR} ${REPO} ${TAG}\n\") -endif()") - add_custom_target(update_git_external_${GIT_EXTERNAL_NAME} - COMMAND "${CMAKE_COMMAND}" -DGIT_EXTERNAL_SCRIPT_MODE=1 -P ${GIT_EXTERNAL_SCRIPT} - COMMENT "Update ${REPO} in ${GIT_EXTERNALS_BASE}" - DEPENDS ${GIT_EXTERNAL_TARGET} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - add_dependencies(update_git_external - update_git_external_${GIT_EXTERNAL_NAME}) - - # Flattens a git external repository into its parent repo: - # * Clean any changes from external - # * Unlink external from git: Remove external/.git and .gitexternals - # * Add external directory to parent - # * Commit with flattened repo and tag info - # - Depend on release branch checked out - add_custom_target(flatten_git_external_${GIT_EXTERNAL_NAME} - COMMAND "${GIT_EXECUTABLE}" clean -dfx - COMMAND "${CMAKE_COMMAND}" -E remove_directory .git - COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_CURRENT_SOURCE_DIR}/.gitexternals" - COMMAND "${GIT_EXECUTABLE}" add -f . - COMMAND "${GIT_EXECUTABLE}" commit -m "Flatten ${REPO} into ${DIR} at ${TAG}" . "${CMAKE_CURRENT_SOURCE_DIR}/.gitexternals" - COMMENT "Flatten ${REPO} into ${DIR}" - DEPENDS make_branch_${PROJECT_NAME} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}") - add_dependencies(flatten_git_external - flatten_git_external_${GIT_EXTERNAL_NAME}) - - foreach(_target flatten_git_external_${GIT_EXTERNAL_NAME} flatten_git_external update_git_external_${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} update_git_external update) - set_target_properties(${_target} PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER git) - endforeach() - endif() - endif() - endif() - endforeach() -endif() diff --git a/CMake/common b/CMake/common new file mode 160000 index 000000000..e1a5560e7 --- /dev/null +++ b/CMake/common @@ -0,0 +1 @@ +Subproject commit e1a5560e7d1dee3156f4bf988a40ffa025ddacbc diff --git a/CMakeLists.txt b/CMakeLists.txt index f23b36f62..585273cbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,10 @@ project(Collage VERSION 1.7.0) set(Collage_VERSION_ABI 7) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake - ${CMAKE_SOURCE_DIR}/CMake/common) - -include(GitExternal) + ${CMAKE_SOURCE_DIR}/CMake/common) +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/CMake/common/Common.cmake) + message(FATAL_ERROR "CMake/common missing, run: git submodule update --init") +endif() option(COLLAGE_BUILD_V2_API "Enable for pure 2.0 API (breaks compatibility with 1.x API)" OFF) diff --git a/README.md b/README.md index cb47347ba..3d8222520 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ environments are tested: Building from source is as simple as: - git clone https://github.com/Eyescale/Collage.git + git clone --recursive https://github.com/Eyescale/Collage.git mkdir Collage/build cd Collage/build - cmake -GNinja .. + cmake -GNinja .. -DCLONE_SUBPROJECTS=ON ninja diff --git a/co/connection.h b/co/connection.h index d2b0f4ae2..305e567fd 100644 --- a/co/connection.h +++ b/co/connection.h @@ -203,7 +203,7 @@ class Connection : public lunchbox::Referenced, public boost::noncopyable CO_API bool recvSync(BufferPtr& buffer, const bool block = true); BufferPtr resetRecvData(); //!< @internal - //@} + //@} /** @name Synchronous write to the connection */ //@{ diff --git a/co/connectionSet.cpp b/co/connectionSet.cpp index 12d0a98e1..2c90c2cba 100644 --- a/co/connectionSet.cpp +++ b/co/connectionSet.cpp @@ -174,7 +174,6 @@ class ConnectionSet : public ConnectionListener } void interrupt() { selfConnection->set(); } - private: virtual void notifyStateChanged(co::Connection*) { setDirty(); } }; diff --git a/co/dataIStream.ipp b/co/dataIStream.ipp index ab843eb9c..4c53243d6 100644 --- a/co/dataIStream.ipp +++ b/co/dataIStream.ipp @@ -178,7 +178,6 @@ public: { } bool operator()(co::Object* candidate) { return candidate->getID() == _id; } - private: const uint128_t _id; }; diff --git a/co/instanceCache.h b/co/instanceCache.h index 900f91113..691820178 100644 --- a/co/instanceCache.h +++ b/co/instanceCache.h @@ -113,7 +113,6 @@ class InstanceCache void expire(const int64_t age); bool isEmpty() { return _items->empty(); } - private: struct Item { diff --git a/co/localNode.h b/co/localNode.h index c22066cfb..a2a4a32d0 100644 --- a/co/localNode.h +++ b/co/localNode.h @@ -467,7 +467,7 @@ class LocalNode : public lunchbox::RequestHandler, CO_API int64_t getTime64() const; //!< @internal CO_API ssize_t getCounter(const Counter counter) const; //!< @internal - //@} + //@} /** @name Operations */ //@{ diff --git a/co/node.cpp b/co/node.cpp index 549477be1..6c939c1db 100644 --- a/co/node.cpp +++ b/co/node.cpp @@ -525,11 +525,11 @@ void Node::_setLastReceive(const int64_t time) std::ostream& operator<<(std::ostream& os, const State state) { - os << (state == STATE_CLOSED - ? "closed" - : state == STATE_CONNECTED - ? "connected" - : state == STATE_LISTENING ? "listening" : "ERROR"); + os << (state == STATE_CLOSED ? "closed" : state == STATE_CONNECTED + ? "connected" + : state == STATE_LISTENING + ? "listening" + : "ERROR"); return os; } diff --git a/doc/Changelog.md b/doc/Changelog.md index 5e87fe04f..ddf224f96 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -2,6 +2,8 @@ # git master +# Release 1.7 (24-May-2017) + * [207](https://github.com/Eyescale/Collage/pull/207) Support sending of large payload for OCommands * [206](https://github.com/Eyescale/Collage/pull/206)