Skip to content

Commit 5e29356

Browse files
committed
Merge #2972: [Depends] Cleanup package configs
c8a7896 CI: Bump depends cache version (Fuzzbawls) 98c6066 depends: prune dbus from depends (fanquake) 1ed639e build: pass --enable-option-checking to applicable packages (fanquake) 0ff86a1 depends: don't configure xcb_proto (fanquake) 2059c26 build: don't always use --disable-dependency-tracking (Fuzzbawls) 9185414 depends: zeromq: disable draft classes and methods (fanquake) 6aecebb depends: xproto: configure flags cleanup (fanquake) e468f21 depends: qrencode: configure flags cleanup (fanquake) 2ca24cc depends: fontconfig: configure flags cleanup (fanquake) 6ca19a5 depends: libxcb: configure flags cleanup (fanquake) 22984ab depends: libXau: configure flags cleanup (fanquake) fb4fec1 build: disable libxcb extensions (fanquake) 678f261 depends: Purge libtool archives (Fuzzbawls) f4db397 depends: build secondary deps statically (Fuzzbawls) Pull request description: A collection of smaller upstream PRs aimed at cleaning up the depends package configurations. Included is: - bitcoin#15844 - bitcoin#16352 - bitcoin#16370 - bitcoin#16533 - bitcoin#16949 - bitcoin#17698 Package version updates are intentionally not included here, and will be done in separate PRs. ACKs for top commit: c8a7896 Duddino: ACK c8a7896 Liquid369: tACK c8a7896 Tree-SHA512: 2e415003ed06333793ecb3bd58ac3c12a8f8b6d1dfe7914c8e59b4c30c8fb58e4e9e28f3d2eba1491a46a611b2ba985273af9b46fc03015e51fcf37094f261ba
2 parents 4e0fd96 + c8a7896 commit 5e29356

File tree

19 files changed

+114
-51
lines changed

19 files changed

+114
-51
lines changed

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@ jobs:
574574
depends/built
575575
depends/sdk-sources
576576
depends/${{ matrix.config.host }}
577-
key: ${{ runner.os }}-depends-${{ matrix.config.host }}
578-
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}
577+
key: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2
578+
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2
579579

580580
- name: Build Depends
581581
run: |
@@ -619,6 +619,7 @@ jobs:
619619
CCACHE_COMPRESS: 1
620620
WINEDEBUG: fixme-all
621621
BOOST_TEST_RANDOM: 1 # random seed based on the current time
622+
SDK_URL: https://bitcoincore.org/depends-sources/sdks
622623
defaults:
623624
run:
624625
shell: bash
@@ -704,8 +705,8 @@ jobs:
704705
depends/built
705706
depends/sdk-sources
706707
depends/${{ matrix.config.host }}
707-
key: ${{ runner.os }}-depends-${{ matrix.config.host }}
708-
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}
708+
key: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2
709+
restore-keys: ${{ runner.os }}-depends-${{ matrix.config.host }}-v2
709710

710711
- name: ccache cache files
711712
uses: actions/cache@v4

depends/funcs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
138138
$(1)_config_env+=PATH="$(build_prefix)/bin:$(PATH)"
139139
$(1)_build_env+=PATH="$(build_prefix)/bin:$(PATH)"
140140
$(1)_stage_env+=PATH="$(build_prefix)/bin:$(PATH)"
141-
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
141+
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
142142

143143
ifneq ($($(1)_nm),)
144144
$(1)_autoconf += NM="$$($(1)_nm)"

depends/packages.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The package "mylib" will be used here as an example
55

66
General tips:
77
- mylib_foo is written as $(package)_foo in order to make recipes more similar.
8+
- Secondary dependency packages relative to the PIVX binaries/libraries (i.e.
9+
those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) don't
10+
need to be shared and should be built statically whenever possible. See
11+
[below](#secondary-dependencies) for more details.
812

913
## Identifiers
1014
Each package is required to define at least these variables:
@@ -146,3 +150,34 @@ $($(package)_config_opts) will be appended.
146150
Most autotools projects can be properly staged using:
147151

148152
$(MAKE) DESTDIR=$($(package)_staging_dir) install
153+
154+
## Build outputs:
155+
156+
In general, the output of a depends package should not contain any libtool
157+
archives. Instead, the package should output `.pc` (`pkg-config`) files where
158+
possible.
159+
160+
From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives):
161+
162+
> Libtool pulls in all direct and indirect dependencies into the .la files it
163+
> creates. This leads to massive overlinking, which is toxic to the Gentoo
164+
> ecosystem, as it leads to a massive number of unnecessary rebuilds.
165+
166+
## Secondary dependencies:
167+
168+
Secondary dependency packages relative to the PIVX binaries/libraries (i.e.
169+
those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) don't
170+
need to be shared and should be built statically whenever possible. This
171+
improves general build reliability as illustrated by the following example:
172+
173+
When linking an executable against a shared library `libprimary` that has its
174+
own shared dependency `libsecondary`, we may need to specify the path to
175+
`libsecondary` on the link command using the `-rpath/-rpath-link` options, it is
176+
not sufficient to just say `libprimary`.
177+
178+
For us, it's much easier to just link a static `libsecondary` into a shared
179+
`libprimary`. Especially because in our case, we are linking against a dummy
180+
`libprimary` anyway that we'll throw away. We don't care if the end-user has a
181+
static or dynamic `libseconday`, that's not our concern. With a static
182+
`libseconday`, when we need to link `libprimary` into our executable, there's no
183+
dependency chain to worry about as `libprimary` has all the symbols.

