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

Commit 25c0949

Browse files
Merge pull request #1273 from lukaszstolarczuk/merge-stable-1.9-into-stable-1.10
Merge stable-1.9 into stable-1.10
2 parents c9a06ae + 6e840f1 commit 25c0949

File tree

8 files changed

+124
-60
lines changed

8 files changed

+124
-60
lines changed

.github/workflows/gha.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
env:
1515
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
1616
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
17-
GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }}
17+
DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }}
1818
HOST_WORKDIR: /home/runner/work/libpmemobj-cpp/libpmemobj-cpp
1919
WORKDIR: utils/docker
2020
strategy:
@@ -46,7 +46,8 @@ jobs:
4646

4747
windows:
4848
name: Windows
49-
runs-on: windows-latest
49+
runs-on: windows-2019
50+
5051
env:
5152
platform: x64
5253
VCPKG_DEFAULT_TRIPLET: x64-windows
@@ -55,14 +56,14 @@ jobs:
5556
PMDK_VERSION: "1.8"
5657
CMAKE_TOOLCHAIN_FILE: "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
5758
CMAKE_INSTALL_PREFIX: "C:\\install\\libpmemobj-cpp"
58-
WORKDIR: "D:\\a\\libpmemobj-cpp\\libpmemobj-cpp\\"
59-
MSBUILD: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
6059
strategy:
6160
matrix:
6261
CONFIG: [Debug, Release]
6362
steps:
64-
- name: Update PATH
65-
run: echo "${env:MSBUILD}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
63+
- name: Setup MSBuild.exe
64+
uses: microsoft/[email protected]
65+
with:
66+
msbuild-architecture: ${env:ARCH}
6667

6768
- name: Cache vcpkg packages
6869
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 10)
99
set(VERSION_PATCH 0)
1010
#set(VERSION_PRERELEASE rc2)
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: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
Mon Aug 08 2022 Łukasz Stolarczuk <[email protected]>
2+
3+
* Version 1.9.1
4+
5+
This release fixes minor bugs.
6+
7+
Notable changes:
8+
- concurrent_hash_map: fix free_data()
9+
- concurrent_hash_map: make double to size_t cast explicit in defragment()
10+
- peristent_ptr: add missing offset calculation
11+
12+
Mon Aug 01 2022 Łukasz Stolarczuk <[email protected]>
13+
14+
* Version 1.8.2
15+
16+
This release fixes minor bugs.
17+
18+
This is the last patch release for libpmemobj-cpp 1.8 version.
19+
Maintenance of this version is no longer supported.
20+
21+
Notable changes:
22+
- vector: fix referencing empty array
23+
- vector: Fix undefined behaviour on realloc
24+
25+
Fri Jul 29 2022 Łukasz Stolarczuk <[email protected]>
26+
27+
* Version 1.7.1
28+
29+
This release fixes minor bugs.
30+
31+
This is the last patch release for libpmemobj-cpp 1.7 version.
32+
Maintenance of this version is no longer supported.
33+
34+
Notable changes:
35+
- Properly install pkg-config file for all configurations
36+
- Fix void_t declaration and API usage for concurrent hashmap test
37+
138
Tue Jul 06 2021 Łukasz Stolarczuk <[email protected]>
239

