Add install-lib and install-bin build targets #74

pull hebasto wants to merge 3 commits into bitcoin-core:master from hebasto:220908-separate changing 1 files +20 −5
  1. hebasto commented at 11:33 pm on September 7, 2022: member

    This PR adds new install-lib and install-bin build targets which allow to build and install only required artifacts during different stages of cross-building.

    A demo, which uses this branch in Bitcoin Core, is here.

  2. Install `proxy.capnp` with `mpgen` target
    This changes is required for the following two commits.
    bc3d166d37
  3. hebasto commented at 11:34 pm on September 7, 2022: member
    Drafted until Concept (N)ACK.
  4. ryanofsky commented at 2:46 pm on September 8, 2022: collaborator

    Few thoughts:

    • PR title “Make build system cross-building-friendly” is vague and seems to imply that current build system does not support cross-building, which is untrue. Would suggest “Add codegen-only and library-only CMake build options”

    • I think it would be better to add new build targets, not new build options. Ideally in addition to current make install target there would be new make install-lib and make install-bin targets that automatically build and install the minimal dependencies. Current approach confuses the role of CMake and Make. Cmake is great at determining how things should be built but Make does a much better job of determining what to build. If you go down the road of using CMake to decide what to build, it is a big mistake because instead of specifying dependencies explicitly you specify them implicitly in nest of IF() statements that don’t scale well and can become unmaintainable: wastefully building more dependencies than the user actually requires, or failing to rebuild needed dependencies when different combination of options are used. It is much better to let Make figure out what to build automatically, than to try to do it manually in CMake with IF() statements.

      Instead of changing the build rules, I think it would would be better to take advantage of cmake install components and add_custom_target as described https://stackoverflow.com/questions/9190098/for-cmakes-install-command-what-can-the-component-argument-do

  5. hebasto renamed this:
    Make build system cross-building-friendly
    Add codegen-only and library-only CMake build options
    on Sep 9, 2022
  6. Add `install-lib` target
    When cross building, using `make install-lib` allows to avoid unneeded
    building of `mpgen` for a target system.
    c4d26d2ddb
  7. Add `install-bin` target
    When cross building, using `make install-bin` allows to avoid unneeded
    building of `libmultiprocess` for a build system.
    fa130db398
  8. hebasto force-pushed on Sep 9, 2022
  9. hebasto commented at 8:30 am on September 9, 2022: member

    Updated cd9389f1b5074ecfd55218d530ae91cb6f2f228c -> fa130db398ef12752e976468eb12ad36dfd49b99 (pr74.01 -> pr74.02, diff). @ryanofsky

    Thank you for your suggestions!

    Ideally in addition to current make install target there would be new make install-lib and make install-bin targets that automatically build and install the minimal dependencies.

    Implemented. The PR description has been updated.

    The only downside of the current implementation is that new install-lib and install-bin targets do not export the underlying targets.

  10. hebasto renamed this:
    Add codegen-only and library-only CMake build options
    Add `install-lib` and `install-bin` build targets
    on Sep 9, 2022
  11. hebasto marked this as ready for review on Sep 9, 2022
  12. ryanofsky approved
  13. ryanofsky commented at 4:54 pm on September 13, 2022: collaborator

    Code review ACK fa130db398ef12752e976468eb12ad36dfd49b99. This does exactly what I’d expect now, so will merge it. But you do bring up an important point about no longer exporting cmake targets.

    The only downside of the current implementation is that new install-lib and install-bin targets do not export the underlying targets.

    Can confirm neither of the new install commands create $PREFIX/cmake/Multiprocess/Multiprocess.cmake and $PREFIX/lib/cmake/Multiprocess/Multiprocess-debug.cmake files.

    Probably should update install() EXPORT Multiprocess arguments to EXPORT libmultiprocess-bin and EXPORT libmultiprocess-lib so the two installs can be independent. And maybe there is a way to get the new install-bin and install-lib commands to actually export these targets.

    But I am now thinking maybe a better long-term solution is to split up the cmake project into two projects. It could also clarify the source organization to split the parts of the code that are needed for code generation from the parts that are used at runtime.

  14. ryanofsky merged this on Sep 13, 2022
  15. ryanofsky closed this on Sep 13, 2022

  16. hebasto deleted the branch on Sep 14, 2022
  17. fanquake referenced this in commit e1fb7381be on Dec 10, 2022
  18. sidhujag referenced this in commit e603e70e7a on Dec 10, 2022
  19. ryanofsky referenced this in commit 917877afa8 on Feb 14, 2023
  20. PastaPastaPasta referenced this in commit 571fd37f65 on Sep 27, 2024
  21. PastaPastaPasta referenced this in commit 04d0d6796a on Sep 27, 2024
  22. PastaPastaPasta referenced this in commit 10acc2a423 on Sep 27, 2024
  23. PastaPastaPasta referenced this in commit a2cc616f4a on Sep 28, 2024
  24. PastaPastaPasta referenced this in commit ad0c279ac8 on Oct 1, 2024
  25. bitcoin-core locked this on Jun 25, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-04 19:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me