dash/depends/packages
fanquake 66a3981a7a
Merge bitcoin/bitcoin#24279: build: Make $(package)_*_env available to all $(package)_*_cmds
affbf58a1e52a8e60c830be6a9e0347e0ff4c28e build: Move environment variables into `$(package)_config_env` (Hennadii Stepanov)
d44fcd3c976572883bbf7f386bc88e2610dc1a58 build: Make $(package)_*_env available to all $(package)_*_cmds (Hennadii Stepanov)

Pull request description:

  On master (1e7564eca8a688f39c75540877ec3bdfdde766b1) the depends build system, which is based on pure GNU Make, works, but it lacks robustness, and in some corner cases it fails. For example, see bitcoin/bitcoin#22552.

  Another [bug](https://github.com/bitcoin/bitcoin/issues/22719) in the depends build system has already become a problem at least two times in the past (https://github.com/bitcoin/bitcoin/pull/16883#issuecomment-683817472 and https://github.com/bitcoin/bitcoin/pull/24134). Each time the problem was solved with other means.

  The initial [solution](https://github.com/bitcoin/bitcoin/pull/19882) had some discussion. Also it was discussed on the IRC meeting in #bitcoin-core-builds channel. This PR, actually, is a resurrection of it, as the bug silently struck pretty [recently](https://github.com/bitcoin/bitcoin/pull/24134).

  The bug is well described in bitcoin/bitcoin#22719.

  Here is another, a bit simpler description, which requires only basic shell (bash, dash etc) experience.
  After creating targets by this code:1e7564eca8/depends/funcs.mk (L280) a "draft" line of recipe like `$($(1)_config_env) $(call $(1)_config_cmds, $(1))` becomes a shell command sequence `VAR1=foo VAR2=bar command1 && command2` which is supposed to be executed in a [new sub-shell](https://www.gnu.org/software/make/manual/html_node/Execution.html#Execution).

  Please note that `VAR1=foo VAR2=bar` part is visible for the first `command1` only (for details see shell docs). Example:
  ```sh
  $ VAR1="foo" VAR2="bar" echo "begin" && printenv VAR1 && printenv VAR2 && echo "end"
  begin
  $ echo $?
  1
  ```

  Using the `export` command is a trivial solution:
  ```sh
  $ export VAR1="foo" VAR2="bar"; echo "begin" && printenv VAR1 && printenv VAR2 && echo "end"
  begin
  foo
  bar
  end
  $ echo $?
  0
  ```

  As a [new sub-shell](https://www.gnu.org/software/make/manual/html_node/Execution.html#Execution) is invoked for each line of the recipe, there are no side effects of using `export`. It means this solution should not be considered invasive.

  Fixes bitcoin/bitcoin#22719.

  ---

  Also this PR removes no longer needed crutch from `qt.mk`.

ACKs for top commit:
  fanquake:
    ACK affbf58a1e52a8e60c830be6a9e0347e0ff4c28e

Tree-SHA512: 0ce2cf82870a7774bdf1592fac50857126ae47da902e349f1092d50109223be9d6a8efd5e92ec08c2ca775b17516482aabaf232378950ade36484a883acc177b
2024-10-25 09:08:27 -05:00
..
backtrace.mk fix: bump version of libbacktrace library 2024-05-29 12:26:11 +07:00
bdb.mk Merge bitcoin/bitcoin#29488: depends: always configure with --with-pic 2024-09-26 22:38:53 -05:00
boost.mk merge bitcoin#30217: Update Boost download link 2024-08-13 22:53:52 +07:00
capnp.mk Merge bitcoin/bitcoin#29706: depends: set two CMake options globally 2024-10-04 12:54:24 -05:00
expat.mk Merge bitcoin/bitcoin#29488: depends: always configure with --with-pic 2024-09-26 22:38:53 -05:00
fontconfig.mk
freetype.mk Merge bitcoin/bitcoin#29488: depends: always configure with --with-pic 2024-09-26 22:38:53 -05:00
gmp.mk build: set -march irrespective of target operating system 2024-10-08 14:52:16 +00:00
libevent.mk Merge bitcoin/bitcoin#30743: depends: build libevent with -D_GNU_SOURCE 2024-10-01 22:54:14 -05:00
libmultiprocess.mk Merge bitcoin/bitcoin#29706: depends: set two CMake options globally 2024-10-04 12:54:24 -05:00
libnatpmp.mk
libXau.mk Merge bitcoin/bitcoin#29488: depends: always configure with --with-pic 2024-09-26 22:38:53 -05:00
libxcb_util_image.mk merge bitcoin#23489: Qt 5.15.2 2023-08-08 06:05:02 -05:00
libxcb_util_keysyms.mk merge bitcoin#23489: Qt 5.15.2 2023-08-08 06:05:02 -05:00
libxcb_util_render.mk merge bitcoin#23489: Qt 5.15.2 2023-08-08 06:05:02 -05:00
libxcb_util_wm.mk merge bitcoin#23489: Qt 5.15.2 2023-08-08 06:05:02 -05:00
libxcb_util.mk Merge bitcoin/bitcoin#29488: depends: always configure with --with-pic 2024-09-26 22:38:53 -05:00
libxcb.mk Merge bitcoin/bitcoin#25738: depends: use a patch instead of sed in libxcb 2024-06-08 20:59:36 -05:00
libxkbcommon.mk
miniupnpc.mk
native_capnp.mk Merge bitcoin/bitcoin#28856: depends: Build the native_capnp and capnp packages with CMake 2024-10-04 12:54:23 -05:00
native_cctools.mk merge bitcoin#25633: don't restrict --enable-lto to non-guix cctools 2023-06-29 12:31:03 -05:00
native_clang.mk merge bitcoin#25633: don't restrict --enable-lto to non-guix cctools 2023-06-29 12:31:03 -05:00
native_ds_store.mk Merge bitcoin/bitcoin#25605: depends: update urls for dmg tools 2024-02-28 13:16:40 -06:00
native_libdmg-hfsplus.mk Merge #19685: depends: CMake invocation cleanup 2024-01-16 09:34:27 -06:00
native_libmultiprocess.mk Merge bitcoin/bitcoin#30513: depends: Bump libmultiprocess for CMake fixes 2024-10-03 01:16:41 -05:00
native_libtapi.mk merge bitcoin#25633: don't restrict --enable-lto to non-guix cctools 2023-06-29 12:31:03 -05:00
native_mac_alias.mk Merge bitcoin/bitcoin#25605: depends: update urls for dmg tools 2024-02-28 13:16:40 -06:00
packages.mk merge bitcoin#23724: add systemtap's sys/sdt.h as depends for GUIX builds with USDT tracepoints 2024-09-04 18:46:13 +00:00
qrencode.mk Merge bitcoin/bitcoin#29725: depends: build libqrencode with CMake 2024-09-29 10:54:41 +03:00
qt.mk Merge bitcoin/bitcoin#24279: build: Make $(package)_*_env available to all $(package)_*_cmds 2024-10-25 09:08:27 -05:00
sqlite.mk Merge bitcoin/bitcoin#29488: depends: always configure with --with-pic 2024-09-26 22:38:53 -05:00
systemtap.mk merge bitcoin#26945: systemtap 4.8 2024-09-04 18:46:14 +00:00
xcb_proto.mk Merge bitcoin/bitcoin#28097: depends: xcb-proto 1.15.2 2024-05-07 12:34:22 -05:00
xproto.mk merge bitcoin#23489: Qt 5.15.2 2023-08-08 06:05:02 -05:00
zeromq.mk fix mingw32 build 2024-09-28 10:48:43 +03:00