Skip to content

Commit 4437886

Browse files
committed
Merge bitcoin-core/secp256k1#1468: v0.4.1 release aftermath
b37fdb2 check-abi: Minor UI improvements (Tim Ruffing) ad5f589 check-abi: Default to HEAD for new version (Tim Ruffing) 9fb7e2f release process: Style and formatting nits (Tim Ruffing) e7053d0 release process: Add email step (Tim Ruffing) 429d21d release process: Run sanity checks on release PR (Tim Ruffing) Pull request description: ACKs for top commit: hebasto: ACK b37fdb2. jonasnick: ACK b37fdb2 Tree-SHA512: 6e18a5b897d29a3dd3a73ba81623dd91c04fa6730fb56374b924dc84baaec8c55d0c689ee1a41dab9a03ccd566082fc59ffb5d68cafd536a136fc7aaac2d8ef5
2 parents a9db9f2 + b37fdb2 commit 4437886

File tree

2 files changed

+51
-48
lines changed

2 files changed

+51
-48
lines changed

doc/release-process.md

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Release Process
1+
# Release process
22

33
This document outlines the process for releasing versions of the form `$MAJOR.$MINOR.$PATCH`.
44

@@ -14,31 +14,30 @@ This process also assumes that there will be no minor releases for old major rel
1414

1515
We aim to cut a regular release every 3-4 months, approximately twice as frequent as major Bitcoin Core releases. Every second release should be published one month before the feature freeze of the next major Bitcoin Core release, allowing sufficient time to update the library in Core.
1616

17-
## Sanity Checks
18-
Perform these checks before creating a release:
17+
## Sanity checks
18+
Perform these checks when reviewing the release PR (see below):
1919

2020
1. Ensure `make distcheck` doesn't fail.
21-
```shell
22-
./autogen.sh && ./configure --enable-dev-mode && make distcheck
23-
```
21+
```shell
22+
./autogen.sh && ./configure --enable-dev-mode && make distcheck
23+
```
2424
2. Check installation with autotools:
25-
```shell
26-
dir=$(mktemp -d)
27-
./autogen.sh && ./configure --prefix=$dir && make clean && make install && ls -RlAh $dir
28-
gcc -o ecdsa examples/ecdsa.c $(PKG_CONFIG_PATH=$dir/lib/pkgconfig pkg-config --cflags --libs libsecp256k1) -Wl,-rpath,"$dir/lib" && ./ecdsa
29-
```
25+
```shell
26+
dir=$(mktemp -d)
27+
./autogen.sh && ./configure --prefix=$dir && make clean && make install && ls -RlAh $dir
28+
gcc -o ecdsa examples/ecdsa.c $(PKG_CONFIG_PATH=$dir/lib/pkgconfig pkg-config --cflags --libs libsecp256k1) -Wl,-rpath,"$dir/lib" && ./ecdsa
29+
```
3030
3. Check installation with CMake:
31-
```shell
32-
dir=$(mktemp -d)
33-
build=$(mktemp -d)
34-
cmake -B $build -DCMAKE_INSTALL_PREFIX=$dir && cmake --build $build --target install && ls -RlAh $dir
35-
gcc -o ecdsa examples/ecdsa.c -I $dir/include -L $dir/lib*/ -l secp256k1 -Wl,-rpath,"$dir/lib",-rpath,"$dir/lib64" && ./ecdsa
36-
```
37-
4. Use the [`check-abi.sh`](/tools/check-abi.sh) tool to ensure there are no unexpected ABI incompatibilities and that the version number and release notes accurately reflect all potential ABI changes. To run this tool, the `abi-dumper` and `abi-compliance-checker` packages are required.
38-
39-
```shell
40-
tools/check-abi.sh
41-
```
31+
```shell
32+
dir=$(mktemp -d)
33+
build=$(mktemp -d)
34+
cmake -B $build -DCMAKE_INSTALL_PREFIX=$dir && cmake --build $build --target install && ls -RlAh $dir
35+
gcc -o ecdsa examples/ecdsa.c -I $dir/include -L $dir/lib*/ -l secp256k1 -Wl,-rpath,"$dir/lib",-rpath,"$dir/lib64" && ./ecdsa
36+
```
37+
4. Use the [`check-abi.sh`](/tools/check-abi.sh) tool to verify that there are no unexpected ABI incompatibilities and that the version number and the release notes accurately reflect all potential ABI changes. To run this tool, the `abi-dumper` and `abi-compliance-checker` packages are required.
38+
```shell
39+
tools/check-abi.sh
40+
```
4241

