Skip to content

Commit a29a954

Browse files
committed
Enforce use of capnp 1.1.0
1 parent bcf9596 commit a29a954

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This Dockerfile is used for ci to have the latest version of Cap'n Proto (1.1.0)
2+
# built from source. Since ubuntu package manager is not up to date.
3+
4+
# Start with a base image
5+
FROM ubuntu:22.04
6+
7+
# Set non-interactive mode to prevent prompts during installation
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
# Install dependencies
11+
RUN apt update && apt install -y \
12+
build-essential \
13+
cmake \
14+
curl \
15+
git \
16+
sudo \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Download and install Cap'n Proto 1.1.0
20+
WORKDIR /opt
21+
RUN curl -O https://capnproto.org/capnproto-c++-1.1.0.tar.gz && \
22+
tar zxf capnproto-c++-1.1.0.tar.gz && \
23+
cd capnproto-c++-1.1.0 && \
24+
./configure && \
25+
make -j$(nproc) check && \
26+
sudo make install && \
27+
cd .. && rm -rf capnproto-c++-1.1.0 capnproto-c++-1.1.0.tar.gz
28+
29+
# Set environment variables
30+
ENV PATH="/usr/local/bin:$PATH"
31+
32+
# Default shell
33+
CMD ["/bin/bash"]

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ env:
1818
jobs:
1919
test_dev:
2020
runs-on: ubuntu-latest
21+
# see capnp-build.dockerfile
22+
container: ghcr.io/jonoprest/capnp-runner:latest
2123
steps:
2224
- uses: actions/checkout@v3
2325
# selecting a toolchain either by action or manual `rustup` calls should happen
@@ -31,8 +33,6 @@ jobs:
3133
- name: Check capnp schema should match the generated code
3234
working-directory: ./hypersync-net-types
3335
run: |
34-
export DEBIAN_FRONTEND=noninteractive
35-
sudo apt-get install -y capnproto libcapnp-dev
3636
make capnp-build
3737
git diff --exit-code
3838

hypersync-net-types/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.PHONY: capnp-build
22

33
capnp-build:
4+
# Ensure we are building with the same capnp (1.1.0) in all environments
5+
capnp --version | grep -q "1.1.0"
46
cargo install capnpc
57
capnpc -orust:src hypersync_net_types.capnp
68
rustfmt -- src/hypersync_net_types_capnp.rs

hypersync-net-types/src/hypersync_net_types_capnp.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,13 @@ pub mod query_response_data {
323323
}
324324
impl Pipeline {}
325325
mod _private {
326-
pub static ENCODED_NODE: [::capnp::Word; 82] = [
327-
::capnp::word(0, 0, 0, 0, 6, 0, 6, 0),
326+
pub static ENCODED_NODE: [::capnp::Word; 81] = [
327+
::capnp::word(0, 0, 0, 0, 5, 0, 6, 0),
328328
::capnp::word(49, 157, 62, 151, 169, 39, 204, 137),
329329
::capnp::word(26, 0, 0, 0, 1, 0, 0, 0),
330330
::capnp::word(197, 128, 248, 24, 106, 165, 137, 146),
331331
::capnp::word(4, 0, 7, 0, 0, 0, 0, 0),
332332
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
333-
::capnp::word(22, 0, 0, 0, 138, 0, 0, 0),
334333
::capnp::word(21, 0, 0, 0, 98, 1, 0, 0),
335334
::capnp::word(41, 0, 0, 0, 7, 0, 0, 0),
336335
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
@@ -733,14 +732,13 @@ pub mod rollback_guard {
733732
}
734733
impl Pipeline {}
735734
mod _private {
736-
pub static ENCODED_NODE: [::capnp::Word; 100] = [
737-
::capnp::word(0, 0, 0, 0, 6, 0, 6, 0),
735+
pub static ENCODED_NODE: [::capnp::Word; 99] = [
736+
::capnp::word(0, 0, 0, 0, 5, 0, 6, 0),
738737
::capnp::word(75, 175, 253, 87, 239, 86, 125, 149),
739738
::capnp::word(26, 0, 0, 0, 1, 0, 3, 0),
740739
::capnp::word(197, 128, 248, 24, 106, 165, 137, 146),
741740
::capnp::word(2, 0, 7, 0, 0, 0, 0, 0),
742741
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
743-
::capnp::word(140, 0, 0, 0, 43, 1, 0, 0),
744742
::capnp::word(21, 0, 0, 0, 66, 1, 0, 0),
745743
::capnp::word(37, 0, 0, 0, 7, 0, 0, 0),
746744
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
@@ -1200,14 +1198,13 @@ pub mod query_response {
12001198
}
12011199
}
12021200
mod _private {
1203-
pub static ENCODED_NODE: [::capnp::Word; 100] = [
1204-
::capnp::word(0, 0, 0, 0, 6, 0, 6, 0),
1201+
pub static ENCODED_NODE: [::capnp::Word; 99] = [
1202+
::capnp::word(0, 0, 0, 0, 5, 0, 6, 0),
12051203
::capnp::word(226, 9, 54, 243, 16, 76, 106, 205),
12061204
::capnp::word(26, 0, 0, 0, 1, 0, 3, 0),
12071205
::capnp::word(197, 128, 248, 24, 106, 165, 137, 146),
12081206
::capnp::word(2, 0, 7, 0, 0, 0, 0, 0),
12091207
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
1210-
::capnp::word(45, 1, 0, 0, 228, 1, 0, 0),
12111208
::capnp::word(21, 0, 0, 0, 66, 1, 0, 0),
12121209
::capnp::word(37, 0, 0, 0, 7, 0, 0, 0),
12131210
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),

0 commit comments

Comments
 (0)