From 8c542f42bc9084b357738a2bc75a8bffa87d0ed3 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 14:55:18 +0100 Subject: [PATCH 01/16] ci: clang: always use libc++ --- .github/workflows/cmake-build-ci.gen | 19 ++++++++++++++++++- .github/workflows/cmake-build-ci.yml | 5 +++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index e4bc6785..0376fd3a 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -39,13 +39,30 @@ const ENV = [ "INSTALL_CC" => "gcc-10", "INSTALL_CXX" => "g++-10", ] + ], + "clang" => [ + "new" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + "cur" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + "old" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], ] ], "ubuntu-18.04" => [ "clang" => [ + "new" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + "cur" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], "old" => [ "CXXFLAGS" => "-stdlib=libc++" - ] + ], ] ] ]; diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml index 5b2c8e8a..b8548a6d 100644 --- a/.github/workflows/cmake-build-ci.yml +++ b/.github/workflows/cmake-build-ci.yml @@ -439,16 +439,19 @@ jobs: run: | echo CC="clang-10" >> ${GITHUB_ENV} echo CXX="clang++-10" >> ${GITHUB_ENV} + echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - name: Prepare environment (for cur clang on ubuntu-20.04) if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur') run: | echo CC="clang-9" >> ${GITHUB_ENV} echo CXX="clang++-9" >> ${GITHUB_ENV} + echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - name: Prepare environment (for old clang on ubuntu-20.04) if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='old') run: | echo CC="clang-8" >> ${GITHUB_ENV} echo CXX="clang++-8" >> ${GITHUB_ENV} + echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - name: Prepare environment (for new gnu on ubuntu-18.04) if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new') run: | @@ -469,11 +472,13 @@ jobs: run: | echo CC="clang-9" >> ${GITHUB_ENV} echo CXX="clang++-9" >> ${GITHUB_ENV} + echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - name: Prepare environment (for cur clang on ubuntu-18.04) if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur') run: | echo CC="clang-8" >> ${GITHUB_ENV} echo CXX="clang++-8" >> ${GITHUB_ENV} + echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - name: Prepare environment (for old clang on ubuntu-18.04) if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='old') run: | -- 2.30.2 From b0d3e9495b7efb51b47ea77075e9f5a2c59ef63f Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 15:06:34 +0100 Subject: [PATCH 02/16] ci: gh-actions: package: exclude only conflicting ubuntu18-gnu-new --- .github/workflows/cmake-build-ci.gen | 2 +- .github/workflows/cmake-build-ci.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index 0376fd3a..1e268f6a 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -248,7 +248,7 @@ function steps_package() { - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml index b8548a6d..1823cc3b 100644 --- a/.github/workflows/cmake-build-ci.yml +++ b/.github/workflows/cmake-build-ci.yml @@ -103,7 +103,7 @@ jobs: - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package @@ -181,7 +181,7 @@ jobs: - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package @@ -252,7 +252,7 @@ jobs: - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package @@ -323,7 +323,7 @@ jobs: - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package @@ -386,7 +386,7 @@ jobs: - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package @@ -534,7 +534,7 @@ jobs: - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release' + if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package -- 2.30.2 From 4dbf7c03641596dd9cd080c05761d159371219d9 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 16:15:46 +0100 Subject: [PATCH 03/16] ci: gh-actions: clang+libc++ cannot find headers --- .github/workflows/cmake-build-ci.gen | 72 +++++++++++++++------------- .github/workflows/cmake-build-ci.yml | 2 + 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index 1e268f6a..9494590b 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -32,40 +32,6 @@ const DEF = [ "CXX" => "mingw", ] ]; -const ENV = [ - "ubuntu-20.04" => [ - "gnu" => [ - "new" => [ - "INSTALL_CC" => "gcc-10", - "INSTALL_CXX" => "g++-10", - ] - ], - "clang" => [ - "new" => [ - "CXXFLAGS" => "-stdlib=libc++" - ], - "cur" => [ - "CXXFLAGS" => "-stdlib=libc++" - ], - "old" => [ - "CXXFLAGS" => "-stdlib=libc++" - ], - ] - ], - "ubuntu-18.04" => [ - "clang" => [ - "new" => [ - "CXXFLAGS" => "-stdlib=libc++" - ], - "cur" => [ - "CXXFLAGS" => "-stdlib=libc++" - ], - "old" => [ - "CXXFLAGS" => "-stdlib=libc++" - ], - ] - ] -]; const MAP = [ 'env.OS_VER' => [ "ubuntu-20.04" => [ @@ -106,6 +72,44 @@ const MAP = [ ], ] ]; +const ENV = [ + "ubuntu-20.04" => [ + "gnu" => [ + "new" => [ + "INSTALL_CC" => "gcc-10", + "INSTALL_CXX" => "g++-10", + ] + ], + "clang" => [ + "new" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + "cur" => [ + "CXXFLAGS" => "-stdlib=libc++", + "INSTALL_CXX" => "libc++" + . MAP["env.OS_VER"]["ubuntu-20.04"]["env.CC_VND"]["clang"]["env.CC_VER"]["cur"] . "-dev" + ], + "old" => [ + "CXXFLAGS" => "-stdlib=libc++", + "INSTALL_CXX" => "libc++" + . MAP["env.OS_VER"]["ubuntu-20.04"]["env.CC_VND"]["clang"]["env.CC_VER"]["old"] . "-dev" + ], + ] + ], + "ubuntu-18.04" => [ + "clang" => [ + "new" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + "cur" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + "old" => [ + "CXXFLAGS" => "-stdlib=libc++" + ], + ] + ] +]; /** * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml index 1823cc3b..1599bed7 100644 --- a/.github/workflows/cmake-build-ci.yml +++ b/.github/workflows/cmake-build-ci.yml @@ -446,12 +446,14 @@ jobs: echo CC="clang-9" >> ${GITHUB_ENV} echo CXX="clang++-9" >> ${GITHUB_ENV} echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} + echo INSTALL_CXX="libc++-9-dev" >> ${GITHUB_ENV} - name: Prepare environment (for old clang on ubuntu-20.04) if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='old') run: | echo CC="clang-8" >> ${GITHUB_ENV} echo CXX="clang++-8" >> ${GITHUB_ENV} echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} + echo INSTALL_CXX="libc++-8-dev" >> ${GITHUB_ENV} - name: Prepare environment (for new gnu on ubuntu-18.04) if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new') run: | -- 2.30.2 From 85f5404daca70a8bc772c5e0670b22f68ad9d76d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 16:27:01 +0100 Subject: [PATCH 04/16] ci: gh-actions: clang+libc++ cannot find headers --- .github/workflows/cmake-build-ci.gen | 6 ++---- .github/workflows/cmake-build-ci.yml | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index 9494590b..dd170e3b 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -86,13 +86,11 @@ const ENV = [ ], "cur" => [ "CXXFLAGS" => "-stdlib=libc++", - "INSTALL_CXX" => "libc++" - . MAP["env.OS_VER"]["ubuntu-20.04"]["env.CC_VND"]["clang"]["env.CC_VER"]["cur"] . "-dev" + "INSTALL_CXX" => "libc++-9-dev libc++abi-9-dev" ], "old" => [ "CXXFLAGS" => "-stdlib=libc++", - "INSTALL_CXX" => "libc++" - . MAP["env.OS_VER"]["ubuntu-20.04"]["env.CC_VND"]["clang"]["env.CC_VER"]["old"] . "-dev" + "INSTALL_CXX" => "libc++-8-dev libc++abi-8-dev" ], ] ], diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml index 1599bed7..9d9c6a36 100644 --- a/.github/workflows/cmake-build-ci.yml +++ b/.github/workflows/cmake-build-ci.yml @@ -446,14 +446,14 @@ jobs: echo CC="clang-9" >> ${GITHUB_ENV} echo CXX="clang++-9" >> ${GITHUB_ENV} echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - echo INSTALL_CXX="libc++-9-dev" >> ${GITHUB_ENV} + echo INSTALL_CXX="libc++-9-dev libc++abi-9-dev" >> ${GITHUB_ENV} - name: Prepare environment (for old clang on ubuntu-20.04) if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='old') run: | echo CC="clang-8" >> ${GITHUB_ENV} echo CXX="clang++-8" >> ${GITHUB_ENV} echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV} - echo INSTALL_CXX="libc++-8-dev" >> ${GITHUB_ENV} + echo INSTALL_CXX="libc++-8-dev libc++abi-8-dev" >> ${GITHUB_ENV} - name: Prepare environment (for new gnu on ubuntu-18.04) if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new') run: | -- 2.30.2 From 9b0cb8f7aac22ccb4eff6dcabcae4db627217efa Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 17:11:44 +0100 Subject: [PATCH 05/16] ci: gh-actions: notify gitter --- .github/notify-gitter.sh | 0 .github/workflows/cmake-build-ci.gen | 1 + .github/workflows/cmake-build-ci.yml | 6 ++++++ 3 files changed, 7 insertions(+) mode change 100644 => 100755 .github/notify-gitter.sh diff --git a/.github/notify-gitter.sh b/.github/notify-gitter.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index dd170e3b..e8484a50 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -263,6 +263,7 @@ function steps_package() { function steps_notify($os_vnd) { ?> - name: Notify Gitter + if: success() || failure() run: bash .github/notify-gitter.sh ${{ secrets.GITTER }} ${{ job.status }} Date: Mon, 21 Dec 2020 19:06:45 +0100 Subject: [PATCH 06/16] ci: sr.ht: notify gitter --- .builds/alpine.yml | 13 +++++++++---- .builds/freebsd.yml | 25 +++++++++++++++---------- .builds/openbsd.yml | 24 ++++++++++++++---------- .builds/scripts/maybe | 14 ++++++++++++++ .builds/scripts/notify-gitter | 31 +++++++++++++++++++++++++++++++ .builds/scripts/prepare | 2 ++ 6 files changed, 85 insertions(+), 24 deletions(-) create mode 100755 .builds/scripts/maybe create mode 100755 .builds/scripts/notify-gitter create mode 100755 .builds/scripts/prepare diff --git a/.builds/alpine.yml b/.builds/alpine.yml index 1fbd9667..c8cda83f 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -12,16 +12,21 @@ sources: - https://github.com/m6w6/libmemcached secrets: - 685c5b0a-395c-4031-97f8-97496bb6c25f + - 79d59693-c250-4eba-9569-24650f86256b environment: ENABLE_HASH_HSIEH: "ON" ENABLE_MEMASLAP: "ON" VERBOSE: "ON" tasks: + - prepare: | + ./libmemcached/.builds/scripts/prepare - configure: | - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -S libmemcached -B debug + maybe cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -S libmemcached -B debug - build: | - cmake --build debug -j2 + maybe cmake --build debug -j2 - test: | - cmake --build debug -j2 --target test + maybe cmake --build debug -j2 --target test - install: | - cmake --install debug --prefix /tmp + maybe cmake --install debug --prefix /tmp + - success: | + maybe diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index 18692c35..bdfd7113 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -3,6 +3,7 @@ packages: - autotools - bison - cmake + - curl - cyrus-sasl - flex - libevent @@ -22,28 +23,32 @@ environment: VERBOSE: "ON" MEMCACHED_BINARY: "/home/build/memcached/work/stage/home/build/bin/memcached" tasks: + - prepare: | + ./libmemcached/.builds/scripts/prepare - memcached: | ln -s /usr/ports/Mk . ln -s /usr/ports/Templates . cp -R /usr/ports/databases/memcached . cd memcached echo bin/memcached > pkg-plist - make all install PREFIX=/home/build \ + maybe make all install PREFIX=/home/build \ INSTALL_AS_USER=1 NO_PKG_REGISTER=1 \ SASLPWDB_CONFIGURE_ENABLE=sasl-pwdb \ OPTIONS_SET="SASL SASLPWDB" \ OPTIONS_DEFINE="SASL SASLPWDB" - configure: | - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -S libmemcached -B debug + maybe cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -S libmemcached -B debug - build: | - cmake --build debug -j2 + maybe cmake --build debug -j2 - test: | - cmake --build debug -j2 --target test + maybe cmake --build debug -j2 --target test - install: | - cmake --install debug --prefix /tmp + maybe cmake --install debug --prefix /tmp - package: | - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCS_MANGZ=ON -S libmemcached -B release - cmake --build release -j2 --target package -- VERBOSE= - cmake -DCPACK_COMPONENT_INSTALL=ON release - cmake --build release -j2 --target package -- VERBOSE= - cmake --build release -j2 --target push-artifacts -- VERBOSE= + maybe cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCS_MANGZ=ON -S libmemcached -B release + maybe cmake --build release -j2 --target package -- VERBOSE= + maybe cmake -DCPACK_COMPONENT_INSTALL=ON release + maybe cmake --build release -j2 --target package -- VERBOSE= + maybe cmake --build release -j2 --target push-artifacts -- VERBOSE= + - success: | + maybe diff --git a/.builds/openbsd.yml b/.builds/openbsd.yml index ce5cef13..968bf9ac 100644 --- a/.builds/openbsd.yml +++ b/.builds/openbsd.yml @@ -2,7 +2,7 @@ image: openbsd/latest packages: - bison - cmake - - cyrus-sasl-- + - curl-- - libevent - memcached-- - pkgconf @@ -22,17 +22,21 @@ environment: VERBOSE: "ON" MEMCACHED_BINARY: "memcached" tasks: + - prepare: | + ./libmemcached/.builds/scripts/prepare - configure: | - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -S libmemcached -B debug + maybe cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -S libmemcached -B debug - build: | - cmake --build debug -j2 + maybe cmake --build debug -j2 - test: | - cmake --build debug -j2 --target test + maybe cmake --build debug -j2 --target test - install: | - cmake --install debug --prefix /tmp + maybe cmake --install debug --prefix /tmp - package: | - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCS_MANGZ=ON -S libmemcached -B release - cmake --build release -j2 --target package -- VERBOSE= - cmake -DCPACK_COMPONENT_INSTALL=ON release - cmake --build release -j2 --target package -- VERBOSE= - cmake --build release -j2 --target push-artifacts -- VERBOSE= + maybe cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCS_MANGZ=ON -S libmemcached -B release + maybe cmake --build release -j2 --target package -- VERBOSE= + maybe cmake -DCPACK_COMPONENT_INSTALL=ON release + maybe cmake --build release -j2 --target package -- VERBOSE= + maybe cmake --build release -j2 --target push-artifacts -- VERBOSE= + - success: + maybe diff --git a/.builds/scripts/maybe b/.builds/scripts/maybe new file mode 100755 index 00000000..0a5b6616 --- /dev/null +++ b/.builds/scripts/maybe @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +if test $# -eq 0 +then + notify-gitter success +fi + +"$@" +ERROR=$? + +if test $ERROR -ne 0 +then + notify-gitter failure + exit $ERROR +fi diff --git a/.builds/scripts/notify-gitter b/.builds/scripts/notify-gitter new file mode 100755 index 00000000..f16c2fe4 --- /dev/null +++ b/.builds/scripts/notify-gitter @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -eu + +GITTER=$(cat ~/.gitter) +STATUS=$1 + +REPO=m6w6/libmemcached +REF=$(git describe --abbrev --always libmemcached) +REF_URL=https://github.com/${REPO}/commits/${REF} + +BUILD_URL=${JOB_URL} +BUILD_TAG=$(uname -o) +if test "$BUILD_TAG" = "GNU/Linux" +then + BUILD_TAG=$(lsb_release -irs) +fi +BUILD_CXX=$(c++ --version | head -1) +BUILD_ENV=${BUILD_TAG}/${BUILD_CXX} + +case "$STATUS" in +success) + LEVEL=info + ;; +*) + LEVEL=error + ;; +esac +MESSAGE="Sourcehut [${REPO}](${REF_URL}) (${REF}) [${STATUS}](${BUILD_URL}) (${BUILD_ENV})" + +curl -sS "${GITTER}" --data-urlencode "level=${LEVEL}" --data-urlencode "message=${MESSAGE}" + diff --git a/.builds/scripts/prepare b/.builds/scripts/prepare new file mode 100755 index 00000000..c3273558 --- /dev/null +++ b/.builds/scripts/prepare @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo 'PATH="$PATH:~/libmemcached/.builds/scripts"' >~/.buildenv -- 2.30.2 From 8ea10d6b17c1eb260a2710bf1a6e29d759245e29 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 19:30:50 +0100 Subject: [PATCH 07/16] fix secrets --- .builds/freebsd.yml | 1 + .builds/openbsd.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index bdfd7113..646a04e4 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -16,6 +16,7 @@ sources: - https://github.com/m6w6/libmemcached secrets: - 685c5b0a-395c-4031-97f8-97496bb6c25f + - 79d59693-c250-4eba-9569-24650f86256b environment: ENABLE_HASH_HSIEH: "ON" ENABLE_MEMASLAP: "ON" diff --git a/.builds/openbsd.yml b/.builds/openbsd.yml index 968bf9ac..859eda82 100644 --- a/.builds/openbsd.yml +++ b/.builds/openbsd.yml @@ -16,6 +16,7 @@ sources: - https://github.com/m6w6/libmemcached secrets: - 685c5b0a-395c-4031-97f8-97496bb6c25f + - 79d59693-c250-4eba-9569-24650f86256b environment: ENABLE_HASH_HSIEH: "ON" ENABLE_MEMASLAP: "OFF" -- 2.30.2 From e1c1ed153ae73c920757a1bd195888a3894405ee Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 21:56:32 +0100 Subject: [PATCH 08/16] ci: sr.ht: fix git ref --- .builds/scripts/notify-gitter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.builds/scripts/notify-gitter b/.builds/scripts/notify-gitter index f16c2fe4..c5f1f2bd 100755 --- a/.builds/scripts/notify-gitter +++ b/.builds/scripts/notify-gitter @@ -5,7 +5,7 @@ GITTER=$(cat ~/.gitter) STATUS=$1 REPO=m6w6/libmemcached -REF=$(git describe --abbrev --always libmemcached) +REF=$(GIT_DIR=libmemcached/.git git describe --abbrev --always) REF_URL=https://github.com/${REPO}/commits/${REF} BUILD_URL=${JOB_URL} -- 2.30.2 From efeacc93d17bfaad48e9b7422aebd35e4968c00c Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 22:19:53 +0100 Subject: [PATCH 09/16] ci: sr.ht: fix env --- .builds/scripts/prepare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.builds/scripts/prepare b/.builds/scripts/prepare index c3273558..5ddc015e 100755 --- a/.builds/scripts/prepare +++ b/.builds/scripts/prepare @@ -1,2 +1,2 @@ #!/usr/bin/env bash -echo 'PATH="$PATH:~/libmemcached/.builds/scripts"' >~/.buildenv +echo 'PATH="$PATH:~/libmemcached/.builds/scripts"' >>~/.buildenv -- 2.30.2 From 73f50b9f3710b7897e1f4c5ee738b3958100a7fe Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 23:14:13 +0100 Subject: [PATCH 10/16] ci: sr.ht: fix gitter notify --- .builds/alpine.yml | 4 ++-- .builds/freebsd.yml | 4 ++-- .builds/openbsd.yml | 4 ++-- .builds/scripts/maybe | 5 ----- .builds/scripts/notify-gitter | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.builds/alpine.yml b/.builds/alpine.yml index c8cda83f..0ee825b1 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -12,7 +12,7 @@ sources: - https://github.com/m6w6/libmemcached secrets: - 685c5b0a-395c-4031-97f8-97496bb6c25f - - 79d59693-c250-4eba-9569-24650f86256b + - d7dfe587-b433-481b-8725-d7ccd82e59fb environment: ENABLE_HASH_HSIEH: "ON" ENABLE_MEMASLAP: "ON" @@ -29,4 +29,4 @@ tasks: - install: | maybe cmake --install debug --prefix /tmp - success: | - maybe + notify-gitter success diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index 646a04e4..e9add60b 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -16,7 +16,7 @@ sources: - https://github.com/m6w6/libmemcached secrets: - 685c5b0a-395c-4031-97f8-97496bb6c25f - - 79d59693-c250-4eba-9569-24650f86256b + - d7dfe587-b433-481b-8725-d7ccd82e59fb environment: ENABLE_HASH_HSIEH: "ON" ENABLE_MEMASLAP: "ON" @@ -52,4 +52,4 @@ tasks: maybe cmake --build release -j2 --target package -- VERBOSE= maybe cmake --build release -j2 --target push-artifacts -- VERBOSE= - success: | - maybe + notify-gitter success diff --git a/.builds/openbsd.yml b/.builds/openbsd.yml index 859eda82..e437f625 100644 --- a/.builds/openbsd.yml +++ b/.builds/openbsd.yml @@ -16,7 +16,7 @@ sources: - https://github.com/m6w6/libmemcached secrets: - 685c5b0a-395c-4031-97f8-97496bb6c25f - - 79d59693-c250-4eba-9569-24650f86256b + - d7dfe587-b433-481b-8725-d7ccd82e59fb environment: ENABLE_HASH_HSIEH: "ON" ENABLE_MEMASLAP: "OFF" @@ -40,4 +40,4 @@ tasks: maybe cmake --build release -j2 --target package -- VERBOSE= maybe cmake --build release -j2 --target push-artifacts -- VERBOSE= - success: - maybe + notify-gitter success diff --git a/.builds/scripts/maybe b/.builds/scripts/maybe index 0a5b6616..8ac824db 100755 --- a/.builds/scripts/maybe +++ b/.builds/scripts/maybe @@ -1,9 +1,4 @@ #!/usr/bin/env bash -if test $# -eq 0 -then - notify-gitter success -fi - "$@" ERROR=$? diff --git a/.builds/scripts/notify-gitter b/.builds/scripts/notify-gitter index c5f1f2bd..7be63d08 100755 --- a/.builds/scripts/notify-gitter +++ b/.builds/scripts/notify-gitter @@ -9,7 +9,7 @@ REF=$(GIT_DIR=libmemcached/.git git describe --abbrev --always) REF_URL=https://github.com/${REPO}/commits/${REF} BUILD_URL=${JOB_URL} -BUILD_TAG=$(uname -o) +BUILD_TAG=$(uname -o 2>/dev/null || uname -s) if test "$BUILD_TAG" = "GNU/Linux" then BUILD_TAG=$(lsb_release -irs) -- 2.30.2 From e95ca0e7956f0d54b318284167a39aa3fd74c89c Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 21 Dec 2020 23:31:06 +0100 Subject: [PATCH 11/16] release 1.1.0-beta1 --- ChangeLog-1.1.md | 4 ++-- docs/source/ChangeLog-1.1.rst | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog-1.1.md b/ChangeLog-1.1.md index b4fbe119..de38ca82 100644 --- a/ChangeLog-1.1.md +++ b/ChangeLog-1.1.md @@ -1,8 +1,8 @@ # ChangeLog v1.1 -## v 1.1.0 +## v 1.1.0-beta1 -> released YYYY-MM-DD +> released 2020-12-21 **NOTE:** This is a bug fix release, not a feature release. The minor version number diff --git a/docs/source/ChangeLog-1.1.rst b/docs/source/ChangeLog-1.1.rst index 788b1d18..324ef7b2 100644 --- a/docs/source/ChangeLog-1.1.rst +++ b/docs/source/ChangeLog-1.1.rst @@ -5,12 +5,12 @@ ChangeLog v1.1 ============== -v 1.1.0 -------- +v 1.1.0-beta1 +------------- .. - released YYYY-MM-DD + released 2020-12-21 **NOTE:** -- 2.30.2 From b67f4bdf1fb6bf72e6cb26a1f06cd54d7683c12a Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 22 Dec 2020 00:22:10 +0100 Subject: [PATCH 12/16] ci: gh-actions dispatch/release --- .github/workflows/cmake-build-ci.gen | 3 +++ .github/workflows/cmake-build-ci.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index e8484a50..5cdc10c8 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -297,6 +297,9 @@ function env_override($os_vnd, $cc_vnd = null) { ?> name: cmake-build-ci on: + workflow_dispatch: + release: + types: [published] push: paths: - "contrib/**" diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml index 56e9bcba..729c7af7 100644 --- a/.github/workflows/cmake-build-ci.yml +++ b/.github/workflows/cmake-build-ci.yml @@ -1,6 +1,9 @@ # Generated file; do not edit! name: cmake-build-ci on: + workflow_dispatch: + release: + types: [published] push: paths: - "contrib/**" -- 2.30.2 From 5070db19f82c59353c86b3d43d81f309cdaab250 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 23 Dec 2020 10:00:35 +0100 Subject: [PATCH 13/16] Revert "semver: 1.0 -> 1" This reverts commit 3ffc968aaf182bf1ff1e18157c7bde2bdb41668d and 3ffc968aaf182bf1ff1e18157c7bde2bdb41668d. --- CMake/InstallPublicHeaders.cmake | 4 +- CMakeVersions.txt | 8 +- ChangeLog-1.1.md | 4 - contrib/bin/memaslap/ms_conn.h | 2 +- docs/source/ChangeLog-1.1.rst | 6 - docs/source/libmemcached/versioning.rst | 12 +- example/interface_v0.cc | 2 +- example/interface_v1.cc | 2 +- example/memcached_light.cc | 2 +- include/CMakeLists.txt | 26 +--- include/libhashkit-1.0 | 1 - .../CMakeLists.txt | 2 +- .../algorithm.h | 0 .../basic_string.h | 0 .../behavior.h | 0 .../configure.h.in | 0 .../{libhashkit-1 => libhashkit-1.0}/digest.h | 0 .../function.h | 0 .../{libhashkit-1 => libhashkit-1.0}/has.h | 0 .../hashkit.h | 22 +-- .../hashkit.hpp | 2 +- .../str_algorithm.h | 0 .../strerror.h | 0 .../{libhashkit-1 => libhashkit-1.0}/string.h | 0 .../{libhashkit-1 => libhashkit-1.0}/types.h | 0 .../visibility.h | 0 include/libmemcached-1.0 | 1 - .../CMakeLists.txt | 2 +- .../alloc.h | 0 .../allocators.h | 0 .../analyze.h | 2 +- .../auto.h | 0 .../basic_string.h | 0 .../behavior.h | 0 .../callback.h | 0 .../callbacks.h | 0 .../configure.h.in | 0 .../defaults.h | 0 .../delete.h | 0 .../deprecated_types.h | 0 .../dump.h | 0 .../encoding_key.h | 0 .../error.h | 0 .../exception.hpp | 0 .../exist.h | 0 .../fetch.h | 0 .../flush.h | 0 .../flush_buffers.h | 0 .../get.h | 0 .../hash.h | 0 .../limits.h | 0 .../memcached.h | 126 +++++++++--------- .../memcached.hpp | 2 +- .../options.h | 0 .../parse.h | 0 .../platform.h | 2 +- .../quit.h | 0 .../result.h | 2 +- .../return.h | 0 .../sasl.h | 2 +- .../server.h | 2 +- .../server_list.h | 0 .../stats.h | 2 +- .../storage.h | 0 .../strerror.h | 0 .../struct/CMakeLists.txt | 2 +- .../struct/allocator.h | 0 .../struct/analysis.h | 0 .../struct/callback.h | 0 .../struct/memcached.h | 0 .../struct/result.h | 0 .../struct/sasl.h | 0 .../struct/server.h | 2 +- .../struct/stat.h | 0 .../struct/string.h | 0 .../touch.h | 0 .../triggers.h | 0 .../types.h | 0 .../types/CMakeLists.txt | 2 +- .../types/behavior.h | 0 .../types/callback.h | 0 .../types/connection.h | 0 .../types/hash.h | 0 .../types/return.h | 0 .../types/server_distribution.h | 0 .../verbosity.h | 0 .../version.h | 0 .../visibility.h | 0 include/libmemcachedprotocol-0.0 | 1 - .../CMakeLists.txt | 2 +- .../binary.h | 2 +- .../callback.h | 0 .../handler.h | 8 +- .../vbucket.h | 0 include/libmemcachedutil-1.0 | 1 - .../CMakeLists.txt | 2 +- .../flush.h | 0 .../ostream.hpp | 0 .../pid.h | 0 .../ping.h | 0 .../pool.h | 2 +- .../util.h | 12 +- .../version.h | 0 src/bin/memcapable.cc | 4 +- src/bin/memparse.cc | 2 +- src/libhashkit/common.h | 2 +- src/libhashkit/hashkit.h | 2 +- src/libmemcached/common.h | 4 +- src/libmemcached/memcached.h | 2 +- src/libmemcached/memcached.hpp | 2 +- src/libmemcached/util.h | 2 +- src/libmemcachedprotocol/common.h | 2 +- src/libmemcachedutil/common.h | 2 +- src/p9y/gettimeofday.hpp | 2 +- src/p9y/poll.hpp | 2 +- src/p9y/socket.hpp | 2 +- src/win32/wrappers.h | 104 +++++++++++++++ support/ax_libmemcached.m4 | 16 +-- test/tests/hashkit/basic.cpp | 2 +- .../memcached/regression/lp_000-962-815.cpp | 2 +- test/tests/memcached/util_pool_thread.cpp | 2 +- 121 files changed, 252 insertions(+), 178 deletions(-) delete mode 120000 include/libhashkit-1.0 rename include/{libhashkit-1 => libhashkit-1.0}/CMakeLists.txt (88%) rename include/{libhashkit-1 => libhashkit-1.0}/algorithm.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/basic_string.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/behavior.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/configure.h.in (100%) rename include/{libhashkit-1 => libhashkit-1.0}/digest.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/function.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/has.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/hashkit.h (83%) rename include/{libhashkit-1 => libhashkit-1.0}/hashkit.hpp (98%) rename include/{libhashkit-1 => libhashkit-1.0}/str_algorithm.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/strerror.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/string.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/types.h (100%) rename include/{libhashkit-1 => libhashkit-1.0}/visibility.h (100%) delete mode 120000 include/libmemcached-1.0 rename include/{libmemcached-1 => libmemcached-1.0}/CMakeLists.txt (97%) rename include/{libmemcached-1 => libmemcached-1.0}/alloc.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/allocators.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/analyze.h (96%) rename include/{libmemcached-1 => libmemcached-1.0}/auto.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/basic_string.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/behavior.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/callback.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/callbacks.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/configure.h.in (100%) rename include/{libmemcached-1 => libmemcached-1.0}/defaults.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/delete.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/deprecated_types.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/dump.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/encoding_key.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/error.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/exception.hpp (100%) rename include/{libmemcached-1 => libmemcached-1.0}/exist.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/fetch.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/flush.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/flush_buffers.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/get.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/hash.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/limits.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/memcached.h (50%) rename include/{libmemcached-1 => libmemcached-1.0}/memcached.hpp (99%) rename include/{libmemcached-1 => libmemcached-1.0}/options.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/parse.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/platform.h (97%) rename include/{libmemcached-1 => libmemcached-1.0}/quit.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/result.h (98%) rename include/{libmemcached-1 => libmemcached-1.0}/return.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/sasl.h (97%) rename include/{libmemcached-1 => libmemcached-1.0}/server.h (98%) rename include/{libmemcached-1 => libmemcached-1.0}/server_list.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/stats.h (97%) rename include/{libmemcached-1 => libmemcached-1.0}/storage.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/strerror.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/CMakeLists.txt (85%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/allocator.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/analysis.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/callback.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/memcached.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/result.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/sasl.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/server.h (98%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/stat.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/struct/string.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/touch.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/triggers.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types/CMakeLists.txt (83%) rename include/{libmemcached-1 => libmemcached-1.0}/types/behavior.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types/callback.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types/connection.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types/hash.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types/return.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/types/server_distribution.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/verbosity.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/version.h (100%) rename include/{libmemcached-1 => libmemcached-1.0}/visibility.h (100%) delete mode 120000 include/libmemcachedprotocol-0.0 rename include/{libmemcachedprotocol-0 => libmemcachedprotocol-0.0}/CMakeLists.txt (75%) rename include/{libmemcachedprotocol-0 => libmemcachedprotocol-0.0}/binary.h (99%) rename include/{libmemcachedprotocol-0 => libmemcachedprotocol-0.0}/callback.h (100%) rename include/{libmemcachedprotocol-0 => libmemcachedprotocol-0.0}/handler.h (97%) rename include/{libmemcachedprotocol-0 => libmemcachedprotocol-0.0}/vbucket.h (100%) delete mode 120000 include/libmemcachedutil-1.0 rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/CMakeLists.txt (83%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/flush.h (100%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/ostream.hpp (100%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/pid.h (100%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/ping.h (100%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/pool.h (98%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/util.h (79%) rename include/{libmemcachedutil-1 => libmemcachedutil-1.0}/version.h (100%) create mode 100644 src/win32/wrappers.h diff --git a/CMake/InstallPublicHeaders.cmake b/CMake/InstallPublicHeaders.cmake index ae2fa711..05629d67 100644 --- a/CMake/InstallPublicHeaders.cmake +++ b/CMake/InstallPublicHeaders.cmake @@ -23,8 +23,8 @@ function(install_public_headers DIRECTORY) string(TOUPPER ${LIBRARY} LIBRARY_UCASE) math(EXPR DASH "${DASH} + 1") string(SUBSTRING ${TOP} ${DASH} -1 VERSION) - if(NOT ${LIBRARY_UCASE}_VERSION_MAJOR VERSION_EQUAL ${VERSION}) - message(SEND_ERROR "${LIBRARY} public include directory version ${VERSION} != " ${${LIBRARY_UCASE}_VERSION_MAJOR}) + if(NOT ${LIBRARY_UCASE}_VERSION_INC VERSION_EQUAL ${VERSION}) + message(SEND_ERROR "${LIBRARY} public include directory version ${VERSION} != " ${${LIBRARY_UCASE}_VERSION_INC}) set(ENV{INVALID_CONFIGURATION} 1) endif() endif() diff --git a/CMakeVersions.txt b/CMakeVersions.txt index 965c1106..aa77bdaa 100644 --- a/CMakeVersions.txt +++ b/CMakeVersions.txt @@ -22,10 +22,11 @@ endfunction() # set(LIBMEMCACHED_VERSION_MAJOR 1) -set(LIBMEMCACHED_VERSION_MINOR 1) -set(LIBMEMCACHED_VERSION_PATCH 0) +set(LIBMEMCACHED_VERSION_MINOR 0) +set(LIBMEMCACHED_VERSION_PATCH 99) set(LIBMEMCACHED_VERSION ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}.${LIBMEMCACHED_VERSION_PATCH}) +set(LIBMEMCACHED_VERSION_INC ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}) to_hex(LIBMEMCACHED_VERSION_HEX ${LIBMEMCACHED_VERSION_MAJOR} ${LIBMEMCACHED_VERSION_MINOR} ${LIBMEMCACHED_VERSION_PATCH}) # libmemcached.so @@ -45,6 +46,7 @@ set(LIBMEMCACHEDUTIL_VERSION_MINOR 0) set(LIBMEMCACHEDUTIL_VERSION_PATCH 0) set(LIBMEMCACHEDUTIL_VERSION ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR}.${LIBMEMCACHEDUTIL_VERSION_PATCH}) +set(LIBMEMCACHEDUTIL_VERSION_INC ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR}) to_hex(LIBMEMCACHEDUTIL_VERSION_HEX ${LIBMEMCACHEDUTIL_VERSION_MAJOR} ${LIBMEMCACHEDUTIL_VERSION_MINOR} ${LIBMEMCACHEDUTIL_VERSION_PATCH}) # libmemcachedutil.so @@ -64,6 +66,7 @@ set(LIBMEMCACHEDPROTOCOL_VERSION_MINOR 0) set(LIBMEMCACHEDPROTOCOL_VERSION_PATCH 0) set(LIBMEMCACHEDPROTOCOL_VERSION ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR}.${LIBMEMCACHEDPROTOCOL_VERSION_PATCH}) +set(LIBMEMCACHEDPROTOCOL_VERSION_INC ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR}) to_hex(LIBMEMCACHEDPROTOCOL_VERSION_HEX ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR} ${LIBMEMCACHEDPROTOCOL_VERSION_MINOR} ${LIBMEMCACHEDPROTOCOL_VERSION_PATCH}) # libmemcachedprotocol.so @@ -83,6 +86,7 @@ set(LIBHASHKIT_VERSION_MINOR 0) set(LIBHASHKIT_VERSION_PATCH 0) set(LIBHASHKIT_VERSION ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}.${LIBHASHKIT_VERSION_PATCH}) +set(LIBHASHKIT_VERSION_INC ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}) to_hex(LIBHASHKIT_VERSION_HEX ${LIBHASHKIT_VERSION_MAJOR} ${LIBHASHKIT_VERSION_MINOR} ${LIBHASHKIT_VERSION_PATCH}) # libhashkit.so diff --git a/ChangeLog-1.1.md b/ChangeLog-1.1.md index de38ca82..3001d4c9 100644 --- a/ChangeLog-1.1.md +++ b/ChangeLog-1.1.md @@ -13,10 +13,6 @@ was incremented due to the following changes: * Build requires C++11 compiler support. * Tests require C++17 compiler support. * Moved to the Semantic Versioning Specification: https://semver.org - * Public include directories have been renamed from `${lib}-${major}.${minor}` - to `${lib}-${major}` due to having the minor version (always having been 0 - in this case) in the public interface being unreasonable when using semantic - versioning. Symbolic links are provided for backwards compatibility, though. * Moved the project from launchpad to github: * Source: https://github.com/m6w6/libmemcached * Documentation: https://m6w6.github.io/libmemcached diff --git a/contrib/bin/memaslap/ms_conn.h b/contrib/bin/memaslap/ms_conn.h index e3c4f91e..426eae82 100644 --- a/contrib/bin/memaslap/ms_conn.h +++ b/contrib/bin/memaslap/ms_conn.h @@ -22,7 +22,7 @@ #include #include "ms_task.h" -#include "libmemcachedprotocol-0/binary.h" +#include "libmemcachedprotocol-0.0/binary.h" #ifdef __cplusplus extern "C" { diff --git a/docs/source/ChangeLog-1.1.rst b/docs/source/ChangeLog-1.1.rst index 324ef7b2..3c1d8623 100644 --- a/docs/source/ChangeLog-1.1.rst +++ b/docs/source/ChangeLog-1.1.rst @@ -23,12 +23,6 @@ was incremented due to the following changes: * Build requires C++11 compiler support. * Tests require C++17 compiler support. * Moved to the Semantic Versioning Specification: https://semver.org - - * Public include directories have been renamed from ``${lib}-${major}.${minor}`` - to ``${lib}-${major}`` due to having the minor version (always having been 0 - in this case) in the public interface being unreasonable when using semantic - versioning. Symbolic links are provided for backwards compatibility, though. - * Moved the project from launchpad to github: * Source: https://github.com/m6w6/libmemcached diff --git a/docs/source/libmemcached/versioning.rst b/docs/source/libmemcached/versioning.rst index 161e2d8d..c7e13270 100644 --- a/docs/source/libmemcached/versioning.rst +++ b/docs/source/libmemcached/versioning.rst @@ -1,12 +1,10 @@ libmemcached Versioning ======================= -Libmemcached is laid out by interface version and strives to adhere to the -``Semantic Versioning Specification`` since version ``1.1``. +Libmemcached is laid out by interface version. The 1.0 version would be found +in: ``libmemcached-1.0/memcached.h`` -.. seealso:: - `https://semver.org/ `_ +The historic ``libmemcached/memcached.h`` includes +``libmemcached-1.0/memcached.h``. For best practice you should include the +version of libmemcached that you used during development. -The 1.x version would be found in: ``libmemcached-1/memcached.h``. The historic -``libmemcached/memcached.h`` includes ``libmemcached-1/memcached.h`` and on -previously supported platforms ``libmemcached-1.0`` points to ``libmemcached-1``. diff --git a/example/interface_v0.cc b/example/interface_v0.cc index cf53dded..cf600124 100644 --- a/example/interface_v0.cc +++ b/example/interface_v0.cc @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include "example/memcached_light.h" #include "example/storage.h" diff --git a/example/interface_v1.cc b/example/interface_v1.cc index e0a38355..c6f5bf19 100644 --- a/example/interface_v1.cc +++ b/example/interface_v1.cc @@ -20,7 +20,7 @@ #if HAVE_UNISTD_H # include #endif -#include +#include #include #include "example/memcached_light.h" #include "example/storage.h" diff --git a/example/memcached_light.cc b/example/memcached_light.cc index c76a42c2..714bb16f 100644 --- a/example/memcached_light.cc +++ b/example/memcached_light.cc @@ -25,7 +25,7 @@ #include -#include +#include #include #include #include "example/storage.h" diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 136c23d7..bc3dadc5 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,23 +1,5 @@ -add_subdirectory(libhashkit-1) -add_subdirectory(libmemcached-1) -add_subdirectory(libmemcachedutil-1) -add_subdirectory(libmemcachedprotocol-0) - -# v1.0 compatibility -if(NOT WIN32) - file(COPY libhashkit-1.0 DESTINATION .) - file(COPY libmemcached-1.0 DESTINATION .) - file(COPY libmemcachedutil-1.0 DESTINATION .) - file(COPY libmemcachedprotocol-0.0 DESTINATION .) - install(CODE " - file(INSTALL - ${CMAKE_CURRENT_BINARY_DIR}/libhashkit-1.0 - ${CMAKE_CURRENT_BINARY_DIR}/libmemcached-1.0 - ${CMAKE_CURRENT_BINARY_DIR}/libmemcachedutil-1.0 - ${CMAKE_CURRENT_BINARY_DIR}/libmemcachedprotocol-0.0 - DESTINATION \${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) - " - COMPONENT dev - ) -endif() +add_subdirectory(libhashkit-1.0) +add_subdirectory(libmemcached-1.0) +add_subdirectory(libmemcachedutil-1.0) +add_subdirectory(libmemcachedprotocol-0.0) diff --git a/include/libhashkit-1.0 b/include/libhashkit-1.0 deleted file mode 120000 index 17f4a363..00000000 --- a/include/libhashkit-1.0 +++ /dev/null @@ -1 +0,0 @@ -libhashkit-1 \ No newline at end of file diff --git a/include/libhashkit-1/CMakeLists.txt b/include/libhashkit-1.0/CMakeLists.txt similarity index 88% rename from include/libhashkit-1/CMakeLists.txt rename to include/libhashkit-1.0/CMakeLists.txt index aae1cd11..24fefd57 100644 --- a/include/libhashkit-1/CMakeLists.txt +++ b/include/libhashkit-1.0/CMakeLists.txt @@ -1,5 +1,5 @@ -install_public_headers(libhashkit-1 +install_public_headers(libhashkit-1.0 @configure.h algorithm.h basic_string.h diff --git a/include/libhashkit-1/algorithm.h b/include/libhashkit-1.0/algorithm.h similarity index 100% rename from include/libhashkit-1/algorithm.h rename to include/libhashkit-1.0/algorithm.h diff --git a/include/libhashkit-1/basic_string.h b/include/libhashkit-1.0/basic_string.h similarity index 100% rename from include/libhashkit-1/basic_string.h rename to include/libhashkit-1.0/basic_string.h diff --git a/include/libhashkit-1/behavior.h b/include/libhashkit-1.0/behavior.h similarity index 100% rename from include/libhashkit-1/behavior.h rename to include/libhashkit-1.0/behavior.h diff --git a/include/libhashkit-1/configure.h.in b/include/libhashkit-1.0/configure.h.in similarity index 100% rename from include/libhashkit-1/configure.h.in rename to include/libhashkit-1.0/configure.h.in diff --git a/include/libhashkit-1/digest.h b/include/libhashkit-1.0/digest.h similarity index 100% rename from include/libhashkit-1/digest.h rename to include/libhashkit-1.0/digest.h diff --git a/include/libhashkit-1/function.h b/include/libhashkit-1.0/function.h similarity index 100% rename from include/libhashkit-1/function.h rename to include/libhashkit-1.0/function.h diff --git a/include/libhashkit-1/has.h b/include/libhashkit-1.0/has.h similarity index 100% rename from include/libhashkit-1/has.h rename to include/libhashkit-1.0/has.h diff --git a/include/libhashkit-1/hashkit.h b/include/libhashkit-1.0/hashkit.h similarity index 83% rename from include/libhashkit-1/hashkit.h rename to include/libhashkit-1.0/hashkit.h index 5e01939d..9842f8eb 100644 --- a/include/libhashkit-1/hashkit.h +++ b/include/libhashkit-1.0/hashkit.h @@ -23,17 +23,17 @@ #endif #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include struct hashkit_st { struct hashkit_function_st { diff --git a/include/libhashkit-1/hashkit.hpp b/include/libhashkit-1.0/hashkit.hpp similarity index 98% rename from include/libhashkit-1/hashkit.hpp rename to include/libhashkit-1.0/hashkit.hpp index c178ecc7..1690f15b 100644 --- a/include/libhashkit-1/hashkit.hpp +++ b/include/libhashkit-1.0/hashkit.hpp @@ -15,7 +15,7 @@ #pragma once -#include +#include #include class Hashkit { diff --git a/include/libhashkit-1/str_algorithm.h b/include/libhashkit-1.0/str_algorithm.h similarity index 100% rename from include/libhashkit-1/str_algorithm.h rename to include/libhashkit-1.0/str_algorithm.h diff --git a/include/libhashkit-1/strerror.h b/include/libhashkit-1.0/strerror.h similarity index 100% rename from include/libhashkit-1/strerror.h rename to include/libhashkit-1.0/strerror.h diff --git a/include/libhashkit-1/string.h b/include/libhashkit-1.0/string.h similarity index 100% rename from include/libhashkit-1/string.h rename to include/libhashkit-1.0/string.h diff --git a/include/libhashkit-1/types.h b/include/libhashkit-1.0/types.h similarity index 100% rename from include/libhashkit-1/types.h rename to include/libhashkit-1.0/types.h diff --git a/include/libhashkit-1/visibility.h b/include/libhashkit-1.0/visibility.h similarity index 100% rename from include/libhashkit-1/visibility.h rename to include/libhashkit-1.0/visibility.h diff --git a/include/libmemcached-1.0 b/include/libmemcached-1.0 deleted file mode 120000 index ad6872d6..00000000 --- a/include/libmemcached-1.0 +++ /dev/null @@ -1 +0,0 @@ -libmemcached-1 \ No newline at end of file diff --git a/include/libmemcached-1/CMakeLists.txt b/include/libmemcached-1.0/CMakeLists.txt similarity index 97% rename from include/libmemcached-1/CMakeLists.txt rename to include/libmemcached-1.0/CMakeLists.txt index 4f19a88f..c9b4f7c1 100644 --- a/include/libmemcached-1/CMakeLists.txt +++ b/include/libmemcached-1.0/CMakeLists.txt @@ -3,7 +3,7 @@ add_subdirectory(struct) add_subdirectory(types) install_public_headers( - libmemcached-1 + libmemcached-1.0 @configure.h alloc.h diff --git a/include/libmemcached-1/alloc.h b/include/libmemcached-1.0/alloc.h similarity index 100% rename from include/libmemcached-1/alloc.h rename to include/libmemcached-1.0/alloc.h diff --git a/include/libmemcached-1/allocators.h b/include/libmemcached-1.0/allocators.h similarity index 100% rename from include/libmemcached-1/allocators.h rename to include/libmemcached-1.0/allocators.h diff --git a/include/libmemcached-1/analyze.h b/include/libmemcached-1.0/analyze.h similarity index 96% rename from include/libmemcached-1/analyze.h rename to include/libmemcached-1.0/analyze.h index 58009738..a5c9d45a 100644 --- a/include/libmemcached-1/analyze.h +++ b/include/libmemcached-1.0/analyze.h @@ -13,7 +13,7 @@ +--------------------------------------------------------------------+ */ -#include "libmemcached-1/struct/analysis.h" +#include "libmemcached-1.0/struct/analysis.h" #pragma once diff --git a/include/libmemcached-1/auto.h b/include/libmemcached-1.0/auto.h similarity index 100% rename from include/libmemcached-1/auto.h rename to include/libmemcached-1.0/auto.h diff --git a/include/libmemcached-1/basic_string.h b/include/libmemcached-1.0/basic_string.h similarity index 100% rename from include/libmemcached-1/basic_string.h rename to include/libmemcached-1.0/basic_string.h diff --git a/include/libmemcached-1/behavior.h b/include/libmemcached-1.0/behavior.h similarity index 100% rename from include/libmemcached-1/behavior.h rename to include/libmemcached-1.0/behavior.h diff --git a/include/libmemcached-1/callback.h b/include/libmemcached-1.0/callback.h similarity index 100% rename from include/libmemcached-1/callback.h rename to include/libmemcached-1.0/callback.h diff --git a/include/libmemcached-1/callbacks.h b/include/libmemcached-1.0/callbacks.h similarity index 100% rename from include/libmemcached-1/callbacks.h rename to include/libmemcached-1.0/callbacks.h diff --git a/include/libmemcached-1/configure.h.in b/include/libmemcached-1.0/configure.h.in similarity index 100% rename from include/libmemcached-1/configure.h.in rename to include/libmemcached-1.0/configure.h.in diff --git a/include/libmemcached-1/defaults.h b/include/libmemcached-1.0/defaults.h similarity index 100% rename from include/libmemcached-1/defaults.h rename to include/libmemcached-1.0/defaults.h diff --git a/include/libmemcached-1/delete.h b/include/libmemcached-1.0/delete.h similarity index 100% rename from include/libmemcached-1/delete.h rename to include/libmemcached-1.0/delete.h diff --git a/include/libmemcached-1/deprecated_types.h b/include/libmemcached-1.0/deprecated_types.h similarity index 100% rename from include/libmemcached-1/deprecated_types.h rename to include/libmemcached-1.0/deprecated_types.h diff --git a/include/libmemcached-1/dump.h b/include/libmemcached-1.0/dump.h similarity index 100% rename from include/libmemcached-1/dump.h rename to include/libmemcached-1.0/dump.h diff --git a/include/libmemcached-1/encoding_key.h b/include/libmemcached-1.0/encoding_key.h similarity index 100% rename from include/libmemcached-1/encoding_key.h rename to include/libmemcached-1.0/encoding_key.h diff --git a/include/libmemcached-1/error.h b/include/libmemcached-1.0/error.h similarity index 100% rename from include/libmemcached-1/error.h rename to include/libmemcached-1.0/error.h diff --git a/include/libmemcached-1/exception.hpp b/include/libmemcached-1.0/exception.hpp similarity index 100% rename from include/libmemcached-1/exception.hpp rename to include/libmemcached-1.0/exception.hpp diff --git a/include/libmemcached-1/exist.h b/include/libmemcached-1.0/exist.h similarity index 100% rename from include/libmemcached-1/exist.h rename to include/libmemcached-1.0/exist.h diff --git a/include/libmemcached-1/fetch.h b/include/libmemcached-1.0/fetch.h similarity index 100% rename from include/libmemcached-1/fetch.h rename to include/libmemcached-1.0/fetch.h diff --git a/include/libmemcached-1/flush.h b/include/libmemcached-1.0/flush.h similarity index 100% rename from include/libmemcached-1/flush.h rename to include/libmemcached-1.0/flush.h diff --git a/include/libmemcached-1/flush_buffers.h b/include/libmemcached-1.0/flush_buffers.h similarity index 100% rename from include/libmemcached-1/flush_buffers.h rename to include/libmemcached-1.0/flush_buffers.h diff --git a/include/libmemcached-1/get.h b/include/libmemcached-1.0/get.h similarity index 100% rename from include/libmemcached-1/get.h rename to include/libmemcached-1.0/get.h diff --git a/include/libmemcached-1/hash.h b/include/libmemcached-1.0/hash.h similarity index 100% rename from include/libmemcached-1/hash.h rename to include/libmemcached-1.0/hash.h diff --git a/include/libmemcached-1/limits.h b/include/libmemcached-1.0/limits.h similarity index 100% rename from include/libmemcached-1/limits.h rename to include/libmemcached-1.0/limits.h diff --git a/include/libmemcached-1/memcached.h b/include/libmemcached-1.0/memcached.h similarity index 50% rename from include/libmemcached-1/memcached.h rename to include/libmemcached-1.0/memcached.h index a1d0522f..e3eac4e2 100644 --- a/include/libmemcached-1/memcached.h +++ b/include/libmemcached-1.0/memcached.h @@ -15,71 +15,71 @@ #pragma once -#include "libmemcached-1/configure.h" -#include "libmemcached-1/visibility.h" -#include "libmemcached-1/platform.h" - -#include "libmemcached-1/limits.h" -#include "libmemcached-1/defaults.h" - -#include "libmemcached-1/types/behavior.h" -#include "libmemcached-1/types/callback.h" -#include "libmemcached-1/types/connection.h" -#include "libmemcached-1/types/hash.h" -#include "libmemcached-1/types/return.h" -#include "libmemcached-1/types/server_distribution.h" - -#include "libmemcached-1/return.h" - -#include "libmemcached-1/types.h" -#include "libmemcached-1/callbacks.h" -#include "libmemcached-1/alloc.h" -#include "libmemcached-1/triggers.h" - -#include "libhashkit-1/hashkit.h" - -#include "libmemcached-1/struct/callback.h" -#include "libmemcached-1/struct/string.h" -#include "libmemcached-1/struct/result.h" -#include "libmemcached-1/struct/allocator.h" -#include "libmemcached-1/struct/sasl.h" -#include "libmemcached-1/struct/memcached.h" -#include "libmemcached-1/struct/server.h" -#include "libmemcached-1/struct/stat.h" - -#include "libmemcached-1/basic_string.h" -#include "libmemcached-1/error.h" -#include "libmemcached-1/stats.h" +#include "libmemcached-1.0/configure.h" +#include "libmemcached-1.0/visibility.h" +#include "libmemcached-1.0/platform.h" + +#include "libmemcached-1.0/limits.h" +#include "libmemcached-1.0/defaults.h" + +#include "libmemcached-1.0/types/behavior.h" +#include "libmemcached-1.0/types/callback.h" +#include "libmemcached-1.0/types/connection.h" +#include "libmemcached-1.0/types/hash.h" +#include "libmemcached-1.0/types/return.h" +#include "libmemcached-1.0/types/server_distribution.h" + +#include "libmemcached-1.0/return.h" + +#include "libmemcached-1.0/types.h" +#include "libmemcached-1.0/callbacks.h" +#include "libmemcached-1.0/alloc.h" +#include "libmemcached-1.0/triggers.h" + +#include "libhashkit-1.0/hashkit.h" + +#include "libmemcached-1.0/struct/callback.h" +#include "libmemcached-1.0/struct/string.h" +#include "libmemcached-1.0/struct/result.h" +#include "libmemcached-1.0/struct/allocator.h" +#include "libmemcached-1.0/struct/sasl.h" +#include "libmemcached-1.0/struct/memcached.h" +#include "libmemcached-1.0/struct/server.h" +#include "libmemcached-1.0/struct/stat.h" + +#include "libmemcached-1.0/basic_string.h" +#include "libmemcached-1.0/error.h" +#include "libmemcached-1.0/stats.h" // Everything above this line must be in the order specified. -#include "libmemcached-1/allocators.h" -#include "libmemcached-1/analyze.h" -#include "libmemcached-1/auto.h" -#include "libmemcached-1/behavior.h" -#include "libmemcached-1/callback.h" -#include "libmemcached-1/delete.h" -#include "libmemcached-1/dump.h" -#include "libmemcached-1/encoding_key.h" -#include "libmemcached-1/exist.h" -#include "libmemcached-1/fetch.h" -#include "libmemcached-1/flush.h" -#include "libmemcached-1/flush_buffers.h" -#include "libmemcached-1/get.h" -#include "libmemcached-1/hash.h" -#include "libmemcached-1/options.h" -#include "libmemcached-1/parse.h" -#include "libmemcached-1/quit.h" -#include "libmemcached-1/result.h" -#include "libmemcached-1/server.h" -#include "libmemcached-1/server_list.h" -#include "libmemcached-1/storage.h" -#include "libmemcached-1/strerror.h" -#include "libmemcached-1/touch.h" -#include "libmemcached-1/verbosity.h" -#include "libmemcached-1/version.h" -#include "libmemcached-1/sasl.h" - -#include "libmemcached-1/deprecated_types.h" +#include "libmemcached-1.0/allocators.h" +#include "libmemcached-1.0/analyze.h" +#include "libmemcached-1.0/auto.h" +#include "libmemcached-1.0/behavior.h" +#include "libmemcached-1.0/callback.h" +#include "libmemcached-1.0/delete.h" +#include "libmemcached-1.0/dump.h" +#include "libmemcached-1.0/encoding_key.h" +#include "libmemcached-1.0/exist.h" +#include "libmemcached-1.0/fetch.h" +#include "libmemcached-1.0/flush.h" +#include "libmemcached-1.0/flush_buffers.h" +#include "libmemcached-1.0/get.h" +#include "libmemcached-1.0/hash.h" +#include "libmemcached-1.0/options.h" +#include "libmemcached-1.0/parse.h" +#include "libmemcached-1.0/quit.h" +#include "libmemcached-1.0/result.h" +#include "libmemcached-1.0/server.h" +#include "libmemcached-1.0/server_list.h" +#include "libmemcached-1.0/storage.h" +#include "libmemcached-1.0/strerror.h" +#include "libmemcached-1.0/touch.h" +#include "libmemcached-1.0/verbosity.h" +#include "libmemcached-1.0/version.h" +#include "libmemcached-1.0/sasl.h" + +#include "libmemcached-1.0/deprecated_types.h" #ifdef __cplusplus extern "C" { diff --git a/include/libmemcached-1/memcached.hpp b/include/libmemcached-1.0/memcached.hpp similarity index 99% rename from include/libmemcached-1/memcached.hpp rename to include/libmemcached-1.0/memcached.hpp index 5d902561..aaeb4df7 100644 --- a/include/libmemcached-1/memcached.hpp +++ b/include/libmemcached-1.0/memcached.hpp @@ -15,7 +15,7 @@ #pragma once -#include "libmemcached-1/memcached.h" +#include "libmemcached-1.0/memcached.h" #if 0 # include "libmemcached/exception.hpp" #endif diff --git a/include/libmemcached-1/options.h b/include/libmemcached-1.0/options.h similarity index 100% rename from include/libmemcached-1/options.h rename to include/libmemcached-1.0/options.h diff --git a/include/libmemcached-1/parse.h b/include/libmemcached-1.0/parse.h similarity index 100% rename from include/libmemcached-1/parse.h rename to include/libmemcached-1.0/parse.h diff --git a/include/libmemcached-1/platform.h b/include/libmemcached-1.0/platform.h similarity index 97% rename from include/libmemcached-1/platform.h rename to include/libmemcached-1.0/platform.h index ad345f64..1bf2c3df 100644 --- a/include/libmemcached-1/platform.h +++ b/include/libmemcached-1.0/platform.h @@ -15,7 +15,7 @@ #pragma once -#include "libmemcached-1/configure.h" +#include "libmemcached-1.0/configure.h" /* This seems to be required for older compilers @note * http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t */ diff --git a/include/libmemcached-1/quit.h b/include/libmemcached-1.0/quit.h similarity index 100% rename from include/libmemcached-1/quit.h rename to include/libmemcached-1.0/quit.h diff --git a/include/libmemcached-1/result.h b/include/libmemcached-1.0/result.h similarity index 98% rename from include/libmemcached-1/result.h rename to include/libmemcached-1.0/result.h index e1c5b2b0..301d0c11 100644 --- a/include/libmemcached-1/result.h +++ b/include/libmemcached-1.0/result.h @@ -13,7 +13,7 @@ +--------------------------------------------------------------------+ */ -#include "libmemcached-1/struct/result.h" +#include "libmemcached-1.0/struct/result.h" #pragma once diff --git a/include/libmemcached-1/return.h b/include/libmemcached-1.0/return.h similarity index 100% rename from include/libmemcached-1/return.h rename to include/libmemcached-1.0/return.h diff --git a/include/libmemcached-1/sasl.h b/include/libmemcached-1.0/sasl.h similarity index 97% rename from include/libmemcached-1/sasl.h rename to include/libmemcached-1.0/sasl.h index 22d3b61e..832084bd 100644 --- a/include/libmemcached-1/sasl.h +++ b/include/libmemcached-1.0/sasl.h @@ -42,4 +42,4 @@ sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr); } #endif -#include "libmemcached-1/struct/sasl.h" +#include "libmemcached-1.0/struct/sasl.h" diff --git a/include/libmemcached-1/server.h b/include/libmemcached-1.0/server.h similarity index 98% rename from include/libmemcached-1/server.h rename to include/libmemcached-1.0/server.h index 3ad5199d..86928c3d 100644 --- a/include/libmemcached-1/server.h +++ b/include/libmemcached-1.0/server.h @@ -15,7 +15,7 @@ #pragma once -#include "libmemcached-1/struct/server.h" +#include "libmemcached-1.0/struct/server.h" #ifdef __cplusplus extern "C" { diff --git a/include/libmemcached-1/server_list.h b/include/libmemcached-1.0/server_list.h similarity index 100% rename from include/libmemcached-1/server_list.h rename to include/libmemcached-1.0/server_list.h diff --git a/include/libmemcached-1/stats.h b/include/libmemcached-1.0/stats.h similarity index 97% rename from include/libmemcached-1/stats.h rename to include/libmemcached-1.0/stats.h index eb02bacd..5661f505 100644 --- a/include/libmemcached-1/stats.h +++ b/include/libmemcached-1.0/stats.h @@ -13,7 +13,7 @@ +--------------------------------------------------------------------+ */ -#include "libmemcached-1/struct/stat.h" +#include "libmemcached-1.0/struct/stat.h" #pragma once diff --git a/include/libmemcached-1/storage.h b/include/libmemcached-1.0/storage.h similarity index 100% rename from include/libmemcached-1/storage.h rename to include/libmemcached-1.0/storage.h diff --git a/include/libmemcached-1/strerror.h b/include/libmemcached-1.0/strerror.h similarity index 100% rename from include/libmemcached-1/strerror.h rename to include/libmemcached-1.0/strerror.h diff --git a/include/libmemcached-1/struct/CMakeLists.txt b/include/libmemcached-1.0/struct/CMakeLists.txt similarity index 85% rename from include/libmemcached-1/struct/CMakeLists.txt rename to include/libmemcached-1.0/struct/CMakeLists.txt index adebbfef..548f993d 100644 --- a/include/libmemcached-1/struct/CMakeLists.txt +++ b/include/libmemcached-1.0/struct/CMakeLists.txt @@ -1,6 +1,6 @@ install_public_headers( - libmemcached-1/struct + libmemcached-1.0/struct allocator.h analysis.h diff --git a/include/libmemcached-1/struct/allocator.h b/include/libmemcached-1.0/struct/allocator.h similarity index 100% rename from include/libmemcached-1/struct/allocator.h rename to include/libmemcached-1.0/struct/allocator.h diff --git a/include/libmemcached-1/struct/analysis.h b/include/libmemcached-1.0/struct/analysis.h similarity index 100% rename from include/libmemcached-1/struct/analysis.h rename to include/libmemcached-1.0/struct/analysis.h diff --git a/include/libmemcached-1/struct/callback.h b/include/libmemcached-1.0/struct/callback.h similarity index 100% rename from include/libmemcached-1/struct/callback.h rename to include/libmemcached-1.0/struct/callback.h diff --git a/include/libmemcached-1/struct/memcached.h b/include/libmemcached-1.0/struct/memcached.h similarity index 100% rename from include/libmemcached-1/struct/memcached.h rename to include/libmemcached-1.0/struct/memcached.h diff --git a/include/libmemcached-1/struct/result.h b/include/libmemcached-1.0/struct/result.h similarity index 100% rename from include/libmemcached-1/struct/result.h rename to include/libmemcached-1.0/struct/result.h diff --git a/include/libmemcached-1/struct/sasl.h b/include/libmemcached-1.0/struct/sasl.h similarity index 100% rename from include/libmemcached-1/struct/sasl.h rename to include/libmemcached-1.0/struct/sasl.h diff --git a/include/libmemcached-1/struct/server.h b/include/libmemcached-1.0/struct/server.h similarity index 98% rename from include/libmemcached-1/struct/server.h rename to include/libmemcached-1.0/struct/server.h index 4109c56d..e74767ad 100644 --- a/include/libmemcached-1/struct/server.h +++ b/include/libmemcached-1.0/struct/server.h @@ -15,7 +15,7 @@ #pragma once -#include "libmemcached-1/configure.h" +#include "libmemcached-1.0/configure.h" #ifdef HAVE_NETDB_H # include diff --git a/include/libmemcached-1/struct/stat.h b/include/libmemcached-1.0/struct/stat.h similarity index 100% rename from include/libmemcached-1/struct/stat.h rename to include/libmemcached-1.0/struct/stat.h diff --git a/include/libmemcached-1/struct/string.h b/include/libmemcached-1.0/struct/string.h similarity index 100% rename from include/libmemcached-1/struct/string.h rename to include/libmemcached-1.0/struct/string.h diff --git a/include/libmemcached-1/touch.h b/include/libmemcached-1.0/touch.h similarity index 100% rename from include/libmemcached-1/touch.h rename to include/libmemcached-1.0/touch.h diff --git a/include/libmemcached-1/triggers.h b/include/libmemcached-1.0/triggers.h similarity index 100% rename from include/libmemcached-1/triggers.h rename to include/libmemcached-1.0/triggers.h diff --git a/include/libmemcached-1/types.h b/include/libmemcached-1.0/types.h similarity index 100% rename from include/libmemcached-1/types.h rename to include/libmemcached-1.0/types.h diff --git a/include/libmemcached-1/types/CMakeLists.txt b/include/libmemcached-1.0/types/CMakeLists.txt similarity index 83% rename from include/libmemcached-1/types/CMakeLists.txt rename to include/libmemcached-1.0/types/CMakeLists.txt index 9bc619d6..14ec1077 100644 --- a/include/libmemcached-1/types/CMakeLists.txt +++ b/include/libmemcached-1.0/types/CMakeLists.txt @@ -1,6 +1,6 @@ install_public_headers( - libmemcached-1/types + libmemcached-1.0/types behavior.h callback.h diff --git a/include/libmemcached-1/types/behavior.h b/include/libmemcached-1.0/types/behavior.h similarity index 100% rename from include/libmemcached-1/types/behavior.h rename to include/libmemcached-1.0/types/behavior.h diff --git a/include/libmemcached-1/types/callback.h b/include/libmemcached-1.0/types/callback.h similarity index 100% rename from include/libmemcached-1/types/callback.h rename to include/libmemcached-1.0/types/callback.h diff --git a/include/libmemcached-1/types/connection.h b/include/libmemcached-1.0/types/connection.h similarity index 100% rename from include/libmemcached-1/types/connection.h rename to include/libmemcached-1.0/types/connection.h diff --git a/include/libmemcached-1/types/hash.h b/include/libmemcached-1.0/types/hash.h similarity index 100% rename from include/libmemcached-1/types/hash.h rename to include/libmemcached-1.0/types/hash.h diff --git a/include/libmemcached-1/types/return.h b/include/libmemcached-1.0/types/return.h similarity index 100% rename from include/libmemcached-1/types/return.h rename to include/libmemcached-1.0/types/return.h diff --git a/include/libmemcached-1/types/server_distribution.h b/include/libmemcached-1.0/types/server_distribution.h similarity index 100% rename from include/libmemcached-1/types/server_distribution.h rename to include/libmemcached-1.0/types/server_distribution.h diff --git a/include/libmemcached-1/verbosity.h b/include/libmemcached-1.0/verbosity.h similarity index 100% rename from include/libmemcached-1/verbosity.h rename to include/libmemcached-1.0/verbosity.h diff --git a/include/libmemcached-1/version.h b/include/libmemcached-1.0/version.h similarity index 100% rename from include/libmemcached-1/version.h rename to include/libmemcached-1.0/version.h diff --git a/include/libmemcached-1/visibility.h b/include/libmemcached-1.0/visibility.h similarity index 100% rename from include/libmemcached-1/visibility.h rename to include/libmemcached-1.0/visibility.h diff --git a/include/libmemcachedprotocol-0.0 b/include/libmemcachedprotocol-0.0 deleted file mode 120000 index 9157c764..00000000 --- a/include/libmemcachedprotocol-0.0 +++ /dev/null @@ -1 +0,0 @@ -libmemcachedprotocol-0 \ No newline at end of file diff --git a/include/libmemcachedprotocol-0/CMakeLists.txt b/include/libmemcachedprotocol-0.0/CMakeLists.txt similarity index 75% rename from include/libmemcachedprotocol-0/CMakeLists.txt rename to include/libmemcachedprotocol-0.0/CMakeLists.txt index 62f739c3..6d4fb220 100644 --- a/include/libmemcachedprotocol-0/CMakeLists.txt +++ b/include/libmemcachedprotocol-0.0/CMakeLists.txt @@ -1,6 +1,6 @@ install_public_headers( - libmemcachedprotocol-0 + libmemcachedprotocol-0.0 binary.h callback.h diff --git a/include/libmemcachedprotocol-0/binary.h b/include/libmemcachedprotocol-0.0/binary.h similarity index 99% rename from include/libmemcachedprotocol-0/binary.h rename to include/libmemcachedprotocol-0.0/binary.h index 9478c867..837f3adf 100644 --- a/include/libmemcachedprotocol-0/binary.h +++ b/include/libmemcachedprotocol-0.0/binary.h @@ -16,7 +16,7 @@ #ifndef PROTOCOL_BINARY_H #define PROTOCOL_BINARY_H -#include "libmemcachedprotocol-0/vbucket.h" +#include "libmemcachedprotocol-0.0/vbucket.h" /** * \addtogroup Protocol diff --git a/include/libmemcachedprotocol-0/callback.h b/include/libmemcachedprotocol-0.0/callback.h similarity index 100% rename from include/libmemcachedprotocol-0/callback.h rename to include/libmemcachedprotocol-0.0/callback.h diff --git a/include/libmemcachedprotocol-0/handler.h b/include/libmemcachedprotocol-0.0/handler.h similarity index 97% rename from include/libmemcachedprotocol-0/handler.h rename to include/libmemcachedprotocol-0.0/handler.h index 94cc5e5c..5f009056 100644 --- a/include/libmemcachedprotocol-0/handler.h +++ b/include/libmemcachedprotocol-0.0/handler.h @@ -28,10 +28,10 @@ typedef long int ssize_t; # include #endif -#include "libmemcached-1/visibility.h" -#include "libmemcached-1/platform.h" -#include "libmemcachedprotocol-0/binary.h" -#include "libmemcachedprotocol-0/callback.h" +#include "libmemcached-1.0/visibility.h" +#include "libmemcached-1.0/platform.h" +#include "libmemcachedprotocol-0.0/binary.h" +#include "libmemcachedprotocol-0.0/callback.h" /* Forward declarations */ /* diff --git a/include/libmemcachedprotocol-0/vbucket.h b/include/libmemcachedprotocol-0.0/vbucket.h similarity index 100% rename from include/libmemcachedprotocol-0/vbucket.h rename to include/libmemcachedprotocol-0.0/vbucket.h diff --git a/include/libmemcachedutil-1.0 b/include/libmemcachedutil-1.0 deleted file mode 120000 index e74e2a91..00000000 --- a/include/libmemcachedutil-1.0 +++ /dev/null @@ -1 +0,0 @@ -libmemcachedutil-1 \ No newline at end of file diff --git a/include/libmemcachedutil-1/CMakeLists.txt b/include/libmemcachedutil-1.0/CMakeLists.txt similarity index 83% rename from include/libmemcachedutil-1/CMakeLists.txt rename to include/libmemcachedutil-1.0/CMakeLists.txt index d15f2e87..a6e353d1 100644 --- a/include/libmemcachedutil-1/CMakeLists.txt +++ b/include/libmemcachedutil-1.0/CMakeLists.txt @@ -1,6 +1,6 @@ install_public_headers( - libmemcachedutil-1 + libmemcachedutil-1.0 flush.h ostream.hpp diff --git a/include/libmemcachedutil-1/flush.h b/include/libmemcachedutil-1.0/flush.h similarity index 100% rename from include/libmemcachedutil-1/flush.h rename to include/libmemcachedutil-1.0/flush.h diff --git a/include/libmemcachedutil-1/ostream.hpp b/include/libmemcachedutil-1.0/ostream.hpp similarity index 100% rename from include/libmemcachedutil-1/ostream.hpp rename to include/libmemcachedutil-1.0/ostream.hpp diff --git a/include/libmemcachedutil-1/pid.h b/include/libmemcachedutil-1.0/pid.h similarity index 100% rename from include/libmemcachedutil-1/pid.h rename to include/libmemcachedutil-1.0/pid.h diff --git a/include/libmemcachedutil-1/ping.h b/include/libmemcachedutil-1.0/ping.h similarity index 100% rename from include/libmemcachedutil-1/ping.h rename to include/libmemcachedutil-1.0/ping.h diff --git a/include/libmemcachedutil-1/pool.h b/include/libmemcachedutil-1.0/pool.h similarity index 98% rename from include/libmemcachedutil-1/pool.h rename to include/libmemcachedutil-1.0/pool.h index 155862e2..e93b65e6 100644 --- a/include/libmemcachedutil-1/pool.h +++ b/include/libmemcachedutil-1.0/pool.h @@ -15,7 +15,7 @@ #pragma once -#include "libmemcached-1/memcached.h" +#include "libmemcached-1.0/memcached.h" #ifdef __cplusplus extern "C" { diff --git a/include/libmemcachedutil-1/util.h b/include/libmemcachedutil-1.0/util.h similarity index 79% rename from include/libmemcachedutil-1/util.h rename to include/libmemcachedutil-1.0/util.h index 48e5a9a0..b4cf2e45 100644 --- a/include/libmemcachedutil-1/util.h +++ b/include/libmemcachedutil-1.0/util.h @@ -15,10 +15,10 @@ #pragma once -#include "libmemcached-1/memcached.h" +#include "libmemcached-1.0/memcached.h" -#include "libmemcachedutil-1/pid.h" -#include "libmemcachedutil-1/flush.h" -#include "libmemcachedutil-1/ping.h" -#include "libmemcachedutil-1/pool.h" -#include "libmemcachedutil-1/version.h" +#include "libmemcachedutil-1.0/pid.h" +#include "libmemcachedutil-1.0/flush.h" +#include "libmemcachedutil-1.0/ping.h" +#include "libmemcachedutil-1.0/pool.h" +#include "libmemcachedutil-1.0/version.h" diff --git a/include/libmemcachedutil-1/version.h b/include/libmemcachedutil-1.0/version.h similarity index 100% rename from include/libmemcachedutil-1/version.h rename to include/libmemcachedutil-1.0/version.h diff --git a/src/bin/memcapable.cc b/src/bin/memcapable.cc index a95fc1d1..54e9c224 100644 --- a/src/bin/memcapable.cc +++ b/src/bin/memcapable.cc @@ -36,8 +36,8 @@ #include "p9y/socket.hpp" #include "p9y/poll.hpp" -#include "libmemcached-1/memcached.h" -#include "libmemcachedprotocol-0/binary.h" +#include "libmemcached-1.0/memcached.h" +#include "libmemcachedprotocol-0.0/binary.h" #include "libmemcached/byteorder.h" #include diff --git a/src/bin/memparse.cc b/src/bin/memparse.cc index be3211ce..d08c9d99 100644 --- a/src/bin/memparse.cc +++ b/src/bin/memparse.cc @@ -19,7 +19,7 @@ #include #include -#include "libmemcached-1/memcached.h" +#include "libmemcached-1.0/memcached.h" int main(int argc, char *argv[]) { if (argc < 2) { diff --git a/src/libhashkit/common.h b/src/libhashkit/common.h index ddd7bb03..6d483584 100644 --- a/src/libhashkit/common.h +++ b/src/libhashkit/common.h @@ -30,7 +30,7 @@ # endif #endif -#include "libhashkit-1/hashkit.h" +#include "libhashkit-1.0/hashkit.h" #include "libhashkit/algorithm.h" #include "libhashkit/is.h" #include "libhashkit/string.h" diff --git a/src/libhashkit/hashkit.h b/src/libhashkit/hashkit.h index 35380dff..e4285233 100644 --- a/src/libhashkit/hashkit.h +++ b/src/libhashkit/hashkit.h @@ -15,4 +15,4 @@ #pragma once -#include "libhashkit-1/hashkit.h" +#include "libhashkit-1.0/hashkit.h" diff --git a/src/libmemcached/common.h b/src/libmemcached/common.h index ed878cb1..c36384b2 100644 --- a/src/libmemcached/common.h +++ b/src/libmemcached/common.h @@ -54,7 +54,7 @@ # include #endif -#include "libmemcached-1/memcached.h" +#include "libmemcached-1.0/memcached.h" #include "libmemcached/watchpoint.h" #include "libmemcached/is.h" typedef struct memcached_st Memcached; @@ -69,7 +69,7 @@ memcached_instance_st *memcached_instance_fetch(memcached_st *ptr, uint32_t serv #include "libmemcached/io.h" #ifdef __cplusplus # include "libmemcached/string.hpp" -# include "libmemcachedprotocol-0/binary.h" +# include "libmemcachedprotocol-0.0/binary.h" # include "libmemcached/io.hpp" # include "libmemcached/udp.hpp" # include "libmemcached/do.hpp" diff --git a/src/libmemcached/memcached.h b/src/libmemcached/memcached.h index b3dbcb27..c0878dc3 100644 --- a/src/libmemcached/memcached.h +++ b/src/libmemcached/memcached.h @@ -15,4 +15,4 @@ #pragma once -#include "libmemcached-1/memcached.h" +#include "libmemcached-1.0/memcached.h" diff --git a/src/libmemcached/memcached.hpp b/src/libmemcached/memcached.hpp index 381ca13b..6ebb5c4d 100644 --- a/src/libmemcached/memcached.hpp +++ b/src/libmemcached/memcached.hpp @@ -15,4 +15,4 @@ #pragma once -#include "libmemcached-1/memcached.hpp" +#include "libmemcached-1.0/memcached.hpp" diff --git a/src/libmemcached/util.h b/src/libmemcached/util.h index 7b808283..48c7fc49 100644 --- a/src/libmemcached/util.h +++ b/src/libmemcached/util.h @@ -15,4 +15,4 @@ #pragma once -#include "libmemcachedutil-1/util.h" +#include "libmemcachedutil-1.0/util.h" diff --git a/src/libmemcachedprotocol/common.h b/src/libmemcachedprotocol/common.h index 0e6a1005..39f0464e 100644 --- a/src/libmemcachedprotocol/common.h +++ b/src/libmemcachedprotocol/common.h @@ -18,7 +18,7 @@ #include "mem_config.h" #include -#include "libmemcachedprotocol-0/handler.h" +#include "libmemcachedprotocol-0.0/handler.h" #include "libmemcachedprotocol/cache.h" #include "libmemcached/byteorder.h" diff --git a/src/libmemcachedutil/common.h b/src/libmemcachedutil/common.h index ddfac589..680f85c0 100644 --- a/src/libmemcachedutil/common.h +++ b/src/libmemcachedutil/common.h @@ -22,6 +22,6 @@ #include #include -#include "libmemcachedutil-1/util.h" +#include "libmemcachedutil-1.0/util.h" #include "libmemcached/assert.hpp" #include "libmemcached/backtrace.hpp" diff --git a/src/p9y/gettimeofday.hpp b/src/p9y/gettimeofday.hpp index 93452b66..8eb06fa2 100644 --- a/src/p9y/gettimeofday.hpp +++ b/src/p9y/gettimeofday.hpp @@ -1,6 +1,6 @@ #pragma once -#include "libmemcached-1/platform.h" +#include "libmemcached-1.0/platform.h" #if defined __cplusplus # include diff --git a/src/p9y/poll.hpp b/src/p9y/poll.hpp index bff0f1b7..9d410dd3 100644 --- a/src/p9y/poll.hpp +++ b/src/p9y/poll.hpp @@ -1,6 +1,6 @@ #pragma once -#include "libmemcached-1/platform.h" +#include "libmemcached-1.0/platform.h" #if defined HAVE_POLL_H # include diff --git a/src/p9y/socket.hpp b/src/p9y/socket.hpp index 9678b39f..a9a18ad2 100644 --- a/src/p9y/socket.hpp +++ b/src/p9y/socket.hpp @@ -1,6 +1,6 @@ #pragma once -#include "libmemcached-1/platform.h" +#include "libmemcached-1.0/platform.h" #if defined __cplusplus # include diff --git a/src/win32/wrappers.h b/src/win32/wrappers.h new file mode 100644 index 00000000..a009fbdc --- /dev/null +++ b/src/win32/wrappers.h @@ -0,0 +1,104 @@ +/* LibMemcached + * Copyright (C) 2010 Brian Aker, Trond Norbye + * All rights reserved. + * + * Use and distribution licensed under the BSD license. See + * the COPYING file in the parent directory for full text. + * + * Summary: "Implementation" of the function we don't have on windows + * to avoid a bunch of ifdefs in the rest of the code + * + */ +#pragma once + +#include + +/* + * One of the Windows headers define interface as a macro, but that + * is causing problems with the member named "interface" in some of the + * structs. + */ +#undef interface + +#undef malloc +#undef realloc + + +/* + * WinSock use a separate range for error codes. Let's just map to the + * WinSock ones. + */ +#ifndef EADDRINUSE +# define EADDRINUSE WSAEADDRINUSE +#endif + +#ifndef EWOULDBLOCK +# define EWOULDBLOCK WSAEWOULDBLOCK +#endif + +#ifndef EINPROGRESS +# define EINPROGRESS WSAEINPROGRESS +#endif + +#ifndef EALREADY +# define EALREADY WSAEALREADY +#endif + +#ifndef EISCONN +# define EISCONN WSAEISCONN +#endif + +#ifndef ENOTCONN +# define ENOTCONN WSAENOTCONN +#endif + +#ifndef ENOBUFS +# define ENOBUFS WSAENOBUFS +#endif + +#ifndef SHUT_RDWR +# define SHUT_RDWR SD_BOTH +#endif +#ifndef SHUT_WR +# define SHUT_WR SD_SEND +#endif +#ifndef SHUT_RD +# define SHUT_RD SD_RECEIVE +#endif + +/* EAI_SYSTEM isn't defined anywhere... just set it to... 11? */ +#ifndef EAI_SYSTEM +# define EAI_SYSTEM 11 +#endif + +/* Best effort mapping of functions to alternative functions */ +#define index(a,b) strchr(a,b) +#define rindex(a,b) strrchr(a,b) +#define random() rand() +#define srandom(a) while (false) {} +#define kill(a, b) while (false) {} +#define fork() (-1) +#define waitpid(a,b,c) (-1) +#define fnmatch(a,b,c) (-1) +#define sleep(a) Sleep(a*1000) + +#ifdef __cplusplus +# include +static inline int gettimeofday(struct timeval* tp, struct timezone* tzp) { + using clock = std::chrono::system_clock; + auto as_sec = [] (auto d) { + return std::chrono::duration_cast(d); + }; + auto as_usec = [] (auto d) { + return std::chrono::duration_cast(d); + }; + + auto now = clock::now().time_since_epoch(); + auto sec = as_sec(now); + auto usec = as_usec(now - sec); + + tp->tv_sec = sec.count(); + tp->tv_usec = usec.count(); + return 0; +} +#endif \ No newline at end of file diff --git a/support/ax_libmemcached.m4 b/support/ax_libmemcached.m4 index d847f99b..95e5c9f7 100644 --- a/support/ax_libmemcached.m4 +++ b/support/ax_libmemcached.m4 @@ -52,13 +52,13 @@ #serial 1 AC_DEFUN([AX_LIBMEMCACHED], [ - AC_CHECK_HEADER([libmemcached-1/memcached.h], [ + AC_CHECK_HEADER([libmemcached-1.0/memcached.h], [ AC_CACHE_CHECK([check for -lmemcached], [ax_cv_libmemcached], [ AC_LANG_PUSH([C]) AX_SAVE_FLAGS LIBS="-lmemcached $LIBS" AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include ], [ + AC_LANG_PROGRAM([#include ], [ memcached_st *memc; memc= memcached(NULL, 0); memcached_free(memc); @@ -72,22 +72,22 @@ AC_DEFUN([AX_LIBMEMCACHED], [ ]) AS_IF([test "x$ax_cv_libmemcached" = "xyes"], [ - AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [1], [Have libmemcached-1/memcached.h]) + AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [1], [Have libmemcached-1.0/memcached.h]) ],[ - AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [0], [Have libmemcached-1/memcached.h]) + AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [0], [Have libmemcached-1.0/memcached.h]) ]) ]) AC_DEFUN([AX_LIBMEMCACHED_UTIL], [ AC_REQUIRE([AX_LIBMEMCACHED]) AS_IF([test "$ax_cv_libmemcached" = yes], [ - AC_CHECK_HEADER([libmemcachedutil-1/util.h], [ + AC_CHECK_HEADER([libmemcachedutil-1.0/util.h], [ AC_CACHE_CHECK([check for -lmemcachedutil], [ax_cv_libmemcached_util], [ AX_SAVE_FLAGS AC_LANG_PUSH([C]) LIBS="-lmemcachedutil -lmemcached $LIBS" AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include ], [ + AC_LANG_PROGRAM([#include ], [ memcached_pool_st *memc_pool= memcached_pool_create(NULL, 0, 3); memcached_pool_destroy(memc_pool); ])], @@ -101,9 +101,9 @@ AC_DEFUN([AX_LIBMEMCACHED], [ ]) AS_IF([test "x$ax_cv_libmemcached_util" = "xyes"], [ - AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [1], [Have libmemcachedutil-1/util.h]) + AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [1], [Have libmemcachedutil-1.0/util.h]) ],[ - AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [0], [Have libmemcachedutil-1/util.h]) + AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [0], [Have libmemcachedutil-1.0/util.h]) ]) ]) diff --git a/test/tests/hashkit/basic.cpp b/test/tests/hashkit/basic.cpp index 1a3cc22e..369b530f 100644 --- a/test/tests/hashkit/basic.cpp +++ b/test/tests/hashkit/basic.cpp @@ -1,7 +1,7 @@ #include "test/lib/common.hpp" #include "test/fixtures/hashes.hpp" -#include "libhashkit-1/hashkit.hpp" +#include "libhashkit-1.0/hashkit.hpp" TEST_CASE("hashkit") { hashkit_st st, *hp = hashkit_create(nullptr); diff --git a/test/tests/memcached/regression/lp_000-962-815.cpp b/test/tests/memcached/regression/lp_000-962-815.cpp index 389064db..bde4dfce 100644 --- a/test/tests/memcached/regression/lp_000-962-815.cpp +++ b/test/tests/memcached/regression/lp_000-962-815.cpp @@ -1,7 +1,7 @@ #include "test/lib/common.hpp" #include "test/lib/MemcachedCluster.hpp" -#include "libmemcachedutil-1/pool.h" +#include "libmemcachedutil-1.0/pool.h" #include #include diff --git a/test/tests/memcached/util_pool_thread.cpp b/test/tests/memcached/util_pool_thread.cpp index b177b2a3..f8ac8501 100644 --- a/test/tests/memcached/util_pool_thread.cpp +++ b/test/tests/memcached/util_pool_thread.cpp @@ -1,6 +1,6 @@ #include "test/lib/common.hpp" -#include "libmemcachedutil-1/pool.h" +#include "libmemcachedutil-1.0/pool.h" #include struct test_pool_context_st { -- 2.30.2 From fe8186fc9f190103044da55493ff4ed295defb22 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 23 Dec 2020 10:39:53 +0100 Subject: [PATCH 14/16] fix soname versioning as suggested in #98 --- CMakeVersions.txt | 22 +++++++++++++--------- src/libhashkit/CMakeLists.txt | 3 ++- src/libmemcached/CMakeLists.txt | 3 ++- src/libmemcachedprotocol/CMakeLists.txt | 3 ++- src/libmemcachedutil/CMakeLists.txt | 3 ++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/CMakeVersions.txt b/CMakeVersions.txt index aa77bdaa..81275015 100644 --- a/CMakeVersions.txt +++ b/CMakeVersions.txt @@ -22,11 +22,11 @@ endfunction() # set(LIBMEMCACHED_VERSION_MAJOR 1) -set(LIBMEMCACHED_VERSION_MINOR 0) -set(LIBMEMCACHED_VERSION_PATCH 99) +set(LIBMEMCACHED_VERSION_MINOR 1) +set(LIBMEMCACHED_VERSION_PATCH 0) set(LIBMEMCACHED_VERSION ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}.${LIBMEMCACHED_VERSION_PATCH}) -set(LIBMEMCACHED_VERSION_INC ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}) +set(LIBMEMCACHED_VERSION_INC ${LIBMEMCACHED_VERSION_MAJOR}.0) to_hex(LIBMEMCACHED_VERSION_HEX ${LIBMEMCACHED_VERSION_MAJOR} ${LIBMEMCACHED_VERSION_MINOR} ${LIBMEMCACHED_VERSION_PATCH}) # libmemcached.so @@ -35,6 +35,7 @@ set(LIBMEMCACHED_SO_VERSION_CUR 11) set(LIBMEMCACHED_SO_VERSION_REV 0) set(LIBMEMCACHED_SO_VERSION_AGE 0) +set(LIBMEMCACHED_SO_SOVERSION ${LIBMEMCACHED_SO_VERSION_CUR}.${LIBMEMCACHED_SO_VERSION_REV}) set(LIBMEMCACHED_SO_VERSION ${LIBMEMCACHED_SO_VERSION_CUR}.${LIBMEMCACHED_SO_VERSION_REV}.${LIBMEMCACHED_SO_VERSION_AGE}) # @@ -42,11 +43,11 @@ set(LIBMEMCACHED_SO_VERSION ${LIBMEMCACHED_SO_VERSION_CUR}.${LIBMEMCACHED_SO_VER # set(LIBMEMCACHEDUTIL_VERSION_MAJOR 1) -set(LIBMEMCACHEDUTIL_VERSION_MINOR 0) +set(LIBMEMCACHEDUTIL_VERSION_MINOR 1) set(LIBMEMCACHEDUTIL_VERSION_PATCH 0) set(LIBMEMCACHEDUTIL_VERSION ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR}.${LIBMEMCACHEDUTIL_VERSION_PATCH}) -set(LIBMEMCACHEDUTIL_VERSION_INC ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR}) +set(LIBMEMCACHEDUTIL_VERSION_INC ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.0) to_hex(LIBMEMCACHEDUTIL_VERSION_HEX ${LIBMEMCACHEDUTIL_VERSION_MAJOR} ${LIBMEMCACHEDUTIL_VERSION_MINOR} ${LIBMEMCACHEDUTIL_VERSION_PATCH}) # libmemcachedutil.so @@ -55,6 +56,7 @@ set(LIBMEMCACHEDUTIL_SO_VERSION_CUR 2) set(LIBMEMCACHEDUTIL_SO_VERSION_REV 0) set(LIBMEMCACHEDUTIL_SO_VERSION_AGE 0) +set(LIBMEMCACHEDUTIL_SO_SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHEDUTIL_SO_VERSION_REV}) set(LIBMEMCACHEDUTIL_SO_VERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHEDUTIL_SO_VERSION_REV}.${LIBMEMCACHEDUTIL_SO_VERSION_AGE}) # @@ -62,11 +64,11 @@ set(LIBMEMCACHEDUTIL_SO_VERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHE # set(LIBMEMCACHEDPROTOCOL_VERSION_MAJOR 0) -set(LIBMEMCACHEDPROTOCOL_VERSION_MINOR 0) +set(LIBMEMCACHEDPROTOCOL_VERSION_MINOR 1) set(LIBMEMCACHEDPROTOCOL_VERSION_PATCH 0) set(LIBMEMCACHEDPROTOCOL_VERSION ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR}.${LIBMEMCACHEDPROTOCOL_VERSION_PATCH}) -set(LIBMEMCACHEDPROTOCOL_VERSION_INC ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR}) +set(LIBMEMCACHEDPROTOCOL_VERSION_INC ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.0) to_hex(LIBMEMCACHEDPROTOCOL_VERSION_HEX ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR} ${LIBMEMCACHEDPROTOCOL_VERSION_MINOR} ${LIBMEMCACHEDPROTOCOL_VERSION_PATCH}) # libmemcachedprotocol.so @@ -75,6 +77,7 @@ set(LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR 0) set(LIBMEMCACHEDPROTOCOL_SO_VERSION_REV 0) set(LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE 0) +set(LIBMEMCACHEDPROTOCOL_SO_SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_REV}) set(LIBMEMCACHEDPROTOCOL_SO_VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_REV}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE}) # @@ -82,11 +85,11 @@ set(LIBMEMCACHEDPROTOCOL_SO_VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIB # set(LIBHASHKIT_VERSION_MAJOR 1) -set(LIBHASHKIT_VERSION_MINOR 0) +set(LIBHASHKIT_VERSION_MINOR 1) set(LIBHASHKIT_VERSION_PATCH 0) set(LIBHASHKIT_VERSION ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}.${LIBHASHKIT_VERSION_PATCH}) -set(LIBHASHKIT_VERSION_INC ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}) +set(LIBHASHKIT_VERSION_INC ${LIBHASHKIT_VERSION_MAJOR}.0) to_hex(LIBHASHKIT_VERSION_HEX ${LIBHASHKIT_VERSION_MAJOR} ${LIBHASHKIT_VERSION_MINOR} ${LIBHASHKIT_VERSION_PATCH}) # libhashkit.so @@ -95,4 +98,5 @@ set(LIBHASHKIT_SO_VERSION_CUR 2) set(LIBHASHKIT_SO_VERSION_REV 0) set(LIBHASHKIT_SO_VERSION_AGE 0) +set(LIBHASHKIT_SO_SOVERSION ${LIBHASHKIT_SO_VERSION_CUR}.${LIBHASHKIT_SO_VERSION_REV}) set(LIBHASHKIT_SO_VERSION ${LIBHASHKIT_SO_VERSION_CUR}.${LIBHASHKIT_SO_VERSION_REV}.${LIBHASHKIT_SO_VERSION_AGE}) diff --git a/src/libhashkit/CMakeLists.txt b/src/libhashkit/CMakeLists.txt index ae57244f..81129ef7 100644 --- a/src/libhashkit/CMakeLists.txt +++ b/src/libhashkit/CMakeLists.txt @@ -27,7 +27,8 @@ set_target_properties(libhashkit PROPERTIES CXX_STANDARD ${CXX_STANDARD} LIBRARY_OUTPUT_NAME hashkit LIBRARY_OUTPUT_NAME_DEBUG hashkit-dbg - SOVERSION ${LIBHASHKIT_SO_VERSION}) + SOVERSION ${LIBHASHKIT_SO_SOVERSION} + VERSION ${LIBHASHKIT_SO_VERSION}) target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT) target_include_directories(libhashkit PRIVATE ${CMAKE_SOURCE_DIR}/src diff --git a/src/libmemcached/CMakeLists.txt b/src/libmemcached/CMakeLists.txt index c688c7b9..ebc5a213 100644 --- a/src/libmemcached/CMakeLists.txt +++ b/src/libmemcached/CMakeLists.txt @@ -91,7 +91,8 @@ set_target_properties(libmemcached PROPERTIES CXX_STANDARD ${CXX_STANDARD} LIBRARY_OUTPUT_NAME memcached LIBRARY_OUTPUT_NAME_DEBUG memcached-dbg - SOVERSION ${LIBMEMCACHED_SO_VERSION}) + SOVERSION ${LIBMEMCACHED_SO_SOVERSION} + VERSION ${LIBMEMCACHED_SO_VERSION}) target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED) target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS}) target_link_libraries(libmemcached PRIVATE p9y) diff --git a/src/libmemcachedprotocol/CMakeLists.txt b/src/libmemcachedprotocol/CMakeLists.txt index 74658008..3e69aad9 100644 --- a/src/libmemcachedprotocol/CMakeLists.txt +++ b/src/libmemcachedprotocol/CMakeLists.txt @@ -14,7 +14,8 @@ set_target_properties(libmemcachedprotocol PROPERTIES CXX_STANDARD ${CXX_STANDARD} LIBRARY_OUTPUT_NAME memcachedprotocol LIBRARY_OUTPUT_NAME_DEBUG memcachedprotocol-dbg - SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION}) + SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_SOVERSION} + VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION}) target_compile_definitions(libmemcachedprotocol PRIVATE -DBUILDING_LIBMEMCACHED) if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) set_target_properties(libmemcachedprotocol PROPERTIES diff --git a/src/libmemcachedutil/CMakeLists.txt b/src/libmemcachedutil/CMakeLists.txt index e08de188..88f1e8df 100644 --- a/src/libmemcachedutil/CMakeLists.txt +++ b/src/libmemcachedutil/CMakeLists.txt @@ -15,7 +15,8 @@ set_target_properties(libmemcachedutil PROPERTIES CXX_STANDARD ${CXX_STANDARD} LIBRARY_OUTPUT_NAME memcachedutil LIBRARY_OUTPUT_NAME_DEBUG memcachedutil-dbg - SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION}) + SOVERSION ${LIBMEMCACHEDUTIL_SO_SOVERSION} + VERSION ${LIBMEMCACHEDUTIL_SO_VERSION}) target_compile_definitions(libmemcachedutil PRIVATE -DBUILDING_LIBMEMCACHED) if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) set_target_properties(libmemcachedutil PROPERTIES -- 2.30.2 From 2f275201aac9994f7694acb67f5dee62adcb0424 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 23 Dec 2020 10:48:34 +0100 Subject: [PATCH 15/16] really fix #98 --- CMakeVersions.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeVersions.txt b/CMakeVersions.txt index 81275015..545e37dd 100644 --- a/CMakeVersions.txt +++ b/CMakeVersions.txt @@ -56,7 +56,7 @@ set(LIBMEMCACHEDUTIL_SO_VERSION_CUR 2) set(LIBMEMCACHEDUTIL_SO_VERSION_REV 0) set(LIBMEMCACHEDUTIL_SO_VERSION_AGE 0) -set(LIBMEMCACHEDUTIL_SO_SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHEDUTIL_SO_VERSION_REV}) +set(LIBMEMCACHEDUTIL_SO_SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}) set(LIBMEMCACHEDUTIL_SO_VERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHEDUTIL_SO_VERSION_REV}.${LIBMEMCACHEDUTIL_SO_VERSION_AGE}) # @@ -77,7 +77,7 @@ set(LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR 0) set(LIBMEMCACHEDPROTOCOL_SO_VERSION_REV 0) set(LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE 0) -set(LIBMEMCACHEDPROTOCOL_SO_SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_REV}) +set(LIBMEMCACHEDPROTOCOL_SO_SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}) set(LIBMEMCACHEDPROTOCOL_SO_VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_REV}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE}) # @@ -98,5 +98,5 @@ set(LIBHASHKIT_SO_VERSION_CUR 2) set(LIBHASHKIT_SO_VERSION_REV 0) set(LIBHASHKIT_SO_VERSION_AGE 0) -set(LIBHASHKIT_SO_SOVERSION ${LIBHASHKIT_SO_VERSION_CUR}.${LIBHASHKIT_SO_VERSION_REV}) +set(LIBHASHKIT_SO_SOVERSION ${LIBHASHKIT_SO_VERSION_CUR}) set(LIBHASHKIT_SO_VERSION ${LIBHASHKIT_SO_VERSION_CUR}.${LIBHASHKIT_SO_VERSION_REV}.${LIBHASHKIT_SO_VERSION_AGE}) -- 2.30.2 From 4ef24d8849ffcce9fdc78ef9907aa744a69687dc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 23 Dec 2020 16:32:00 +0100 Subject: [PATCH 16/16] fix for 32-bit --- test/lib/MemcachedCluster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/MemcachedCluster.cpp b/test/lib/MemcachedCluster.cpp index a443360b..4b1aa2c5 100644 --- a/test/lib/MemcachedCluster.cpp +++ b/test/lib/MemcachedCluster.cpp @@ -143,6 +143,6 @@ void MemcachedCluster::enableReplication() { void MemcachedCluster::killOneServer() const { const auto &servers = cluster.getServers(); - const auto &victim = servers[random_num(0UL, servers.size() - 1)]; + const auto &victim = servers[random_num((size_t)0, servers.size() - 1)]; ::kill(victim.getPid(), SIGKILL); } -- 2.30.2