-
Notifications
You must be signed in to change notification settings - Fork 38.7k
cmake: Install man pages for configured targets only #31765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31765. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
cd28d5e to
5f66807
Compare
stickies-v
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach ACK 5f66807, thanks for addressing my issue!
Unfamiliar enough with CMake to determine if this is the best approach, but it's elegant and as per my testing it works well (except for my component comment).
|
|
||
|
|
||
| set(installable_targets) | ||
| macro(install_manpage target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add an optional component parameter. This would address the issue (see below) of installing just GUI, and also aligns well with potentially adding more components (e.g. one per target) in the future (out of scope for this PR).
git diff on 5f66807
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index eb816dbacc..ea026c25be 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -172,10 +172,11 @@ target_link_libraries(bitcoin_common
set(installable_targets)
-macro(install_manpage target)
+macro(install_manpage target component)
if(INSTALL_MAN)
install(FILES ${PROJECT_SOURCE_DIR}/doc/man/${target}.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+ COMPONENT ${component}
)
endif()
endmacro()
diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt
index 35bfd1ecf1..0e887841af 100644
--- a/src/qt/CMakeLists.txt
+++ b/src/qt/CMakeLists.txt
@@ -241,7 +241,7 @@ if(WIN32)
set_target_properties(bitcoin-qt PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
-install_manpage(bitcoin-qt)
+install_manpage(bitcoin-qt GUI)
if(WITH_MULTIPROCESS)
add_executable(bitcoin-gui
On 5f66807, when installing with --component GUI, the manpages are ignored:
% cmake --install build --component GUI
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/bin/bitcoin-qt
With my diff:
% cmake --install build --component GUI
-- Install configuration: "RelWithDebInfo"
-- Up-to-date: /usr/local/share/man/man1/bitcoin-qt.1
-- Up-to-date: /usr/local/bin/bitcoin-qt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Mind addressing this @hebasto?
Edit: actually, I guess we need to actually set components for the other bins first. I'll work on a PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need to actually set components for the other bins first.
I don't think we do? This patch picks up a component if defined, and otherwise just ignores it. So PR ordering shouldn't matter? edit: I can't reproduce this, so I think I did something wrong when testing.
At least that's what I got when testing on my machine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Reworked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: actually, I guess we need to actually set components for the other bins first. I'll work on a PR for that.
I can no longer reproduce the output I provided earlier, so I think I must have done something wrong while testing it. You're right, it seems the components must be specified with this patch, so @hebasto's new approach with ${ARGN} seems preferable. Sorry for the confusion!
BrandonOdiwuor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
Co-authored-by: stickies-v <stickies-v@protonmail.com>
5f66807 to
c783833
Compare
stickies-v
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK c783833
|
Considering that in order to hook up Instead, I think we're going to want an For ex: Instead of: list(APPEND installable_targets bitcoind)
...
install(TARGETS ${installable_targets}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)We'll want: add_install(
TARGETS bitcoind
COMPONENT bitcoind
HAS_MANPAGE
)Then |
See this branch for an alternative which adds |
|
Closing given the concept ACK in the other thread. |
9b033be cmake: rename Kernel component to bitcoinkernel for consistency (Cory Fields) 2e0c925 cmake: add and use install_binary_component (Cory Fields) 0264c5d cmake: use per-target components for bitcoin-qt and bitcoin-gui (Cory Fields) fb0546b ci: don't try to install for a fuzz build (Cory Fields) Pull request description: This makes it possible to build/install only the desired binaries regardless of the configuration. For consistency, the component names match the binary names. `Kernel` and `GUI` have been renamed. Additionally it fixes #31762 by installing only the manpages for the configured targets (and includes them in the component installs for each). Also fixes #31745. Alternative to #31765 which is (imo) more correct/thorough. Can be tested using (for ex): ```bash $ cmake -B build $ cmake --build build -t bitcoind -t bitcoin-cli $ cmake --install build --component bitcoind $ cmake --install build --component bitcoin-cli ``` ACKs for top commit: hebasto: ACK 9b033be. TheCharlatan: Re-ACK 9b033be stickies-v: re-ACK 9b033be Tree-SHA512: fd4818e76f190dbeafbf0c246b466f829771902c9d6d7111ed917093b811c8a5536a4a45e20708f73e7f581d6cb77c8e61cfa69e065788dcf0886792f553a355
Fixes #31762.