Skip to content

build: Fix missing Cap'n Proto include directories#82

Merged
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/inc
Oct 4, 2022
Merged

build: Fix missing Cap'n Proto include directories#82
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/inc

Conversation

@ryanofsky
Copy link
Copy Markdown
Collaborator

Two bugs configuring Cap'n Proto include directories were reported by sjors in #75

They appear to have gone undetected because they were masked in other contexts by CMAKE_INCLUDE_PATH and NIX_CFLAGS_COMPILE environment variable settings (#75 (comment))

The first bug is missing ${CAPNP_INCLUDE_DIRECTORY} target_include_directories in the util target. This resulted in a compile error include/mp/util.h:8:10: fatal error: 'capnp/schema.h' file not found

The second bug was misspelling CAPNP_INCLUDE_DIRS as capnp_INCLUDE_DIRS in the configure check for kj/filesystem.h, which caused HAVE_KJ_FILESYSTEM to be unset and could result in runtime errors like:

capnp compile: --import-path=/prefix/include: no such directory
Try 'capnp compile --help' for more information.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Invoking capnp failed

Two bugs configuring Cap'n Proto include directories were reported by Sjors
Provoost <sjors@sprovoost.nl> in
bitcoin-core#75

They appear to have gone undetected because they were masked in other contexts
by CMAKE_INCLUDE_PATH and NIX_CFLAGS_COMPILE environment variable settings
(bitcoin-core#75 (comment))

The first bug is missing ${CAPNP_INCLUDE_DIRECTORY} target_include_directories
in the util target. This resulted in a compile error "include/mp/util.h:8:10:
fatal error: 'capnp/schema.h' file not found"

The second bug was misspelling CAPNP_INCLUDE_DIRS as capnp_INCLUDE_DIRS in the
configure check for kj/filesystem.h, which caused HAVE_KJ_FILESYSTEM to be
unset and could result in runtime errors like:

  capnp compile: --import-path=/prefix/include: no such directory
  Try 'capnp compile --help' for more information.
  terminate called after throwing an instance of 'std::runtime_error'
    what():  Invoking capnp failed
@Sjors
Copy link
Copy Markdown
Member

Sjors commented Sep 30, 2022

tACK c753623

@ryanofsky ryanofsky merged commit e66e6e8 into bitcoin-core:master Oct 4, 2022
@ryanofsky
Copy link
Copy Markdown
Collaborator Author

Thanks for reporting this and testing the patch

@bitcoin-core bitcoin-core locked and limited conversation to collaborators Jun 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants