Secondary dependencies don't need to be shared. Comes at theuni's request.
To do: add documentation so future secondary dependencies aren't shared. DONE
Let's merge this first as #15844 is based on this PR.
Concept ACK
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Concept ACK
4 | @@ -5,6 +5,9 @@ The package "mylib" will be used here as an example 5 | 6 | General tips: 7 | - mylib_foo is written as $(package)_foo in order to make recipes more similar. 8 | +- Secondary dependency packages relative to the bitcoin binaries/libraries (i.e.
What is the rationale for this? Does this improve build times, or compatibility of some kind?
It improves general build reliability.
For example, when linking an executable against a shared library libprimary that has its own shared dependency libsecondary, we may need to specify the path to libsecondary on the link command using the -rpath/-rpath-link options, it is not sufficient to just say libprimary.
For us, it's much easier to just link a static libsecondary into a shared libprimary. Especially because in our case, we are linking against a dummy libprimary anyway that we'll throw away. We don't care if the end-user has a static or dynamic libseconday, that's not our concern. With a static libseconday, when we need to link libprimary into our executable, there's no dependency chain to worry about, libprimary has all the symbols.
Perhaps @theuni can add more.
This might be helpful to add as a comment.
Added more detailed justifications to depends/packages.md.
Rebooted all the tests.
163 | +not sufficient to just say `libprimary`. 164 | + 165 | +For us, it's much easier to just link a static `libsecondary` into a shared 166 | +`libprimary`. Especially because in our case, we are linking against a dummy 167 | +`libprimary` anyway that we'll throw away. We don't care if the end-user has a 168 | +static or dynamic `libseconday`, that's not our concern. With a static
nit: s/libseconday/libsecondary here and below
Done! Sorry I missed this.
utACK 27226e6
utACK 27226e64625e3e35edba8f1c55954340362d23b2
utACK 27226e64625e3e35edba8f1c55954340362d23b2
Secondary dependencies don't need to be shared.
Concept ACK, thanks for picking this up!
Reviewing.
diffoscope x86_64-pc-linux-gnu/lib x86_64-pc-linux-gnu-3560d8c/lib
libX11-xcb.so.1.0.0
libX11.la
libX11.so
libX11.so.6
libX11.so.6.3.0
libXau.a
libXau.la
+libXext.a
libXext.la
-libXext.so
-libXext.so.6
-libXext.so.6.4.0
libboost_chrono-mt.a
libboost_filesystem-mt.a
libboost_prg_exec_monitor-mt.a
libboost_system-mt.a
libboost_test_exec_monitor-mt.a
libboost_thread-mt.a
libboost_timer-mt.a
libboost_unit_test_framework-mt.a
libcrypto.a
libdb-4.8.a
libdb.a
libdb_cxx-4.8.a
libdb_cxx.a
+libdbus-1.a
libdbus-1.la
-libdbus-1.so
-libdbus-1.so.3
-libdbus-1.so.3.14.11
libevent.a
libevent.la
libevent_core.a
libevent_core.la
libevent_extra.a
libevent_extra.la
libevent_pthreads.a
libevent_pthreads.la
+libexpat.a
libexpat.la
-libexpat.so
-libexpat.so.1
-libexpat.so.1.6.8
libfontconfig.la
libfontconfig.so
libfontconfig.so.1
libfontconfig.so.1.9.2
libfreetype.la
libfreetype.so
libfreetype.so.6
A few things about this make me nervous, so I'm going to look in more depth.
In this PR we identify 4 secondary deps that should be built statically:
However, only expat required being built --with-pic for depends builds to succeed, which is rather odd. Therefore, the rest of the deps must not be linked in, or are headers-only.
Results of my investigation (please verify these as I might be completely wrong):
The only package that we declare as depending on libXext is qt, and it doesn't actually... Tested by removing the package definition and references to it, everything seems to compile fine.
It seems that xtrans is just code+headers and not a library that needs to be linked in. We can verify this by looking at the build outputs.
Its configure is very confused as to why we supply it with --disable-{static,shared}. It is, however, required as a build-time dependency for libX11.
The only reference to dbus is in the configure options for qt: -dbus-runtime. Which indicates to qt to dynamically open libdbus-1 at runtime (with dlopen?). I believe this means that we don't actually use the dbus we build. (This one I'm the least sure about)
@theuni
<!--cf906140f33d8803c4a75a2196329ecb-->Needs rebase