4342
## Regular release
4443

@@ -47,47 +46,48 @@ tools/check-abi.sh
4746
* adding a section for the release (make sure that the version number is a link to a diff between the previous and new version),
4847
* removing the `[Unreleased]` section header, and
4948
* including an entry for `### ABI Compatibility` if it doesn't exist,
50-
* sets `_PKG_VERSION_IS_RELEASE` to `true` in `configure.ac`, and
51-
* if this is not a patch release
52-
* updates `_PKG_VERSION_*` and `_LIB_VERSION_*` in `configure.ac` and
49+
* sets `_PKG_VERSION_IS_RELEASE` to `true` in `configure.ac`, and,
50+
* if this is not a patch release,
51+
* updates `_PKG_VERSION_*` and `_LIB_VERSION_*` in `configure.ac`, and
5352
* updates `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_*` in `CMakeLists.txt`.
54-
2. After the PR is merged, tag the commit and push it:
53+
2. Perform the [sanity checks](#sanity-checks) on the PR branch.
54+
3. After the PR is merged, tag the commit, and push the tag:
5555
```
5656
RELEASE_COMMIT=<merge commit of step 1>
5757
git tag -s v$MAJOR.$MINOR.$PATCH -m "libsecp256k1 $MAJOR.$MINOR.$PATCH" $RELEASE_COMMIT
5858
git push [email protected]:bitcoin-core/secp256k1.git v$MAJOR.$MINOR.$PATCH
5959
```
60-
3. Open a PR to the master branch with a commit (using message `"release cleanup: bump version after $MAJOR.$MINOR.$PATCH"`, for example) that
60+
4. Open a PR to the master branch with a commit (using message `"release cleanup: bump version after $MAJOR.$MINOR.$PATCH"`, for example) that
6161
* sets `_PKG_VERSION_IS_RELEASE` to `false` and increments `_PKG_VERSION_PATCH` and `_LIB_VERSION_REVISION` in `configure.ac`,
6262
* increments the `$PATCH` component of `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_REVISION` in `CMakeLists.txt`, and
6363
* adds an `[Unreleased]` section header to the [CHANGELOG.md](../CHANGELOG.md).
6464

6565
If other maintainers are not present to approve the PR, it can be merged without ACKs.
66-
4. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
66+
5. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
67+
6. Send an announcement email to the bitcoin-dev mailing list.
6768

6869
## Maintenance release
6970

70-
Note that bugfixes only need to be backported to releases for which no compatible release without the bug exists.
71+
Note that bug fixes need to be backported only to releases for which no compatible release without the bug exists.
7172

7273
1. If there's no maintenance branch `$MAJOR.$MINOR`, create one:
7374
```
7475
git checkout -b $MAJOR.$MINOR v$MAJOR.$MINOR.$((PATCH - 1))
7576
git push [email protected]:bitcoin-core/secp256k1.git $MAJOR.$MINOR
7677
```
7778
2. Open a pull request to the `$MAJOR.$MINOR` branch that
78-
* includes the bugfixes,
79+
* includes the bug fixes,
7980
* finalizes the release notes similar to a regular release,
8081
* increments `_PKG_VERSION_PATCH` and `_LIB_VERSION_REVISION` in `configure.ac`
8182
and the `$PATCH` component of `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_REVISION` in `CMakeLists.txt`
8283
(with commit message `"release: bump versions for $MAJOR.$MINOR.$PATCH"`, for example).
83-
3. After the PRs are merged, update the release branch and tag the commit:
84+
3. Perform the [sanity checks](#sanity-checks) on the PR branch.
85+
4. After the PRs are merged, update the release branch, tag the commit, and push the tag:
8486
```
8587
git checkout $MAJOR.$MINOR && git pull
8688
git tag -s v$MAJOR.$MINOR.$PATCH -m "libsecp256k1 $MAJOR.$MINOR.$PATCH"
87-
```
88-
4. Push tag:
89-
```
9089
git push [email protected]:bitcoin-core/secp256k1.git v$MAJOR.$MINOR.$PATCH
9190
```
92-
5. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
93-
6. Open PR to the master branch that includes a commit (with commit message `"release notes: add $MAJOR.$MINOR.$PATCH"`, for example) that adds release notes to [CHANGELOG.md](../CHANGELOG.md).
91+
6. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
92+
7. Send an announcement email to the bitcoin-dev mailing list.
93+
8. Open PR to the master branch that includes a commit (with commit message `"release notes: add $MAJOR.$MINOR.$PATCH"`, for example) that adds release notes to [CHANGELOG.md](../CHANGELOG.md).

tools/check-abi.sh

+15-12
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
set -eu
44

55
default_base_version="$(git describe --match "v*.*.*" --abbrev=0)"
6-
default_new_version="master"
6+
default_new_version="HEAD"
77

88
display_help_and_exit() {
9-
echo "Usage: $0 <base_ver> <new_ver>"
9+
echo "Usage: $0 [<base_ver> [<new_ver>]]"
1010
echo ""
1111
echo "Description: This script uses the ABI Compliance Checker tool to determine if the ABI"
1212
echo " of a new version of libsecp256k1 has changed in a backward-incompatible way."
1313
echo ""
1414
echo "Options:"
15-
echo " base_ver Specify the base version (default: $default_base_version)"
16-
echo " new_ver Specify the new version (default: $default_new_version)"
15+
echo " base_ver Specify the base version as a git commit-ish"
16+
echo " (default: most recent reachable tag matching \"v.*.*\", currently \"$default_base_version\")"
17+
echo " new_ver Specify the new version as a git commit-ish"
18+
echo " (default: $default_new_version)"
1719
echo " -h, --help Display this help message"
1820
exit 0
1921
}
@@ -23,17 +25,20 @@ if [ "$#" -eq 0 ]; then
2325
new_version="$default_new_version"
2426
elif [ "$#" -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" = "--help" ]; }; then
2527
display_help_and_exit
26-
elif [ "$#" -eq 2 ]; then
28+
elif [ "$#" -eq 1 ] || [ "$#" -eq 2 ]; then
2729
base_version="$1"
28-
new_version="$2"
30+
if [ "$#" -eq 2 ]; then
31+
new_version="$2"
32+
fi
2933
else
3034
echo "Invalid usage. See help:"
3135
echo ""
3236
display_help_and_exit
3337
fi
3438

3539
checkout_and_build() {
36-
git worktree add -d "$1" "$2"
40+
_orig_dir="$(pwd)"
41+
git worktree add --detach "$1" "$2"
3742
cd "$1"
3843
mkdir build && cd build
3944
cmake -S .. --preset dev-mode \
@@ -45,20 +50,18 @@ checkout_and_build() {
4550
-DSECP256K1_BUILD_EXAMPLES=OFF
4651
cmake --build . -j "$(nproc)"
4752
abi-dumper src/libsecp256k1.so -o ABI.dump -lver "$2"
53+
cd "$_orig_dir"
4854
}
4955

5056
echo "Comparing $base_version (base version) to $new_version (new version)"
5157
echo
5258

53-
original_dir="$(pwd)"
54-
55-
base_source_dir=$(mktemp -d)
59+
base_source_dir="$(mktemp -d)"
5660
checkout_and_build "$base_source_dir" "$base_version"
5761

58-
new_source_dir=$(mktemp -d)
62+
new_source_dir="$(mktemp -d)"
5963
checkout_and_build "$new_source_dir" "$new_version"
6064

61-
cd "$original_dir"
6265
abi-compliance-checker -lib libsecp256k1 -old "${base_source_dir}/build/ABI.dump" -new "${new_source_dir}/build/ABI.dump"
6366
git worktree remove "$base_source_dir"
6467
git worktree remove "$new_source_dir"

0 commit comments

Comments
 (0)