340
* Version 1.6.1

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
@@ -607,7 +607,10 @@ class persistent_ptr : public persistent_ptr_base {
607607
inline ptrdiff_t
608608
calculate_offset() const
609609
{
610-
static const ptrdiff_t ptr_offset_magic = 0xDEADBEEF;
610+
static const ptrdiff_t ptr_offset_magic = 0xF00000000000000;
611+
612+
static_assert(ptr_offset_magic % alignof(U) == 0, "");
613+
static_assert(ptr_offset_magic % alignof(T) == 0, "");
611614

612615
U *tmp{reinterpret_cast<U *>(ptr_offset_magic)};
613616
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 & 2 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
@@ -125,7 +125,7 @@ docker run --privileged=true --name=$containerName -i $TTY \
125125
--env CI_REPO_SLUG=$CI_REPO_SLUG \
126126
--env CI_BRANCH=$CI_BRANCH \
127127
--env CI_EVENT_TYPE=$CI_EVENT_TYPE \
128-
--env GITHUB_TOKEN=$GITHUB_TOKEN \
128+
--env DOC_UPDATE_GITHUB_TOKEN=${DOC_UPDATE_GITHUB_TOKEN} \
129129
--env COVERITY_SCAN_TOKEN=$COVERITY_SCAN_TOKEN \
130130
--env COVERITY_SCAN_NOTIFICATION_EMAIL=$COVERITY_SCAN_NOTIFICATION_EMAIL \
131131
--env CHECK_CPP_STYLE=${CHECK_CPP_STYLE:-OFF} \

utils/docker/run-build.sh

Lines changed: 5 additions & 1 deletion
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
@@ -60,6 +60,10 @@ function sudo_password() {
6060
echo $USERPASS | sudo -Sk $*
6161
}
6262

63+
if [ "$CI_RUN" == "YES" ]; then
64+
sudo_password chown -R $(id -u).$(id -g) $WORKDIR
65+
fi || true
66+
6367
sudo_password mkdir /mnt/pmem
6468
sudo_password chmod 0777 /mnt/pmem
6569
sudo_password mount -o size=2G -t tmpfs none /mnt/pmem

utils/docker/run-doc-update.sh

Lines changed: 57 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,85 @@
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
set -e
66

77
source `dirname $0`/valid-branches.sh
88

9-
BOT_NAME="pmem-bot"
10-
USER_NAME="pmem"
11-
REPO_NAME="libpmemobj-cpp"
12-
13-
ORIGIN="https://${GITHUB_TOKEN}@github.com/${BOT_NAME}/${REPO_NAME}"
14-
UPSTREAM="https://github.com/pmem/${REPO_NAME}"
15-
# master or stable-* branch
16-
TARGET_BRANCH=${CI_BRANCH}
17-
VERSION=${TARGET_BRANCHES[$TARGET_BRANCH]}
18-
19-
if [ -z $VERSION ]; then
20-
echo "Target location for branch $TARGET_BRANCH is not defined."
9+
if [[ -z "${DOC_UPDATE_GITHUB_TOKEN}" ]]; then
10+
echo "To build documentation and upload it as a Github pull request, variable " \
11+
"'DOC_UPDATE_GITHUB_TOKEN' has to be provided."
2112
exit 1
2213
fi
2314

24-
# Clone repo
25-
git clone ${ORIGIN}
26-
cd ${REPO_NAME}
27-
git remote add upstream ${UPSTREAM}
15+
if [[ -z "${WORKDIR}" ]]; then
16+
echo "ERROR: The variable WORKDIR has to contain a path to the root " \
17+
"of this project - 'build' sub-directory may be created there."
18+
exit 1
19+
fi
2820

29-
git config --local user.name ${BOT_NAME}
30-
git config --local user.email "${BOT_NAME}@intel.com"
21+
BOT_NAME=${DOC_UPDATE_BOT_NAME:-"pmem-bot"}
22+
DOC_REPO_OWNER=${DOC_REPO_OWNER:-"pmem"}
23+
DOC_REPO_NAME=${DOC_REPO_NAME:-"${DOC_REPO_OWNER}.github.io"}
24+
export GITHUB_TOKEN=${DOC_UPDATE_GITHUB_TOKEN} # export for hub command
25+
DOC_REPO_DIR=$(mktemp -d -t pmem_io-XXX)
26+
ARTIFACTS_DIR=$(mktemp -d -t ARTIFACTS-XXX)
27+
28+
# Determine docs location directory, based on the branch (for CI builds: 'master' or 'vX.Y')
29+
if [[ ${CI_BRANCH} == stable-* ]]; then
30+
DOCS_TARGET_DIR=$(echo ${CI_BRANCH} | awk -F 'stable-' '/stable-/{printf "v"} {print $(NF)}')
31+
else
32+
DOCS_TARGET_DIR=${CI_BRANCH}
33+
fi
3134

32-
git remote update
33-
git checkout -B ${TARGET_BRANCH} upstream/${TARGET_BRANCH}
35+
ORIGIN="https://${GITHUB_TOKEN}@github.com/${BOT_NAME}/${DOC_REPO_NAME}"
36+
UPSTREAM="https://github.com/${DOC_REPO_OWNER}/${DOC_REPO_NAME}"
3437

35-
# Build docs
36-
mkdir build
37-
cd build
38+
echo "Build docs"
39+
pushd ${WORKDIR}
40+
mkdir -p build
41+
pushd build
3842

39-
cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF ..
43+
cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_DOC=ON ..
4044
make -j$(nproc) doc
41-
cp -R doc/cpp_html ../..
45+
cp -R doc/cpp_html ${ARTIFACTS_DIR}
46+
popd
47+
popd
48+
49+
echo "Clone pmem.io repo (with web content and our docs):"
50+
git clone --depth=1 ${ORIGIN} ${DOC_REPO_DIR}
51+
pushd ${DOC_REPO_DIR}
52+
git remote add upstream ${UPSTREAM}
53+
git fetch upstream
4254

43-
cd ..
55+
git config --local user.name ${BOT_NAME}
56+
git config --local user.email "${BOT_NAME}@intel.com"
57+
hub config --global hub.protocol https
4458

45-
# Checkout gh-pages and copy docs
46-
GH_PAGES_NAME="gh-pages-for-${TARGET_BRANCH}"
47-
git checkout -B $GH_PAGES_NAME upstream/gh-pages
59+
echo "Checkout new branch (based on 'main') for PR"
60+
DOCS_BRANCH_NAME="libpmemobj-cpp-${DOCS_TARGET_DIR}-docs-update"
61+
git checkout -B ${DOCS_BRANCH_NAME} upstream/main
4862
git clean -dfx
4963

50-
# Clean old content, since some files might have been deleted
51-
rm -rf ./$VERSION
52-
mkdir -p ./$VERSION/doxygen/
64+
DOCS_CONTENT_DIR="./content/libpmemobj-cpp/${DOCS_TARGET_DIR}/"
65+
echo "Clean old content, since some files might have been deleted"
66+
rm -rf ${DOCS_CONTENT_DIR}
67+
mkdir -p ${DOCS_CONTENT_DIR}/doxygen/
5368

54-
cp -r ../cpp_html/* ./$VERSION/doxygen/
69+
echo "Copy all content"
70+
cp -r ${ARTIFACTS_DIR}/cpp_html/* ${DOCS_CONTENT_DIR}/doxygen/
5571

56-
# Add and push changes.
72+
echo "Add and push changes"
5773
# git commit command may fail if there is nothing to commit.
5874
# In that case we want to force push anyway (there might be open pull request with
5975
# changes which were reverted).
6076
git add -A
61-
git commit -m "doc: automatic gh-pages docs update" && true
62-
git push -f ${ORIGIN} $GH_PAGES_NAME
77+
git commit -m "libpmemobj-cpp: automatic docs update for '${CI_BRANCH}'" && true
78+
git push -f ${ORIGIN} ${DOCS_BRANCH_NAME}
6379

64-
# Makes pull request.
80+
echo "Make a Pull Request"
6581
# When there is already an open PR or there are no changes an error is thrown, which we ignore.
66-
hub pull-request -f -b ${USER_NAME}:gh-pages -h ${BOT_NAME}:${GH_PAGES_NAME} -m "doc: automatic gh-pages docs update" && true
82+
hub pull-request -f -b ${DOC_REPO_OWNER}:main -h ${BOT_NAME}:${DOCS_BRANCH_NAME} \
83+
-m "libpmemobj-cpp: automatic docs update for '${CI_BRANCH}'" && true
6784

68-
exit 0
85+
popd

0 commit comments

Comments
 (0)