Version
3.5.2
Describe the problem you're encountering
Most of these can be considered minor issues, but
configure asks for rebar and rebar3. I know little about erlang, but it seems like rebar3 is a successor of rebar. If that's the case, it would make sense to fully transition to rebar3 if possible.
couchdb doesn't have much C code, but I've found errors in a notable portion of its build process. Languate interop can be difficult to get right. I would advise the following:
-
Drop all C code which isn't necessary for couchdb. If the C code can be replaced by erlang, do it.
I'd imagine that since couchdb doesn't have much C code, most of it is there for a purpose. But it's useful to reevaluate it just to be sure.
-
Check whether official erlang documentation, rebar or some third party source of documentation could be used for guidance on erlang to C/C++ interop. If for example rebar or some other erlang build tool provides a high-level facility for interop, consider switching to it.
I assume the C/C++ code is used for interop. If not, disregard this advice.
Version
3.5.2
Describe the problem you're encountering
Most of these can be considered minor issues, but
Several documentation sources mention a
pkg-configdependency. I am under a heavy suspicion that this is a false dependency and thatpkg-configis not used anywhere. If it is used anywhere, it is most certainly used wrong (otherwise cross compilation of couchdb would work).couchdb/configure
Lines 337 to 343 in 7839518
This is not how you check for dependencies. This doesn't work well with cross compilation and with systems that deal with includes in a "more creative way" like Nix. Since we have it, why don't we use
pkg-config?This of course requires further testing. couchdb seems to support a lot of systems, some of them might not have pkg-config working. More than one dependency detection mechanism might be needed, but
pkg-configshould be the first method tried.Do not hardcode
-j<N>in a Makefile You do not know how many cores does the build machine have. It it must be done, at least use-j$(nproc)(which also doesn't belong in a Makefile).CFLAGSoverriding is done wrong.As I've mentioned in [Bug]: quickjs cross compilation issues #6107, this is issue is often seen in hand-written Makefiles. Please see the following chapter of the GNU Make manual on how
CFLAGSoverriding should be done: https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make_125.html#SEC129 It is a minor issue though.rebar doesn't echo the build command when builing C/C++
This leads to cleaner output, but it is worse to debug when the compilation fails. There's a reason why Make echos the build commands.
configureasks forrebarandrebar3. I know little about erlang, but it seems likerebar3is a successor ofrebar. If that's the case, it would make sense to fully transition torebar3if possible.couchdb doesn't have much C code, but I've found errors in a notable portion of its build process. Languate interop can be difficult to get right. I would advise the following:
Drop all C code which isn't necessary for couchdb. If the C code can be replaced by erlang, do it.
I'd imagine that since couchdb doesn't have much C code, most of it is there for a purpose. But it's useful to reevaluate it just to be sure.
Check whether official erlang documentation, rebar or some third party source of documentation could be used for guidance on erlang to C/C++ interop. If for example rebar or some other erlang build tool provides a high-level facility for interop, consider switching to it.
I assume the C/C++ code is used for interop. If not, disregard this advice.