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

Commit 9c7aaa6

Browse files
Merge pull request #1211 from lukaszstolarczuk/merge-stable-1.13-into-master
Merge stable-1.13 into master
2 parents 2083ad3 + a41f14e commit 9c7aaa6

File tree

10 files changed

+54
-33
lines changed

10 files changed

+54
-33
lines changed

.github/workflows/gha.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,20 @@ jobs:
2929
WORKDIR: utils/docker
3030
strategy:
3131
matrix:
32-
CONFIG: ["TYPE=debug OS=fedora OS_VER=32 PUSH_IMAGE=1",
33-
"TYPE=debug OS=fedora OS_VER=34 PUSH_IMAGE=1",
32+
CONFIG: ["TYPE=debug OS=fedora OS_VER=34 PUSH_IMAGE=1",
3433
"TYPE=debug OS=ubuntu OS_VER=20.04 PUSH_IMAGE=1 CHECK_CPP_STYLE=1",
3534
"TYPE=debug OS=ubuntu OS_VER=20.04 COVERAGE=1",
36-
"TYPE=release OS=fedora OS_VER=32",
35+
"TYPE=release OS=fedora OS_VER=34",
3736
"TYPE=release OS=ubuntu OS_VER=20.04",
38-
"TYPE=valgrind OS=ubuntu OS_VER=20.04",
39-
"TYPE=memcheck_drd OS=ubuntu OS_VER=20.04",
40-
"TYPE=package OS=fedora OS_VER=32",
37+
"TYPE=valgrind OS=ubuntu OS_VER=20.04 TESTS_VALGRIND_UNWIND=0",
38+
"TYPE=memcheck_drd OS=ubuntu OS_VER=20.04 TESTS_VALGRIND_UNWIND=0",
39+
"TYPE=package OS=fedora OS_VER=34",
4140
"TYPE=package OS=ubuntu OS_VER=20.04"]
4241
steps:
4342
- name: Get release version
4443
if: github.event_name == 'release'
4544
id: get_release_version
46-
run: echo ::set-output name=VERSION::$(echo ${{ github.event.release.tag_name }} | grep -E "^[0-9]+.[0-9]+(-rc[0-9]+)?$" | cut -f 1,2 -d . | cut -f 1 -d -)
45+
run: echo ::set-output name=VERSION::$(echo ${{ github.event.release.tag_name }} | awk -F '[.-]' '/^[0-9]+.[0-9]+[.0-9]*(-rc[0-9]+)?$/ {print $1 "." $2}')
4746

4847
- name: Set image version and force image action for release
4948
if: github.event_name == 'release' && steps.get_release_version.outputs.VERSION != ''
@@ -52,9 +51,16 @@ jobs:
5251
echo "FORCE_IMAGE_ACTION=rebuild" >> $GITHUB_ENV
5352
5453
- name: Set image version and force image action for stable branch
55-
if: startsWith(github.ref, 'refs/heads/stable-')
54+
# we want to set IMG_VER to e.g. '1.x' for stable branches and PRs against them
55+
# for PRs we have to use 'base_ref' - this is the target branch (and we have to check that instead)
56+
if:
57+
startsWith(github.ref, 'refs/heads/stable-') || startsWith(github.base_ref, 'stable-')
58+
# we now know we're on (or against) stable branches, so we just need to pick the version (e.g. the mentioned '1.x')
5659
run: |
57-
echo "IMG_VER=$(echo ${GITHUB_REF#refs/heads/} | cut -d - -f 2)" >> $GITHUB_ENV
60+
IMG_VER=$(echo ${GITHUB_BASE_REF} | cut -d - -f 2)
61+
[ -z "${IMG_VER}" ] \
62+
&& echo "IMG_VER=$(echo ${GITHUB_REF#refs/heads/} | cut -d - -f 2)" >> $GITHUB_ENV \
63+
|| echo "IMG_VER=${IMG_VER}" >> $GITHUB_ENV
5864
echo "FORCE_IMAGE_ACTION=rebuild" >> $GITHUB_ENV
5965
6066
- name: Clone the git repo
@@ -68,6 +74,7 @@ jobs:
6874

6975
- name: Run the build
7076
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
77+
7178
doc:
7279
name: build and publish docs
7380
runs-on: ubuntu-latest
@@ -83,6 +90,12 @@ jobs:
8390
matrix:
8491
CONFIG: ["TYPE=doc OS=fedora OS_VER=34"]
8592
steps:
93+
- name: Set image version for stable branch
94+
# doc update happens only on stable branch (not on PR), so we check only for heads ref
95+
if: startsWith(github.ref, 'refs/heads/stable-')
96+
run: |
97+
echo "IMG_VER=$(echo ${GITHUB_REF#refs/heads/} | cut -d - -f 2)" >> $GITHUB_ENV
98+
8699
- name: Clone the git repo
87100
uses: actions/checkout@v2
88101
with:

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
"OS=debian OS_VER=testing",
3434
"OS=debian OS_VER=unstable",
3535
"OS=debian OS_VER=latest",
36+
"OS=fedora OS_VER=32",
3637
"OS=fedora OS_VER=33",
37-
"OS=fedora OS_VER=34",
3838
"OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
3939
"OS=opensuse-leap OS_VER=latest",
4040
"OS=opensuse-tumbleweed OS_VER=latest",

.github/workflows/weekly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
"TYPE=debug OS=ubuntu OS_VER=20.04 TESTS_UBSAN=1 TESTS_PMREORDER=0",
2929
"TYPE=debug OS=fedora OS_VER=rawhide TESTS_ASAN=1 TESTS_PMREORDER=0",
3030
"TYPE=debug OS=fedora OS_VER=rawhide TESTS_UBSAN=1 TESTS_PMREORDER=0",
31-
"TYPE=valgrind OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
32-
"TYPE=memcheck_drd OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
31+
"TYPE=valgrind OS=fedora OS_VER=rawhide TESTS_PMREORDER=0 TESTS_VALGRIND_UNWIND=0",
32+
"TYPE=memcheck_drd OS=fedora OS_VER=rawhide TESTS_PMREORDER=0 TESTS_VALGRIND_UNWIND=0",
3333
"TYPE=package OS=fedora OS_VER=34",
3434
"TYPE=package OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
3535
"TYPE=package OS=ubuntu OS_VER=devel"]

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ option(CHECK_CPP_STYLE "check code style of C++ sources" OFF)
7878
option(TRACE_TESTS "more verbose test outputs" OFF)
7979
option(USE_ASAN "enable AddressSanitizer (debugging)" OFF)
8080
option(USE_UBSAN "enable UndefinedBehaviorSanitizer (debugging)" OFF)
81+
option(USE_LIBUNWIND "use libunwind for more reliable stack traces from tests (if available)" ON)
8182
option(USE_CCACHE "use ccache if it is available in the system" ON)
8283

