Skip to content

Commit 2d8886f

Browse files
committed
Merge #228: Add versions.md and version.h files describing version branches and tags
6e01d2d Add versions.md and version.h files describing version branches and tags (Ryan Ofsky) Pull request description: Having libmultiprocess version numbers should be helpful for: - Backporting fixes for previous Bitcoin Core releases if we need to do that at some point (bitcoin/bitcoin#33439). - Letting Bitcoin Core releases describe what libmultiprocess versions they are compatible with (bitcoin/bitcoin#33576) - Letting code detect what version is used at compile-time or runtime, for logging, feature detection, error reporting, or other purposes. ACKs for top commit: TheCharlatan: ACK 6e01d2d Tree-SHA512: 06fc4489c90b0e70dde4c13525625491a9f8988bacbc6e79821b5cab34cdf0cbd7adf7348bce247a9e7efcc42cef0f61db11802a4fa8a8a5d773569628ea81ec
2 parents c1838be + 6e01d2d commit 2d8886f

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

doc/versions.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# libmultiprocess Versions
2+
3+
Library versions are tracked with simple
4+
[tags](https://github.com/bitcoin-core/libmultiprocess/tags) and
5+
[branches](https://github.com/bitcoin-core/libmultiprocess/branches).
6+
7+
Versioning policy is described in the [version.h](../include/mp/version.h)
8+
include.
9+
10+
## v7
11+
- Current unstable version in master branch.
12+
- Intended to be compatible with Bitcoin Core 30.1 and future releases.
13+
14+
## v6.0
15+
- `EventLoop::addClient` and `EventLoop::removeClient` methods dropped,
16+
requiring clients to use new `EventLoopRef` class instead.
17+
- Compatible with Bitcoin Core 30.0 release.
18+
19+
## v5.0
20+
- Broke up `proxy-types.h` into `type-*.h` files requiring clients to explicitly
21+
include overloads needed for C++ ↔️ Cap'n Proto type conversions.
22+
- Now requires C++ 20 support.
23+
- Compatible with Bitcoin Core 29 releases.
24+
25+
## v4.0
26+
- Added better cmake support, installing cmake package files so clients do not
27+
need to use pkgconfig.
28+
- Compatible with Bitcoin Core 28 releases.
29+
30+
## v3.0
31+
- Dropped compatibility with Cap'n Proto versions before 0.7.
32+
- Compatible with Bitcoin Core 27 releases.
33+
34+
## v2.0
35+
- Changed `PassField` function signature.
36+
- Now requires C++17 support.
37+
- Compatible with Bitcoin Core 25 and 26 releases.
38+
39+
## v1.0
40+
- Dropped hardcoded includes in generated files, now requiring `include` and
41+
`includeTypes` annotations.
42+
- Compatible with Bitcoin Core 22, 23, and 24 releases.
43+
44+
## v0.0
45+
- Initial version used in a downstream release.
46+
- Compatible with Bitcoin Core 21 releases.

include/mp/version.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
#ifndef MP_VERSION_H
6+
#define MP_VERSION_H
7+
8+
//! Major version number. Should be incremented in the master branch before
9+
//! changes that introduce major new features or break API compatibility, if
10+
//! there are clients relying on the previous API. (If an API changes multiple
11+
//! times and nothing uses the intermediate changes, it is sufficient to
12+
//! increment this only once before the first change.)
13+
//!
14+
//! Each time this is incremented, a new stable branch should be created. E.g.
15+
//! when this is incremented to 8, a "v7" stable branch should be created
16+
//! pointing at the prior merge commit. The /doc/versions.md file should also be
17+
//! updated, noting any significant or incompatible changes made since the
18+
//! previous version, and backported to the stable branch before it is tagged.
19+
#define MP_MAJOR_VERSION 7
20+
21+
//! Minor version number. Should be incremented in stable branches after
22+
//! backporting changes. The /doc/versions.md file in the master and stable
23+
//! branches should also be updated to list the new minor version.
24+
#define MP_MINOR_VERSION 0
25+
26+
#endif // MP_VERSION_H

test/mp/test/test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,27 @@
2525
#include <mp/proxy.capnp.h>
2626
#include <mp/proxy-io.h>
2727
#include <mp/util.h>
28+
#include <mp/version.h>
2829
#include <optional>
2930
#include <set>
3031
#include <stdexcept>
3132
#include <string>
3233
#include <string_view>
3334
#include <system_error>
3435
#include <thread>
36+
#include <type_traits>
3537
#include <utility>
3638
#include <vector>
3739

3840
namespace mp {
3941
namespace test {
4042

43+
/** Check version.h header values */
44+
constexpr auto kMP_MAJOR_VERSION{MP_MAJOR_VERSION};
45+
constexpr auto kMP_MINOR_VERSION{MP_MINOR_VERSION};
46+
static_assert(std::is_integral_v<decltype(kMP_MAJOR_VERSION)>, "MP_MAJOR_VERSION must be an integral constant");
47+
static_assert(std::is_integral_v<decltype(kMP_MINOR_VERSION)>, "MP_MINOR_VERSION must be an integral constant");
48+
4149
/**
4250
* Test setup class creating a two way connection between a
4351
* ProxyServer<FooInterface> object and a ProxyClient<FooInterface>.

0 commit comments

Comments
 (0)