Skip to content

Commit 1885dca

Browse files
committed
v0.6.0
1 parent d26470f commit 1885dca

8 files changed

Lines changed: 90 additions & 46 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
22
cmake_policy(SET CMP0048 NEW) # pass VERSION to project()
33
project(c4core
4-
VERSION 0.5.0
4+
VERSION 0.6.0
55
DESCRIPTION "Multiplatform low-level C++ utilities"
66
HOMEPAGE_URL "https://github.com/biojppm/c4core"
77
LANGUAGES CXX)
88
include(./cmake/c4Project.cmake)
99
include(./compat.cmake)
1010

11-
c4_project(VERSION 0.5.0
11+
c4_project(VERSION 0.6.0
1212
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
1313

1414
option(C4CORE_INSTALL "create install target" ON)

changelog/0.6.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This release commits to SONAME stability on patch releases (for versions 0.x) and on minor releases (for versions after 1.x). The release version is set to 0.6.0 (and therefore the SONAME to 0.6) because the SONAME of the previous release is 0.5.0.
2+
3+
- [PR#177](https://github.com/biojppm/c4core/pull/177): set SONAME to major/minor after/before 1.x. See [#176](https://github.com/biojppm/c4core/issues/176).
Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ rootdir=`git rev-parse --show-toplevel`
66
branch=`git rev-parse --abbrev-ref HEAD`
77

88
libname=$1 ; shift
9-
oldver=$1 ; shift
10-
if [ -v 1 ] ; then
11-
newver=$1 ; shift
12-
else
13-
newver=$branch
14-
fi
9+
currver=$1 ; shift
10+
nextver=$1 ; shift
11+
nextsoname=$1 ; shift
12+
1513
flags="-g -Og"
1614

1715
function gitcheckout()
@@ -28,7 +26,10 @@ function gitcheckout()
2826
function dumpbuild()
2927
{
3028
id=$1
31-
gitcheckout $id
29+
soname=
30+
if [ -v 2 ] ; then
31+
soname=$2
32+
fi
3233
bdir=$rootdir/build/abicheck-$id
3334
mkdir -p $bdir
3435
cmake -S $rootdir -B $bdir \
@@ -37,13 +38,26 @@ function dumpbuild()
3738
-D CMAKE_C_FLAGS="$flags" \
3839
-D BUILD_SHARED_LIBS=ON
3940
cmake --build $bdir -j
40-
abi-dumper $bdir/lib$libname.so \
41+
solib=$bdir/lib$libname.so
42+
abi-dumper $solib \
4143
-o $bdir/abi.dump \
4244
-lver $id
45+
if [ -n "$soname" ] ; then
46+
objdump -p $solib | grep SONAME
47+
soname_actual=$(objdump -p $solib | grep SONAME | sed "s:.*SONAME.*$libname\.so\.\(.*\):\1:")
48+
if [ "$soname_actual" != "$soname" ] ; then
49+
echo "error: SONAME: expected $soname, got $soname_actual"
50+
exit 1
51+
fi
52+
fi
4353
}
4454

45-
dumpbuild $newver ; newabi=$bdir/abi.dump
46-
dumpbuild $oldver ; oldabi=$bdir/abi.dump
55+
if [ $nextver != master ] ; then
56+
gitcheckout $nextver
57+
fi
58+
dumpbuild $nextver $nextsoname ; newabi=$bdir/abi.dump
59+
gitcheckout $currver
60+
dumpbuild $currver ; oldabi=$bdir/abi.dump
4761
gitcheckout $branch
4862

4963
stat=0
@@ -56,7 +70,7 @@ abi-compliance-checker -l $libname \
5670

5771
set +x
5872
echo "REPORT:"
59-
echo " $rootdir/build/compat_reports/c4core/${oldver}_to_${newver}/compat_report.html"
73+
echo " $rootdir/build/compat_reports/c4core/${currver}_to_${nextver}/compat_report.html"
6074
echo " status=$stat"
6175

6276
exit $stat
Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ function c4_release_bump()
3232
{
3333
( \
3434
set -euxo pipefail ; \
35-
ver=$(_c4_validate_ver $1) ; \
35+
rootdir=`git rev-parse --show-toplevel` ; \
36+
curr=$(cat $rootdir/tbump.toml \
37+
| grep -E '^current.*=.*"' \
38+
| sed 's/^current.*=.*"\(.*\)"/\1/') ; \
39+
ver=$(_c4_validate_ver $1 $curr) ; \
40+
_c4_set_ver_changelog $ver ; \
3641
tbump --non-interactive --only-patch $ver ; \
37-
sed 's/C[0-9]CORE_/C4CORE_/g' -i src/c4/version.hpp \
42+
sed 's/C[0-9]CORE_/C4CORE_/g' -i src/c4/version.hpp ; \
43+
_c4_check_abi_ver $curr $ver ; \
3844
)
3945
}
4046

@@ -98,51 +104,72 @@ function c4_release_force_push()
98104
)
99105
}
100106

101-
function _c4_validate_ver()
107+
function _c4_set_ver_changelog()
102108
{
103109
ver=$1
104-
if [ -z "$ver" ] ; then \
110+
if [ -z "$ver" ] ; then
105111
exit 1
106112
fi
107113
ver=$(echo $ver | sed "s:v\(.*\):\1:")
108-
#sver=$(echo $ver | sed "s:\([0-9]*\.[0-9]*\..[0-9]*\).*:\1:")
109-
# check the ABI version
110-
rootdir=`git rev-parse --show-toplevel`
111-
curr=$(cat $rootdir/tbump.toml \
112-
| grep -E '^current.*=.*"' \
113-
| sed 's/^current.*=.*"\(.*\)"/\1/')
114-
if [[ "$ver" < "$curr" ]] ; then
115-
echo "error: next version ($ver) is smaller than current ($curr)"
116-
exit 1
114+
if [ ! -f changelog/$ver.md ] ; then
115+
if [ -f changelog/current.md ] ; then
116+
git mv changelog/current.md changelog/$ver.md
117+
touch changelog/current.md
118+
git add changelog/current.md
119+
else
120+
echo "ERROR: could not find changelog/$ver.md or changelog/current.md"
121+
exit 1
122+
fi
117123
fi
118-
currmajor=$(echo $curr | sed 's:\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\):\1:')
119-
currminor=$(echo $curr | sed 's:\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\):\2:')
120-
currpatch=$(echo $curr | sed 's:\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\):\3:')
121-
nextmajor=$(echo $ver | sed 's:\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\):\1:')
122-
nextminor=$(echo $ver | sed 's:\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\):\2:')
123-
nextpatch=$(echo $ver | sed 's:\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\):\3:')
124+
}
125+
126+
function _c4_check_abi_ver()
127+
{
128+
curr=$1
129+
ver=$2
130+
# check the ABI version
131+
rxver="\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\)"
132+
currmajor=$(echo $curr | sed "s:${rxver}:\1:")
133+
currminor=$(echo $curr | sed "s:${rxver}:\2:")
134+
currpatch=$(echo $curr | sed "s:${rxver}:\3:")
135+
nextmajor=$(echo $ver | sed "s:${rxver}:\1:")
136+
nextminor=$(echo $ver | sed "s:${rxver}:\2:")
137+
nextpatch=$(echo $ver | sed "s:${rxver}:\3:")
124138
abi_must_be_same=0
125139
if [ $nextmajor -gt 0 ] ; then
140+
nextsoname=$nextmajor
126141
if [ $nextmajor -eq $currmajor ] ; then
127142
abi_must_be_same=1
128143
fi
129144
else
145+
nextsoname=$nextmajor.$nextminor
130146
if [ $nextminor -eq $currminor ] ; then
131147
abi_must_be_same=1
132148
fi
133149
fi
134150
if [ $abi_must_be_same == 1 ] ; then
135151
echo "ABI must be same"
136-
check_abi.sh c4core v$curr
152+
git commit -am "WIP abi check"
153+
rootdir=$(git rev-parse --show-toplevel)
154+
$rootdir/proj/check_abi.sh c4core v$curr master $nextsoname
155+
git reset --mixed HEAD~1
137156
fi
138-
# changelog
139-
if [ ! -f changelog/$ver.md ] ; then \
140-
if [ -f changelog/current.md ] ; then
141-
git mv changelog/current.md changelog/$ver.md
142-
touch changelog/current.md
143-
git add changelog/current.md
144-
else
145-
echo "ERROR: could not find changelog/$ver.md or changelog/current.md"
157+
}
158+
159+
function _c4_validate_ver()
160+
{
161+
ver=$1
162+
if [ -z "$ver" ] ; then
163+
exit 1
164+
fi
165+
ver=$(echo $ver | sed "s:v\(.*\):\1:")
166+
curr=
167+
if [ -v 2 ] ; then
168+
curr=$2
169+
fi
170+
if [ -n "$curr" ] ; then
171+
if [[ "$ver" < "$curr" ]] ; then
172+
echo "error: next version ($ver) is smaller than current ($curr)"
146173
exit 1
147174
fi
148175
fi

src/c4/version.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
/** @file version.hpp */
55

6-
#define C4CORE_VERSION "0.5.0"
6+
#define C4CORE_VERSION "0.6.0"
77
#define C4CORE_VERSION_MAJOR 0
8-
#define C4CORE_VERSION_MINOR 5
8+
#define C4CORE_VERSION_MINOR 6
99
#define C4CORE_VERSION_PATCH 0
1010

1111
#include <c4/export.hpp>

tbump.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# github_url = "https://github.com/<user or organization>/<project>/"
33

44
[version]
5-
current = "0.5.0"
5+
current = "0.6.0"
66

77
# Example of a semver regexp.
88
# Make sure this matches current_version before

test/test_install/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(c4core
44
HOMEPAGE_URL "https://github.com/biojppm/c4core"
55
LANGUAGES CXX)
66
include(../../cmake/c4Project.cmake)
7-
c4_project(VERSION 0.5.0
7+
c4_project(VERSION 0.6.0
88
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
99

1010
if(C4CORE_TEST_INSTALL_PACKAGE_MODE)

test/test_singleheader/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(c4core
44
HOMEPAGE_URL "https://github.com/biojppm/c4core"
55
LANGUAGES CXX)
66
include(../../cmake/c4Project.cmake)
7-
c4_project(VERSION 0.5.0
7+
c4_project(VERSION 0.6.0
88
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
99

1010
# amalgamate c4core to get the single header

0 commit comments

Comments
 (0)