8384
option(TESTS_USE_FORCED_PMEM "run tests with PMEM_IS_PMEM_FORCE=1 - it speeds up tests execution on emulated pmem" OFF)

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ include(tbb)
8181

8282
add_library(test_backtrace STATIC test_backtrace.c)
8383
if(LIBUNWIND_FOUND)
84-
target_compile_definitions(test_backtrace PUBLIC USE_LIBUNWIND=1)
84+
target_compile_definitions(test_backtrace PUBLIC LIBUNWIND_ENABLED=1)
8585
endif()
8686

8787
add_library(valgrind_internal STATIC valgrind_internal.cpp)

tests/ctest_helpers.cmake

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ function(find_packages)
3434
find_package(Curses QUIET)
3535
endif()
3636

37-
if(PKG_CONFIG_FOUND)
38-
pkg_check_modules(LIBUNWIND QUIET libunwind)
39-
else()
40-
find_package(LIBUNWIND QUIET)
41-
endif()
42-
if(NOT LIBUNWIND_FOUND)
43-
message(WARNING "libunwind not found. Stack traces from tests will not be reliable")
37+
if (USE_LIBUNWIND)
38+
if(PKG_CONFIG_FOUND)
39+
pkg_check_modules(LIBUNWIND QUIET libunwind)
40+
else()
41+
find_package(LIBUNWIND QUIET)
42+
endif()
43+
if(NOT LIBUNWIND_FOUND)
44+
message(WARNING "libunwind not found. Stack traces from tests will not be reliable")
45+
else()
46+
message(STATUS "Found libunwind: ${LIBUNWIND_LIBDIR} (version: ${LIBUNWIND_VERSION})")
47+
endif()
4448
endif()
4549

4650
find_gdb()

tests/test_backtrace.c

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

44
/*
55
* backtrace.c -- backtrace reporting routines
@@ -16,7 +16,7 @@
1616
#include <stdlib.h>
1717
#include <string.h>
1818

19-
#ifdef USE_LIBUNWIND
19+
#ifdef LIBUNWIND_ENABLED
2020

2121
#define UNW_LOCAL_ONLY
2222
#include <dlfcn.h>
@@ -90,7 +90,7 @@ test_dump_backtrace(void)
9090
unw_strerror(ret), ret);
9191
}
9292
}
93-
#else /* USE_LIBUNWIND */
93+
#else /* LIBUNWIND_ENABLED */
9494

9595
#define BSIZE 100
9696

@@ -162,7 +162,7 @@ test_dump_backtrace(void)
162162

163163
#endif /* _WIN32 */
164164

165-
#endif /* USE_LIBUNWIND */
165+
#endif /* LIBUNWIND_ENABLED */
166166

