Skip to content

cmake: add ONLY_CAPNP target_capnp_sources option#230

Merged
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/onlycap
Nov 6, 2025
Merged

cmake: add ONLY_CAPNP target_capnp_sources option#230
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/onlycap

Conversation

@ryanofsky
Copy link
Collaborator

Make target_capnp_sources function take ONLY_CAPNP option to only add cap'n proto-generated files to the target library and not add libmultiprocess-generated ones.

This is needed in bitcoin/bitcoin#10102 to support building with ENABLE_IPC=ON and ENABLE_WALLET=OFF because libmultiprocess-generated wallet files wallet.capnp.proxy*.c++ can't be built without causing link errors, while the wallet.capnp.c++ file is still necessary to build because it is referenced by init.capnp and node.capnp there.

Make `target_capnp_sources` function take `ONLY_CAPNP` option to only add cap'n
proto-generated files to the target library and not add
libmultiprocess-generated ones.

This is needed in bitcoin/bitcoin#10102 to support
building with ENABLE_IPC=ON and ENABLE_WALLET=OFF because libmultiprocess-generated
wallet files `wallet.capnp.proxy*.c++` can't be built without causing link
errors, while the `wallet.capnp.c++` file is still necessary to build because
it is referenced by `init.capnp` and `node.capnp` there.
@DrahtBot
Copy link

DrahtBot commented Oct 22, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Comment on lines -114 to +119
add_custom_target("${target}_headers" DEPENDS ${generated_headers})
if(NOT TARGET "${target}_headers")
add_custom_target("${target}_headers" DEPENDS ${generated_headers})
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are reasonable on their own. Maybe split them into a separate commit?

nit: I don’t think quoting is needed here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are reasonable on their own. Maybe split them into a separate commit?

nit: I don’t think quoting is needed here.

These are good suggestions. Just to save effort I will leave this as-is for now but would welcome a followup to make quoting more consistent. I am a little confused by quoting rules in cmake, and am not sure if for example maybe quotes would be added around generated_headers if generated filenames could contain spaces.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 81c6526, I have reviewed the code and it looks OK.

@ryanofsky ryanofsky merged commit 470fc51 into bitcoin-core:master Nov 6, 2025
8 checks passed
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 21, 2026
…8f7d

1fc65008f7d Merge bitcoin-core/libmultiprocess#237: Made SpawnProcess() behavior safe post fork()
5205a87cd90 test: check SpawnProcess post-fork safety
69652f0edfa Precompute argv before fork in SpawnProcess
30a8681de62 SpawnProcess: avoid fd leak on close failure
d0fc1081d09 Merge bitcoin-core/libmultiprocess#196: ci: Add NetBSD job
7b171f45bfc Merge bitcoin-core/libmultiprocess#234: doc: Fix typos and grammar in documentation and comments
861da39cae9 ci: Add NetBSD job
458745e3940 Fix various typos, spelling mistakes, and grammatical errors in design.md and source code comments.
585decc8561 Merge bitcoin-core/libmultiprocess#236: ci: Install binary package `capnproto` on OpenBSD instead of building it
14e926a3ff3 refactor: extract MakeArgv helper
1ee909393f4 ci: Install binary package `capnproto` on OpenBSD instead of building it
470fc518d4b Merge bitcoin-core/libmultiprocess#230: cmake: add ONLY_CAPNP target_capnp_sources option
2d8886f26c4 Merge bitcoin-core/libmultiprocess#228: Add versions.md and version.h files describing version branches and tags
c1838be565d Merge bitcoin-core/libmultiprocess#225: Improve and document act support
a173f1704ce Merge bitcoin-core/libmultiprocess#223: ci: Replace nix-shell with equivalent nix develop command
625eaca42fb Merge bitcoin-core/libmultiprocess#229: Design Documentation Update
cc234be73a6 Design doc update
81c652687b8 cmake: add ONLY_CAPNP target_capnp_sources option
6e01d2d766e Add versions.md and version.h files describing version branches and tags
4e3f8fa0d2c doc: add instructions for using act
81712ff6bbf ci: disable KVM and sandbox inside act containers
18a2237a8ef ci: Replace nix-shell with equivalent nix develop command

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1fc65008f7d64161e84c08cbd93109a23dd6a1e9
fanquake added a commit to bitcoin/bitcoin that referenced this pull request Jan 21, 2026
…misc.py timeout

7562e2a Squashed 'src/ipc/libmultiprocess/' changes from a4f92969649..1fc65008f7d (Ryan Ofsky)

Pull request description:

  Includes:

  - bitcoin-core/libmultiprocess#229
  - bitcoin-core/libmultiprocess#223
  - bitcoin-core/libmultiprocess#225
  - bitcoin-core/libmultiprocess#228
  - bitcoin-core/libmultiprocess#230
  - bitcoin-core/libmultiprocess#236
  - bitcoin-core/libmultiprocess#234
  - bitcoin-core/libmultiprocess#196
  - bitcoin-core/libmultiprocess#237

  The last change bitcoin-core/libmultiprocess#237 is expected to fix issue #34187 occasional `rpc_misc.py` test hang. The other changes are just documentation & ci updates.

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh)

ACKs for top commit:
  sedited:
    ACK 73d0fe6

Tree-SHA512: 82fb2973b8fb5e792dcff1adde0b158ac67cc6a9aeef4465e0bbdfbef88e41d44d9bad53b1d467be47bf594befa02bd8e7829c0a0bc67aaaeb4ca1e09b672a32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants