Skip to content

Commit 151ef65

Browse files
committed
ci: Add olddeps job to old versions of dependencies
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 151ef65

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-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: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
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.8.0" = "sha256-rfiqN83begjJ9eYjtr21/tk1GJBjmeVfa3C3dZBJ93w=";
14+
};
15+
capnprotoBase = if capnprotoVersion == null then crossPkgs.capnproto else crossPkgs.capnproto.overrideAttrs (old: {
16+
version = capnprotoVersion;
17+
src = crossPkgs.fetchFromGitHub {
18+
owner = "capnproto";
19+
repo = "capnproto";
20+
rev = "v${capnprotoVersion}";
21+
hash = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
22+
};
23+
env = {};
24+
patches = [];
25+
});
26+
capnproto = capnprotoBase.override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; });
1127
clang = if enableLibcxx then llvm.libcxxClang else llvm.clang;
1228
clang-tools = llvm.clang-tools.override { inherit enableLibcxx; };
1329
in crossPkgs.mkShell {

0 commit comments

Comments
 (0)