167167
/*
168168
* test_sighandler -- fatal signal handler

utils/docker/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ docker run --privileged=true --name=${CONTAINER_NAME} -i \
139139
--env TESTS_PACKAGES=${TESTS_PACKAGES:-ON} \
140140
--env TESTS_ASAN=${TESTS_ASAN:-OFF} \
141141
--env TESTS_UBSAN=${TESTS_UBSAN:-OFF} \
142+
--env TESTS_VALGRIND_UNWIND=${TESTS_VALGRIND_UNWIND:-OFF} \
142143
--env TEST_TIMEOUT=${TEST_TIMEOUT} \
143144
--env TZ='Europe/Warsaw' \
144145
--shm-size=4G \

utils/docker/images/install-valgrind.sh

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

55
#
6-
# install-valgrind.sh - installs valgrind for persistent memory
6+
# install-valgrind.sh - installs valgrind with pmemcheck
77
#
88

99
set -e
@@ -13,10 +13,10 @@ if [ "${SKIP_VALGRIND_BUILD}" ]; then
1313
exit
1414
fi
1515

16-
git clone --recursive https://github.com/pmem/valgrind.git
16+
git clone https://github.com/pmem/valgrind.git
1717
cd valgrind
18-
# pmem-3.15: Merge pull request #81 from marcinslusarz/pmem-3.15
19-
git checkout 09f75f69683d862f8456f75484fcdc0dc5508900
18+
# pmem-3.17: Merge pull request #85 from lukaszstolarczuk/pmem-3.17; 16.08.2021
19+
git checkout ff6f0f125f8e1b1a2a8615f2b14efeaf135ad01b
2020

2121
./autogen.sh
2222
./configure --prefix=/usr

utils/docker/run-build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ TESTS_PACKAGES=${TESTS_PACKAGES:-ON}
2323
TESTS_USE_FORCED_PMEM=${TESTS_USE_FORCED_PMEM:-ON}
2424
TESTS_ASAN=${TESTS_ASAN:-OFF}
2525
TESTS_UBSAN=${TESTS_UBSAN:-OFF}
26+
TESTS_VALGRIND_UNWIND=${TESTS_VALGRIND_UNWIND:-OFF}
2627
TEST_TIMEOUT=${TEST_TIMEOUT:-600}
2728

2829
export PMREORDER_STACKTRACE_DEPTH=20
@@ -106,6 +107,7 @@ function tests_clang_release_cpp11_no_valgrind() {
106107
# BUILD build_gcc_debug_cpp14 (no tests)
107108
###############################################################################
108109
function build_gcc_debug_cpp14() {
110+
VALGRIND_UNWIND=${1:-ON}
109111
mkdir build
110112
cd build
111113

@@ -128,7 +130,8 @@ function build_gcc_debug_cpp14() {
128130
-DTESTS_COMPATIBILITY=1 \
129131
-DTESTS_CONCURRENT_GDB=1 \
130132
-DUSE_ASAN=${TESTS_ASAN} \
131-
-DUSE_UBSAN=${TESTS_UBSAN}
133+
-DUSE_UBSAN=${TESTS_UBSAN} \
134+
-DUSE_LIBUNWIND=${VALGRIND_UNWIND}
132135

133136
make -j$(nproc)
134137
}
@@ -152,7 +155,7 @@ function tests_gcc_debug_cpp14_no_valgrind() {
152155
###############################################################################
153156
function tests_gcc_debug_cpp14_valgrind_memcheck_drd() {
154157
printf "\n$(tput setaf 1)$(tput setab 7)BUILD ${FUNCNAME[0]} START$(tput sgr 0)\n"
155-
build_gcc_debug_cpp14
158+
build_gcc_debug_cpp14 ${TESTS_VALGRIND_UNWIND}
156159
ctest -R "_memcheck|_drd" --timeout ${TEST_TIMEOUT} --output-on-failure
157160
workspace_cleanup
158161
printf "$(tput setaf 1)$(tput setab 7)BUILD ${FUNCNAME[0]} END$(tput sgr 0)\n\n"
@@ -163,7 +166,7 @@ function tests_gcc_debug_cpp14_valgrind_memcheck_drd() {
163166
###############################################################################
164167
function tests_gcc_debug_cpp14_valgrind_other() {
165168
printf "\n$(tput setaf 1)$(tput setab 7)BUILD ${FUNCNAME[0]} START$(tput sgr 0)\n"
166-
build_gcc_debug_cpp14
169+
build_gcc_debug_cpp14 ${TESTS_VALGRIND_UNWIND}
167170
ctest -E "_none|_memcheck|_drd" --timeout ${TEST_TIMEOUT} --output-on-failure
168171
ctest -R "_pmreorder" --timeout ${TEST_TIMEOUT} --output-on-failure
169172
workspace_cleanup
@@ -210,7 +213,6 @@ function tests_gcc_release_cpp17_no_valgrind() {
210213
###############################################################################
211214
# BUILD tests_clang_release_cpp20_no_valgrind llvm
212215
###############################################################################
213-
214216
function tests_clang_release_cpp20_no_valgrind() {
215217
printf "\n$(tput setaf 1)$(tput setab 7)BUILD ${FUNCNAME[0]} START$(tput sgr 0)\n"
216218

0 commit comments

Comments
 (0)