Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit a8bc3cb

Browse files
Merge pull request #1277 from lukaszstolarczuk/merge-stable-1.10-into-stable-1.11
Merge stable-1.10 into stable-1.11
2 parents 59f4271 + 59e291a commit a8bc3cb

10 files changed

Lines changed: 132 additions & 91 deletions

File tree

.github/workflows/gha.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ jobs:
1313
env:
1414
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
1515
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
16-
GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }}
1716
HOST_WORKDIR: /home/runner/work/libpmemobj-cpp/libpmemobj-cpp
1817
WORKDIR: utils/docker
1918
strategy:
2019
matrix:
2120
CONFIG: ["TYPE=debug OS=fedora OS_VER=32 PUSH_IMAGE=1",
2221
"TYPE=debug OS=ubuntu OS_VER=20.04 PUSH_IMAGE=1 CHECK_CPP_STYLE=1",
2322
"TYPE=debug OS=ubuntu OS_VER=20.04 COVERAGE=1",
24-
"TYPE=release OS=fedora OS_VER=32 AUTO_DOC_UPDATE=1",
23+
"TYPE=release OS=fedora OS_VER=32",
2524
"TYPE=release OS=ubuntu OS_VER=20.04",
2625
"TYPE=valgrind OS=ubuntu OS_VER=20.04",
2726
"TYPE=memcheck_drd OS=ubuntu OS_VER=20.04",
@@ -73,7 +72,8 @@ jobs:
7372
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
7473
windows:
7574
name: Windows
76-
runs-on: windows-latest
75+
runs-on: windows-2019
76+
7777
env:
7878
platform: x64
7979
VCPKG_DEFAULT_TRIPLET: x64-windows
@@ -82,14 +82,14 @@ jobs:
8282
PMDK_VERSION: "1.8"
8383
CMAKE_TOOLCHAIN_FILE: "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
8484
CMAKE_INSTALL_PREFIX: "C:\\install\\libpmemobj-cpp"
85-
WORKDIR: "D:\\a\\libpmemobj-cpp\\libpmemobj-cpp\\"
86-
MSBUILD: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
8785
strategy:
8886
matrix:
8987
CONFIG: [Debug, Release]
9088
steps:
91-
- name: Update PATH
92-
run: echo "${env:MSBUILD}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
89+
- name: Setup MSBuild.exe
90+
uses: microsoft/setup-msbuild@v1.1
91+
with:
92+
msbuild-architecture: ${env:ARCH}
9393

9494
- name: Cache vcpkg packages
9595
uses: actions/cache@v1

CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: BSD-3-Clause
2-
# Copyright 2018-2021, Intel Corporation
2+
# Copyright 2018-2022, Intel Corporation
33

44
cmake_minimum_required(VERSION 3.3)
55
project(libpmemobj-cpp C CXX)
@@ -9,10 +9,7 @@ set(VERSION_MINOR 11)
99
set(VERSION_PATCH 0)
1010
#set(VERSION_PRERELEASE rc3)
1111

12-
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
13-
if (VERSION_PATCH GREATER 0)
14-
set(VERSION ${VERSION}.${VERSION_PATCH})
15-
endif()
12+
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
1613
if (VERSION_PRERELEASE)
1714
set(VERSION ${VERSION}-${VERSION_PRERELEASE})
1815
endif()

ChangeLog

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
Mon Aug 29 2022 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
2+
3+
* Version 1.10.1
4+
5+
This release fixes minor bugs.
6+
7+
This is the last patch release for libpmemobj-cpp 1.10 version.
8+
Maintenance of this version is no longer supported.
9+
10+
It contains all bugfixes and updates from previous patch releases
11+
(1.9.1, 1.8.2, 1.7.1, 1.6.1, 1.5.2).
12+
13+
Mon Aug 08 2022 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
14+
15+
* Version 1.9.1
16+
17+
This release fixes minor bugs.
18+
19+
Notable changes:
20+
- concurrent_hash_map: fix free_data()
21+
- concurrent_hash_map: make double to size_t cast explicit in defragment()
22+
- peristent_ptr: add missing offset calculation
23+
24+
Mon Aug 01 2022 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
25+
26+
* Version 1.8.2
27+
28+
This release fixes minor bugs.
29+
30+
This is the last patch release for libpmemobj-cpp 1.8 version.
31+
Maintenance of this version is no longer supported.
32+
33+
Notable changes:
34+
- vector: fix referencing empty array
35+
- vector: Fix undefined behaviour on realloc
36+
37+
Fri Jul 29 2022 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
38+
39+
* Version 1.7.1
40+
41+
This release fixes minor bugs.
42+
43+
This is the last patch release for libpmemobj-cpp 1.7 version.
44+
Maintenance of this version is no longer supported.
45+
46+
Notable changes:
47+
- Properly install pkg-config file for all configurations
48+
- Fix void_t declaration and API usage for concurrent hashmap test
49+
150
Tue Jul 06 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
251

352
* Version 1.6.1

doc/RELEASE_STEPS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Publish package and make it official:
3232

3333
Later, for major/minor release:
3434
- bump version of Docker images (build.sh, build-image.sh, push-image.sh, pull-or-rebuild-image.sh) to $VER+1 on master branch
35-
- add new branch in valid-branches.sh and in "doc" job definition within .github/workflows/gha.yml, on stable-$VER branch
36-
- once gh-pages contains new documentation:
35+
- add new branch in "doc" job definition within .github/workflows/gha.yml, on stable-$VER branch
36+
- once 'main' branch of pmem.io repository contains new documentation:
3737
- add there (in index.md) v.$VER section in Doxygen docs links
3838
- update "Releases' support status" table (older releases' statuses as well, if needed)

include/libpmemobj++/persistent_ptr.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
/* Copyright 2015-2020, Intel Corporation */
2+
/* Copyright 2015-2021, Intel Corporation */
33

44
/**
55
* @file
@@ -576,7 +576,10 @@ class persistent_ptr : public persistent_ptr_base {
576576
inline ptrdiff_t
577577
calculate_offset() const
578578
{
579-
static const ptrdiff_t ptr_offset_magic = 0xDEADBEEF;
579+
static const ptrdiff_t ptr_offset_magic = 0xF00000000000000;
580+
581+
static_assert(ptr_offset_magic % alignof(U) == 0, "");
582+
static_assert(ptr_offset_magic % alignof(T) == 0, "");
580583

581584
U *tmp{reinterpret_cast<U *>(ptr_offset_magic)};
582585
T *diff = static_cast<T *>(tmp);

include/libpmemobj++/pexceptions.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
/* Copyright 2016-2020, Intel Corporation */
2+
/* Copyright 2016-2022, Intel Corporation */
33

44
/**
55
* @file
@@ -39,8 +39,10 @@ errormsg(void)
3939
/**
4040
* Custom pool error class.
4141
*
42-
* Thrown when there is a runtime problem with some action on the
43-
* pool.
42+
* Thrown when there is a runtime problem with some action on the pool,
43+
* e.g., when cannot open or create a pool, the wrong handle to pool
44+
* was passed to some function, or a referenced object is not stored
45+
* on persistent memory.
4446
*/
4547
class pool_error : public std::runtime_error {
4648
public:
@@ -114,7 +116,10 @@ class transaction_alloc_error : public transaction_error {
114116
/**
115117
* Custom out of memory error class.
116118
*
117-
* Thrown when there is out of memory error inside of transaction.
119+
* Thrown when there is out of memory error inside of a transaction.
120+
* It may occur when you run out of space on persistent memory:
121+
* too many objects or too big object was allocated (current limit for
122+
* a single element is ~16GB). Bigger pool or smaller object is required.
118123
*/
119124
class transaction_out_of_memory : public transaction_alloc_error,
120125
public std::bad_alloc {

utils/docker/build.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# SPDX-License-Identifier: BSD-3-Clause
3-
# Copyright 2017-2020, Intel Corporation
3+
# Copyright 2017-2022, Intel Corporation
44

55
#
66
# build-local.sh - runs a Docker container from a Docker image with environment
@@ -118,19 +118,13 @@ docker run --privileged=true --name=$containerName -i $TTY \
118118
--env COVERAGE=$COVERAGE \
119119
--env CI_RUN=$CI_RUN \
120120
--env TRAVIS=$TRAVIS \
121+
--env GITHUB_ACTIONS=$GITHUB_ACTIONS \
121122
--env GITHUB_REPO=$GITHUB_REPO \
122123
--env CI_COMMIT_RANGE=$CI_COMMIT_RANGE \
123124
--env CI_COMMIT=$CI_COMMIT \
124125
--env CI_REPO_SLUG=$CI_REPO_SLUG \
125126
--env CI_BRANCH=$CI_BRANCH \
126127
--env CI_EVENT_TYPE=$CI_EVENT_TYPE \
127-
--env GITHUB_ACTIONS=$GITHUB_ACTIONS \
128-
--env GITHUB_HEAD_REF=$GITHUB_HEAD_REF \
129-
--env GITHUB_REPO=$GITHUB_REPO \
130-
--env GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
131-
--env GITHUB_REF=$GITHUB_REF \
132-
--env GITHUB_RUN_ID=$GITHUB_RUN_ID \
133-
--env GITHUB_SHA=$GITHUB_SHA \
134128
--env DOC_UPDATE_GITHUB_TOKEN=$DOC_UPDATE_GITHUB_TOKEN \
135129
--env DOC_UPDATE_BOT_NAME=$DOC_UPDATE_BOT_NAME \
136130
--env DOC_REPO_OWNER=$DOC_REPO_OWNER \

utils/docker/run-build.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# SPDX-License-Identifier: BSD-3-Clause
3-
# Copyright 2016-2020, Intel Corporation
3+
# Copyright 2016-2022, Intel Corporation
44

55
#
66
# run-build.sh - is called inside a Docker container; prepares the environment
@@ -62,10 +62,6 @@ function compile_example_standalone() {
6262
cd -
6363
}
6464

65-
function sudo_password() {
66-
echo $USERPASS | sudo -Sk $*
67-
}
68-
6965
###############################################################################
7066
# BUILD tests_clang_debug_cpp17_no_valgrind llvm
7167
###############################################################################

utils/docker/run-doc-update.sh

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# SPDX-License-Identifier: BSD-3-Clause
3-
# Copyright 2018-2020, Intel Corporation
3+
# Copyright 2018-2022, Intel Corporation
44

55
#
66
# run-doc-update.sh - is called inside a Docker container,
@@ -10,69 +10,80 @@
1010

1111
set -e
1212

13-
source `dirname $0`/valid-branches.sh
13+
if [[ -z "${DOC_UPDATE_GITHUB_TOKEN}" ]]; then
14+
echo "To build documentation and upload it as a Github pull request, variable " \
15+
"'DOC_UPDATE_GITHUB_TOKEN' has to be provided."
16+
exit 1
17+
fi
18+
19+
if [[ -z "${WORKDIR}" ]]; then
20+
echo "ERROR: The variable WORKDIR has to contain a path to the root " \
21+
"of this project - 'build' sub-directory may be created there."
22+
exit 1
23+
fi
1424

1525
BOT_NAME=${DOC_UPDATE_BOT_NAME:-"pmem-bot"}
16-
DOC_REPO_OWNER="${DOC_REPO_OWNER:-"pmem"}"
17-
REPO_NAME="libpmemobj-cpp"
26+
DOC_REPO_OWNER=${DOC_REPO_OWNER:-"pmem"}
27+
DOC_REPO_NAME=${DOC_REPO_NAME:-"${DOC_REPO_OWNER}.github.io"}
28+
export GITHUB_TOKEN=${DOC_UPDATE_GITHUB_TOKEN} # export for hub command
29+
DOC_REPO_DIR=$(mktemp -d -t pmem_io-XXX)
1830
ARTIFACTS_DIR=$(mktemp -d -t ARTIFACTS-XXX)
1931

20-
ORIGIN="https://${DOC_UPDATE_GITHUB_TOKEN}@github.com/${BOT_NAME}/${REPO_NAME}"
21-
UPSTREAM="https://github.com/${DOC_REPO_OWNER}/${REPO_NAME}"
22-
# master or stable-* branch
23-
TARGET_BRANCH=${CI_BRANCH}
24-
VERSION=${TARGET_BRANCHES[$TARGET_BRANCH]}
25-
export GITHUB_TOKEN=${DOC_UPDATE_GITHUB_TOKEN}
26-
27-
if [ -z $VERSION ]; then
28-
echo "Target location for branch ${TARGET_BRANCH} is not defined."
29-
exit 1
32+
# Determine docs location directory, based on the branch (for CI builds: 'master' or 'vX.Y')
33+
if [[ ${CI_BRANCH} == stable-* ]]; then
34+
DOCS_TARGET_DIR=$(echo ${CI_BRANCH} | awk -F 'stable-' '/stable-/{printf "v"} {print $(NF)}')
35+
else
36+
DOCS_TARGET_DIR=${CI_BRANCH}
3037
fi
31-
REPO_DIR=$(mktemp -d -t libpmemobjcpp-XXX)
32-
pushd ${REPO_DIR}
33-
# Clone repo
34-
git clone ${ORIGIN} ${REPO_DIR}
35-
cd ${REPO_DIR}
36-
git remote add upstream ${UPSTREAM}
3738

38-
git config --local user.name ${BOT_NAME}
39-
git config --local user.email "${BOT_NAME}@intel.com"
40-
hub config --global hub.protocol https
41-
42-
git remote update
43-
git checkout -B ${TARGET_BRANCH} upstream/${TARGET_BRANCH}
39+
ORIGIN="https://${GITHUB_TOKEN}@github.com/${BOT_NAME}/${DOC_REPO_NAME}"
40+
UPSTREAM="https://github.com/${DOC_REPO_OWNER}/${DOC_REPO_NAME}"
4441

45-
# Build docs
46-
mkdir -p ${REPO_DIR}/build
47-
cd ${REPO_DIR}/build
42+
echo "Build docs"
43+
pushd ${WORKDIR}
44+
mkdir -p build
45+
pushd build
4846

49-
cmake .. -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF
47+
cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_DOC=ON ..
5048
make -j$(nproc) doc
51-
cp -r ${REPO_DIR}/build/doc/cpp_html ${ARTIFACTS_DIR}/
49+
cp -R doc/cpp_html ${ARTIFACTS_DIR}
50+
popd
51+
popd
5252

53-
cd ${REPO_DIR}
53+
echo "Clone pmem.io repo (with web content and our docs):"
54+
git clone --depth=1 ${ORIGIN} ${DOC_REPO_DIR}
55+
pushd ${DOC_REPO_DIR}
56+
git remote add upstream ${UPSTREAM}
57+
git fetch upstream
58+
59+
git config --local user.name ${BOT_NAME}
60+
git config --local user.email "${BOT_NAME}@intel.com"
61+
hub config --global hub.protocol https
5462

55-
# Checkout gh-pages and copy docs
56-
GH_PAGES_NAME="gh-pages-for-${TARGET_BRANCH}"
57-
git checkout -B ${GH_PAGES_NAME} upstream/gh-pages
63+
echo "Checkout new branch (based on 'main') for PR"
64+
DOCS_BRANCH_NAME="libpmemobj-cpp-${DOCS_TARGET_DIR}-docs-update"
65+
git checkout -B ${DOCS_BRANCH_NAME} upstream/main
5866
git clean -dfx
5967

60-
# Clean old content, since some files might have been deleted
61-
rm -rf ./${VERSION}
62-
mkdir -p ./${VERSION}/doxygen/
68+
DOCS_CONTENT_DIR="./content/libpmemobj-cpp/${DOCS_TARGET_DIR}/"
69+
echo "Clean old content, since some files might have been deleted"
70+
rm -rf ${DOCS_CONTENT_DIR}
71+
mkdir -p ${DOCS_CONTENT_DIR}/doxygen/
6372

64-
cp -fr ${ARTIFACTS_DIR}/cpp_html/* ./${VERSION}/doxygen/
73+
echo "Copy all content"
74+
cp -r ${ARTIFACTS_DIR}/cpp_html/* ${DOCS_CONTENT_DIR}/doxygen/
6575

66-
# Add and push changes.
76+
echo "Add and push changes"
6777
# git commit command may fail if there is nothing to commit.
6878
# In that case we want to force push anyway (there might be open pull request with
6979
# changes which were reverted).
7080
git add -A
71-
git commit -m "doc: automatic gh-pages docs update" && true
72-
git push -f ${ORIGIN} ${GH_PAGES_NAME}
81+
git commit -m "libpmemobj-cpp: automatic docs update for '${CI_BRANCH}'" && true
82+
git push -f ${ORIGIN} ${DOCS_BRANCH_NAME}
7383

74-
# Makes pull request.
84+
echo "Make a Pull Request"
7585
# When there is already an open PR or there are no changes an error is thrown, which we ignore.
76-
hub pull-request -f -b ${DOC_REPO_OWNER}:gh-pages -h ${BOT_NAME}:${GH_PAGES_NAME} -m "doc: automatic gh-pages docs update" && true
86+
hub pull-request -f -b ${DOC_REPO_OWNER}:main -h ${BOT_NAME}:${DOCS_BRANCH_NAME} \
87+
-m "libpmemobj-cpp: automatic docs update for '${CI_BRANCH}'" && true
7788

7889
popd

utils/docker/valid-branches.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)