Skip to content

Commit c659685

Browse files
committed
ci: Add olddeps job to test old dependencies versions
The CI job currently just tests old Cap'n Proto versions, but it might be nice to extend in the future to test old compilers & build tools too. Support for versions of Cap'n Proto before 0.7.0 was dropped in #88 in order to avoid compiler warnings and simplify code. Before that, versions back to 0.5 were supported and are basically still compatible since the Cap'n Proto API hasn't changed and libmultiprocess does not rely on newer features.
1 parent 6c47c69 commit c659685

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
config: [default, llvm, gnu32, sanitize]
14+
config: [default, llvm, gnu32, sanitize, olddeps]
1515

1616
name: build • ${{ matrix.config }}
1717

ci/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ CI_CONFIG=ci/configs/default.bash ci/scripts/run.sh
2020
CI_CONFIG=ci/configs/llvm.bash ci/scripts/run.sh
2121
CI_CONFIG=ci/configs/gnu32.bash ci/scripts/run.sh
2222
CI_CONFIG=ci/configs/sanitize.bash ci/scripts/run.sh
23+
CI_CONFIG=ci/configs/olddeps.bash ci/scripts/run.sh
2324
```
2425

2526
By default CI jobs will reuse their build directories. `CI_CLEAN=1` can be specified to delete them before running instead.

ci/configs/olddeps.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CI_DESC="CI job using old Cap'n Proto version"
2+
CI_DIR=build-olddeps
3+
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds"
4+
NIX_ARGS=(--argstr capnprotoVersion "0.7.0")
5+
BUILD_ARGS=(-k)

doc/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# libmultiprocess Installation
22

3-
Installation currently requires Cap'n Proto:
3+
Installation currently requires Cap'n Proto 0.7 or higher:
44

55
```sh
66
apt install libcapnp-dev capnproto

shell.nix

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,39 @@
22
, crossPkgs ? import <nixpkgs> {}
33
, enableLibcxx ? false # Whether to use libc++ toolchain and libraries instead of libstdc++
44
, minimal ? false # Whether to create minimal shell without extra tools (faster when cross compiling)
5+
, capnprotoVersion ? null
56
}:
67

78
let
89
lib = pkgs.lib;
910
llvm = crossPkgs.llvmPackages_20;
10-
capnproto = crossPkgs.capnproto.override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; });
11+
capnprotoHashes = {
12+
"0.7.0" = "sha256-Y/7dUOQPDHjniuKNRw3j8dG1NI9f/aRWpf8V0WzV9k8=";
13+
"0.7.1" = "sha256-3cBpVmpvCXyqPUXDp12vCFCk32ZXWpkdOliNH37UwWE=";
14+
"0.8.0" = "sha256-rfiqN83begjJ9eYjtr21/tk1GJBjmeVfa3C3dZBJ93w=";
15+
"0.8.1" = "sha256-OZqNVYdyszro5rIe+w6YN00g6y8U/1b8dKYc214q/2o=";
16+
"0.9.0" = "sha256-yhbDcWUe6jp5PbIXzn5EoKabXiWN8lnS08hyfxUgEQ0=";
17+
"0.9.2" = "sha256-BspWOPZcP5nCTvmsDE62Zutox+aY5pw42d6hpH3v4cM=";
18+
"0.10.0" = "sha256-++F4l54OMTDnJ+FO3kV/Y/VLobKVRk461dopanuU3IQ=";
19+
"0.10.4" = "sha256-45sxnVyyYIw9i3sbFZ1naBMoUzkpP21WarzR5crg4X8=";
20+
"1.0.0" = "sha256-NLTFJdeOzqhk4ATvkc17Sh6g/junzqYBBEoXYGH/czo=";
21+
"1.0.2" = "sha256-LVdkqVBTeh8JZ1McdVNtRcnFVwEJRNjt0JV2l7RkuO8=";
22+
"1.1.0" = "sha256-gxkko7LFyJNlxpTS+CWOd/p9x/778/kNIXfpDGiKM2A=";
23+
"1.2.0" = "sha256-aDcn4bLZGq8915/NPPQsN5Jv8FRWd8cAspkG3078psc=";
24+
};
25+
capnprotoBase = if capnprotoVersion == null then crossPkgs.capnproto else crossPkgs.capnproto.overrideAttrs (old: {
26+
version = capnprotoVersion;
27+
src = crossPkgs.fetchFromGitHub {
28+
owner = "capnproto";
29+
repo = "capnproto";
30+
rev = "v${capnprotoVersion}";
31+
hash = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
32+
};
33+
patches = lib.optionals (lib.versionAtLeast capnprotoVersion "0.9.0" && lib.versionOlder capnprotoVersion "0.10.4") [ ./ci/patches/spaceship.patch ];
34+
} // (lib.optionalAttrs (lib.versionOlder capnprotoVersion "0.10") {
35+
env = { }; # Drop -std=c++20 flag forced by nixpkgs
36+
}));
37+
capnproto = capnprotoBase.override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; });
1138
clang = if enableLibcxx then llvm.libcxxClang else llvm.clang;
1239
clang-tools = llvm.clang-tools.override { inherit enableLibcxx; };
1340
in crossPkgs.mkShell {

0 commit comments

Comments
 (0)