-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
build: bdb detection and configuration fixes for macOs/brew #3308
Conversation
Fixes the detection of bdb on brew enabled systems by using dogecoin_find_bdb53.m4 parametrization and checking if the brew-located files actually work. Searches brew installed packages in the order: 5.x, 4.x, default. The reason for this order is that 4.x is still fully readable by 5.3.27NC that is distributed by default, and therefore prefered over newer-than 5.x versions.
dca56de
to
b09aa70
Compare
ACK, all tests pass on 64-bit x86-Linux and the code changes make sense to me. I think we should have another test on Mac though. @michilumin can you take this for a spin too? |
Yup will do. About a day until I get back to my Mac but yes. |
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.
Review OK, testing in-situ.
Using brew berkeley-db@5 (vs berkeley-db), configures OK, builds OK, passes all unit tests (Core 2/2, libsec 2/2, univalue 3/3), on x86 Mac OS 13/Ventura build 13.6 (Intel, virgin install to ext SSD.) |
wrong button. |
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.
Visually reviewed and tested, looks OK to merge.
With Michi's approval, we're well past the 24 hour merge window so here we go! |
Currently, brew logic in
configure.ac
always adds the defaultberkeley-db
path when compiling on macOs. This causes link-time and/or run-time issues when the default version (18.x) is installed on the compiling system, and prevents proper linking when using thecontrib/install_bdb.sh
script. This has been blocking #2686.This PR fixes that issue by:
dogecoin_find_bdb53.m4
to also check manually specifiedBDB_CFLAGS
andBDB_LIBS
. This prevents link-time and run-time errors by catching the error during configuration.BITCOIN_FIND_BDB53
m4 macro when using brew for bdb detection instead of appending values to the genericCPPFLAGS
andLIBS
, because these are used generically for every binary and can cause issues with libtool archive scope.BDB_CFLAGS
orBDB_LIBS
is manually given. This is to allow maximum flexibility for custom compiles, while retaining automatic configuration.berkeley-db
package, in the order@5
,@4
and only then the default version. The reason for this detection order is that 4.x is still fully readable by 5.3.27NC that is distributed by default, and therefore preferred over newer-than 5.x versions.I've tested this to work on x86_64-linux, arm64-darwin and x86_64-darwin
After applying this patch on top of #3301, configuration on macOs only requires manual specification of boost, i.e.:
./autogen.sh ./configure --with-boost=`brew --prefix boost`
Note: this PR is best tested on top of #3301, so it's probably best to rebase this after that, or an alternative fix, gets merged.