Fix debian “libatomic not found” error in downstream builds #133

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/atoms changing 1 files +3 −0
  1. ryanofsky commented at 9:27 pm on January 23, 2025: collaborator

    This is an extension of the workaround implemented previously in #119. That workaround let the libmultiprocess cmake build work with the debian capnproto package.

    This change extends the workaround to apply to downstream cmake builds that call find_package(Libmultiprocess), like Bitcoin Core.

    Fixes #132

  2. Fix debian "libatomic not found" error in downstream builds
    This is an extension of the workaround implemented previously in #119. That
    workaround let the libmultiprocess cmake build work with the debian capnproto
    package.
    
    This change extends the workaround to apply to downstream cmake builds that
    call find_package(Libmultiprocess), like Bitcoin Core.
    
    Fixes #132
    67afc23069
  3. in cmake/Config.cmake.in:22 in 67afc23069
    16@@ -17,6 +17,9 @@ if ("Bin" IN_LIST ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
    17 endif()
    18 
    19 if ("Lib" IN_LIST ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
    20+  # Setting FOUND_LIBATOMIC is needed on debian & ubuntu systems to work around bug in
    21+  # their capnproto packages. See compat_find.cmake for a more complete explanation.
    22+  set(FOUND_LIBATOMIC TRUE)
    


    hebasto commented at 8:16 am on January 24, 2025:

    As a local fixup, this variable shouldn’t pollute the global namespace.

    Maybe unset(FOUND_LIBATOMIC) after find_dependency(CapnProto)?


    ryanofsky commented at 2:30 pm on January 24, 2025:

    re: https://github.com/chaincodelabs/libmultiprocess/pull/133#discussion_r1928300799

    As a local fixup, this variable shouldn’t pollute the global namespace.

    Maybe unset(FOUND_LIBATOMIC) after find_dependency(CapnProto)?

    You would know more than me, but it seems like that change could make things worse. If we just unset the variable, wouldn’t that just be overwriting it as unset instead of true and polluting the namespace in a different way?

    I think you are right that there may be a less invasive way to work around the debian bug though. Maybe checking to see if the variable is set before setting it, and restoring the previous value after finding capnproto. I would have to refresh my memory of cmake variable scopes before doing this though, and I would want he other code in compat_find.cmake from #119 to be consistent so both workarounds are identical.

    Could be a good followup but I think current change is probably the most direct fix for the current issue.

  4. hebasto approved
  5. hebasto commented at 8:16 am on January 24, 2025: member
    ACK 67afc23069cc42370c0bcbd98ea4ac37b0d39410, tested on Ubuntu 24.04.
  6. ryanofsky merged this on Jan 27, 2025
  7. ryanofsky closed this on Jan 27, 2025

  8. Sjors referenced this in commit 71be9377ee on Jan 27, 2025
  9. ryanofsky referenced this in commit 90b116bd70 on Jan 27, 2025
  10. ryanofsky referenced this in commit 2221c8814d on Jan 27, 2025
  11. Sjors referenced this in commit b66fe2fc03 on Jan 28, 2025
  12. fanquake referenced this in commit ad2f9324c6 on Jan 29, 2025
  13. janus referenced this in commit 311822f35f on Sep 1, 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-11-07 20:30 UTC

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