cmake: Remove NetBSD-specific workaround from `add_boost_if_needed`
What changed, and why it matters
This commit removes a build-system workaround that was only needed for NetBSD's package manager. The workaround adjusted where the compiler looks for Boost header files on NetBSD. It is being removed because the upstream NetBSD package has been fixed. There is no indication this change fixes a security vulnerability in Bitcoin Core itself.
No security action required. Treat as routine build-system maintenance. NetBSD builders should ensure they are using the fixed `pkgsrc-2026Q1` or later Boost package, otherwise builds may fail to locate Boost headers correctly.
Security signals we found
No security-relevant code change in Bitcoin Core runtime or consensus logic
Change is purely a build-system cleanup for a single platform (NetBSD)
Removed workaround references an external packaging bug, not a Bitcoin Core vulnerability
No mention of CVE, security fix, researcher credit, or advisory in commit or materials
Evidence from the diff
The change deletes a NetBSD-specific CMake workaround in cmake/module/AddBoostIfNeeded.cmake. The workaround rewrote Boost::headers INTERFACE_INCLUDE_DIRECTORIES when Boost was installed under /usr/pkg/ on NetBSD, compensating for a pkgsrc packaging bug referenced at https://gnats.netbsd.org/59856. The commit message states the patched pkgsrc package is now available in pkgsrc-2026Q1, so the workaround is no longer necessary. The remaining code sets IMPORTED_GLOBAL TRUE and adds compile definitions as before.
Changed components
cmake/module/AddBoostIfNeeded.cmakeInspect captured patch +0 / −11
diff --git a/cmake/module/AddBoostIfNeeded.cmake b/cmake/module/AddBoostIfNeeded.cmake
index 80a6d2e8..658e6d07 100644
--- a/cmake/module/AddBoostIfNeeded.cmake
+++ b/cmake/module/AddBoostIfNeeded.cmake
@@ -31,17 +31,6 @@ function(add_boost_if_needed)
find_package(Boost 1.74.0 REQUIRED CONFIG)
mark_as_advanced(Boost_INCLUDE_DIR boost_headers_DIR)
- # Workaround for a bug in NetBSD pkgsrc.
- # See https://gnats.netbsd.org/59856.
- if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
- get_filename_component(_boost_include_dir "${boost_headers_DIR}/../../../include/" ABSOLUTE)
- if(_boost_include_dir MATCHES "^/usr/pkg/")
- set_target_properties(Boost::headers PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES ${_boost_include_dir}
- )
- endif()
- unset(_boost_include_dir)
- endif()
set_target_properties(Boost::headers PROPERTIES IMPORTED_GLOBAL TRUE)
target_compile_definitions(Boost::headers INTERFACE
# We don't use multi_index serialization.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.