depends/packages/bdb.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b857327
66
$(package)_build_subdir=build_unix
77

88
define $(package)_set_vars
9-
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
9+
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking
1010
$(package)_config_opts_mingw32=--enable-mingw
1111
$(package)_config_opts_linux=--with-pic
1212
$(package)_config_opts_aarch64=--disable-atomicsupport

depends/packages/dbus.mk

Lines changed: 0 additions & 23 deletions
This file was deleted.

depends/packages/expat.mk

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package=expat
2-
$(package)_version=2.2.6
3-
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
2+
$(package)_version=2.2.7
3+
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_7/
44
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
5-
$(package)_sha256_hash=17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2
5+
$(package)_sha256_hash=cbc9102f4a31a8dafd42d642e9a3aa31e79a0aedaa1f6efd2795ebc83174ec18
66

77
define $(package)_set_vars
8-
$(package)_config_opts=--disable-static --without-docbook
8+
$(package)_config_opts=--disable-shared --without-docbook
9+
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
10+
$(package)_config_opts_linux=--with-pic
911
endef
1012

1113
define $(package)_config_cmds
@@ -19,3 +21,7 @@ endef
1921
define $(package)_stage_cmds
2022
$(MAKE) DESTDIR=$($(package)_staging_dir) install
2123
endef
24+
25+
define $(package)_postprocess_cmds
26+
rm lib/*.la
27+
endef

depends/packages/fontconfig.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ $(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f
66
$(package)_dependencies=freetype expat
77

88
define $(package)_set_vars
9-
$(package)_config_opts=--disable-docs --disable-static
9+
$(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv
10+
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
1011
endef
1112

1213
define $(package)_config_cmds
@@ -26,3 +27,7 @@ endef
2627
define $(package)_stage_cmds
2728
$(MAKE) DESTDIR=$($(package)_staging_dir) install
2829
endef
30+
31+
define $(package)_postprocess_cmds
32+
rm lib/*.la
33+
endef

depends/packages/freetype.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4
66

77
define $(package)_set_vars
88
$(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static
9+
$(package)_config_opts += --enable-option-checking
910
$(package)_config_opts_linux=--with-pic
1011
endef
1112

@@ -20,3 +21,7 @@ endef
2021
define $(package)_stage_cmds
2122
$(MAKE) DESTDIR=$($(package)_staging_dir) install
2223
endef
24+
25+
define $(package)_postprocess_cmds
26+
rm lib/*.la
27+
endef

depends/packages/gmp.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.xz
55
$(package)_sha256_hash=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
66

77
define $(package)_set_vars
8-
$(package)_config_opts+=--enable-cxx --enable-fat --with-pic --disable-shared
8+
$(package)_config_opts+=--enable-cxx --enable-fat --with-pic --disable-shared --enable-option-checking
99
$(package)_config_opts_mingw32+=--enable-mingw
1010
endef
1111

@@ -21,3 +21,7 @@ define $(package)_stage_cmds
2121
$(MAKE) DESTDIR=$($(package)_staging_dir) install
2222
endef
2323

24+
define $(package)_postprocess_cmds
25+
rm lib/*.la
26+
endef
27+

depends/packages/libXau.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
55
$(package)_sha256_hash=fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2
66
$(package)_dependencies=xproto
77

8+
# When updating this package, check the default value of
9+
# --disable-xthreads. It is currently enabled.
810
define $(package)_set_vars
9-
$(package)_config_opts=--disable-shared
11+
$(package)_config_opts=--disable-shared --disable-lint-library --without-lint
12+
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
1013
$(package)_config_opts_linux=--with-pic
1114
endef
1215

@@ -25,3 +28,7 @@ endef
2528
define $(package)_stage_cmds
2629
$(MAKE) DESTDIR=$($(package)_staging_dir) install
2730
endef
31+
32+
define $(package)_postprocess_cmds
33+
rm lib/*.la
34+
endef

0 commit comments

Comments
 (0)