-
Notifications
You must be signed in to change notification settings - Fork 4
Description
while working on stratum-mining/sv2-apps#59 I noticed this CI failure
that made me realize that having bitcoin-capnp-types as a build dependency is introducing a new development pre-requisite, which I probably resolved a while ago on my workstation when first exploring capnproto development and never thought about it again, but now I'm being forced to re-visit this with more careful eyes
on a Ubuntu system, I can easily fix the CI error from the link above via apt-get install capnproto, but then the build errors become:
error: failed to run custom build command for `bitcoin-capnp-types v0.1.0 (https://github.com/2140-dev/bitcoin-capnp-types?rev=2ccda4c10554a204188d563eab707a8d07334b52#2ccda4c1)`
Caused by:
process didn't exit successfully: `/home/ubuntu/sv2-apps/pool-apps/target/debug/build/bitcoin-capnp-types-9cbfcae8ba49f7a5/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=capnp
--- stderr
capnp/common.capnp:7:20-38: error: Import failed: /capnp/c++.capnp
capnp/common.capnp:8:2-5: error: Not defined: Cxx
capnp/proxy.capnp:7:20-38: error: Import failed: /capnp/c++.capnp
capnp/proxy.capnp:8:2-5: error: Not defined: Cxx
capnp/echo.capnp:7:20-38: error: Import failed: /capnp/c++.capnp
capnp/echo.capnp:8:2-5: error: Not defined: Cxx
capnp/init.capnp:7:20-38: error: Import failed: /capnp/c++.capnp
capnp/init.capnp:8:2-5: error: Not defined: Cxx
capnp/mining.capnp:7:20-38: error: Import failed: /capnp/c++.capnp
capnp/mining.capnp:8:2-5: error: Not defined: Cxx
thread 'main' (38362) panicked at /home/ubuntu/.cargo/git/checkouts/bitcoin-capnp-types-dd6f02671a2e5d84/2ccda4c/build.rs:11:10:
called `Result::unwrap()` on an `Err` value: Error { kind: Failed, extra: "Error while trying to execute `capnp compile`: Premature end of file." }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
which suggests some adaptations would be required to edit: turns out this can be solved on Ubuntu simply by installing build.rslibcapnp-dev in addition to capnproto, no need to touch build.rs... this is merely a documentation issue
ideally, we should think of something that works universally across most popular UNIX-based development platforms (e.g.: macOS and popular linux distros)