Skip to content
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: Improve depends build system robustness #22552

Closed
wants to merge 2 commits into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jul 26, 2021

The depends build system looks fragile in its current state. For example, on master (346e780):

$ make --no-print-directory -C depends print-qt_suffix
qt_suffix=everywhere-opensource-src-4.3.4.tar.xz

With this PR:

$ make --no-print-directory -C depends print-qt_suffix
qt_suffix=everywhere-opensource-src-5.15.3.tar.xz

Required for #22555.

@hebasto
Copy link
Member Author

hebasto commented Jul 26, 2021

cc @dongcarl @fanquake @theuni

@maflcko
Copy link
Member

maflcko commented Jul 26, 2021

For the scripted-diff please use git ls-files ... or similar. Otherwise it will change out-of-tree files as well.

@hebasto
Copy link
Member Author

hebasto commented Jul 26, 2021

Updated fdaeb52 -> b48fd7b (pr22552.01 -> pr22552.02, diff):

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 26, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25697 (depends: expat 2.4.8 & fix building with -flto by fanquake)
  • #25696 (build: Re-enable external signer on Windows by hebasto)
  • #25633 (depends: don't restrict --enable-lto to non-guix cctools by fanquake)
  • #25391 (guix: Use LTO to build releases by fanquake)
  • #24283 (build: Add show-% target for multi-line variables and debug info by hebasto)
  • #24123 ([POC] build: enable Pointer Authentication and Branch Target Identification for aarch64 (Linux) by fanquake)
  • #21778 (build: LLVM 14 & LLD based macOS toolchain by fanquake)

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.

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

I agree with the vision this PR is trying to set. I wanted to try to document what this seems to be doing and aims to accomplish.

What this PR is doing:
We can notice some "fragility" in our build system when looking at the recent Android related issues and their patches. The OP shows a good example; somehow, the boost version ended up there. Another example is the patch set of #22555; it seems as though the wrong value is evaluated with specific variables.

Why might this be happening? This PR hits the nail on the head by attacking the use of recursive variables. Recursive variables make it quite hard to track where the value is coming from (to a build noob like me). The main change this PR is performing is refactoring from recursively expanded variables to simple expanded ones. This irons out any kinks that currently exist and seems to work for the Android build issues as reported here: #22555 (comment)

Per the make manual

"To avoid all the problems and inconveniences of recursively expanded variables, there is another flavor: simply expanded variables."

Should we do this?
Warning: The following opinions are from a build noob

We do not need to refactor to simply expanded variables. We could spend time figuring out what about our current setup and the use of recursive variables is contributing to the example in the OP and partially leading to other examples like #22522.

Nevertheless, we should move to simply expanded variables. The clear benefit is, again, stated in the make manual:

"Simply expanded variables generally make complicated makefile programming more predictable because they work like variables in most programming languages."

Performing this refactor makes future changes more accessible because we can easily track where values come from. Also, and while not a directly supporting reason for this change, it can lower the entry and learning curve barrier to contributing to our build system.

Also, simply expanded variables are newer. Newer = Better ☺️

Notes on commits:

  • dc54e4a
    • simlar to explanation for 2ee0cf3
  • c705d1b
    • This is mainly a cosmetic change. Not required
  • 2ee0cf3
    • If we are going to refactor to simple variables, this is needed to keep the proper order of evaluation. X.mk depends on native_X.mk.
  • 096d24f
    • This is a cosmetic change
  • 4e70c20 & 6381331
    • performs migration from recursive to simple variables

@jarolrod
Copy link
Member

Guix Hashes, mine match @hebasto:

find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum

4ea194b0f639a35c111de60d646ec7adcde82a5ab0c2b4d82637046909c9967c  guix-build-638133188fa2/output/aarch64-linux-gnu/SHA256SUMS.part
38178d82ffb02f3b776a570bddc4331078b27a22a5a6f6f21eeec95fee556290  guix-build-638133188fa2/output/aarch64-linux-gnu/bitcoin-638133188fa2-aarch64-linux-gnu-debug.tar.gz
085c15770e12d60ba143d7795732931813255843af3cf308f18aafa47650e949  guix-build-638133188fa2/output/aarch64-linux-gnu/bitcoin-638133188fa2-aarch64-linux-gnu.tar.gz
0a0f49b35abc654842d988bfa8ccd66f104eff223baded0c0c48fe306bfc3189  guix-build-638133188fa2/output/arm-linux-gnueabihf/SHA256SUMS.part
a3ef166964fcecbe12f24559b7de2be2d535f4c4d1480a14d230c7027183bbcb  guix-build-638133188fa2/output/arm-linux-gnueabihf/bitcoin-638133188fa2-arm-linux-gnueabihf-debug.tar.gz
fcf12dc881680552a262754f520c52b30831aeeef4c4e3163d0a00b9b7dd8494  guix-build-638133188fa2/output/arm-linux-gnueabihf/bitcoin-638133188fa2-arm-linux-gnueabihf.tar.gz
12c4769900aca1fd2133f45c3cf5b84d6bc3e28c55f3e5349e65eabcc2d4d606  guix-build-638133188fa2/output/dist-archive/bitcoin-638133188fa2.tar.gz
78b857871eb735a1add4018ff38a0b13bb6c6eae49d22394dbe8c039b6d8f728  guix-build-638133188fa2/output/powerpc64-linux-gnu/SHA256SUMS.part
cef24717d877e2a069fb2578a5675dba2adb0ab37a8c735fd1c42f03b67da744  guix-build-638133188fa2/output/powerpc64-linux-gnu/bitcoin-638133188fa2-powerpc64-linux-gnu-debug.tar.gz
465f37bcbb72c03795085e2e47c647ac8d9db9894e19edabaa265b17faec790c  guix-build-638133188fa2/output/powerpc64-linux-gnu/bitcoin-638133188fa2-powerpc64-linux-gnu.tar.gz
28ee721dd23c5dffb993827dc319d91424925eb4427443e9ed0a65f2b89bd1ec  guix-build-638133188fa2/output/powerpc64le-linux-gnu/SHA256SUMS.part
c57922fb4e32f62ac0e80383669b350e2c1973c3c17003a39a65dc15790c11af  guix-build-638133188fa2/output/powerpc64le-linux-gnu/bitcoin-638133188fa2-powerpc64le-linux-gnu-debug.tar.gz
38cd9bdc692390a166ec2926eea66c80c3ceb09eda49d251baf4b028717de1ae  guix-build-638133188fa2/output/powerpc64le-linux-gnu/bitcoin-638133188fa2-powerpc64le-linux-gnu.tar.gz
bb835248e4212751b51d28e1105347c129b5bc9be9675adc4a05107b97d04cff  guix-build-638133188fa2/output/riscv64-linux-gnu/SHA256SUMS.part
3249955ece9fbc54c15bc3a450d47a9908578f0de1d94e148874926cdf378781  guix-build-638133188fa2/output/riscv64-linux-gnu/bitcoin-638133188fa2-riscv64-linux-gnu-debug.tar.gz
ef21bd74300b777537b0e0cf836df06f231cad38eaf31032d2a0688975cd878e  guix-build-638133188fa2/output/riscv64-linux-gnu/bitcoin-638133188fa2-riscv64-linux-gnu.tar.gz
367ff0943f3a662d4ccb8e2351ac6bda96438d26e602814b4625b9d19e74dfc0  guix-build-638133188fa2/output/x86_64-apple-darwin18/SHA256SUMS.part
4c8eadf70973f1b01037e4717e3152ca704af6591d2def66cdc0d9e997cce4e5  guix-build-638133188fa2/output/x86_64-apple-darwin18/bitcoin-638133188fa2-osx-unsigned.dmg
d1d844548fccac9de6d229a93b521a8cf88265dc9f034cd4a109dbaec840d4aa  guix-build-638133188fa2/output/x86_64-apple-darwin18/bitcoin-638133188fa2-osx-unsigned.tar.gz
0dcb20052e0196c58eeb66f56fe15a5ab6466376203919e01348bfde6718f3f9  guix-build-638133188fa2/output/x86_64-apple-darwin18/bitcoin-638133188fa2-osx64.tar.gz
4aded0867bcc8d163f9137f131d82bc157a83043c7907474d76ddd4b3f18c40d  guix-build-638133188fa2/output/x86_64-linux-gnu/SHA256SUMS.part
d3031ec2e29a888e4462a44e92ffa77feedd8ac243da682071fce419cf7e5f26  guix-build-638133188fa2/output/x86_64-linux-gnu/bitcoin-638133188fa2-x86_64-linux-gnu-debug.tar.gz
a6722dca18f7c400c53d3576b6d438bc397d084f200eff5c32e7b77c8aa7a8a5  guix-build-638133188fa2/output/x86_64-linux-gnu/bitcoin-638133188fa2-x86_64-linux-gnu.tar.gz
0285facc842ecd4b492c3b62a21079e83b0e81bc0a01ee750543ba0c341a74bf  guix-build-638133188fa2/output/x86_64-w64-mingw32/SHA256SUMS.part
3ec91feb1265d8492ef10d933ed18ee54fe0baf42abd03232fb747cce0a9c925  guix-build-638133188fa2/output/x86_64-w64-mingw32/bitcoin-638133188fa2-win-unsigned.tar.gz
5bfdb18903f4076f7484bbd82079c94eb8ccaf5bb5523a5a59abffbdaa686194  guix-build-638133188fa2/output/x86_64-w64-mingw32/bitcoin-638133188fa2-win64-debug.zip
8d8dc8b4a0d1f5e49189ff74b35803bd228bc8b560fd2bbf84fc5e94a1bb6d16  guix-build-638133188fa2/output/x86_64-w64-mingw32/bitcoin-638133188fa2-win64-setup-unsigned.exe
67d4c46850222e57d688beed894c94d84a88219f0f9a2ef6d2950d3a3aa1df9d  guix-build-638133188fa2/output/x86_64-w64-mingw32/bitcoin-638133188fa2-win64.zip

@hebasto
Copy link
Member Author

hebasto commented Sep 2, 2021

Rebased 6381331 -> ad2a195 (pr22552.03 -> pr22552.04) due to the conflict with #22840.

@laanwj
Copy link
Member

laanwj commented Sep 9, 2021

Why might this be happening? This PR hits the nail on the head by attacking the use of recursive variables.

Thanks @jarolrod for your detailed explanation, it wasn't kind of clear to me in the OP what was exactly fragile here, and how it is fixed. I don't know a lot about makefile internals, but avoiding inadvertent issues that could result in wrong builds seems important. Concept ACK.

Would be good if @theuni has a look over the changes I think.

@hebasto
Copy link
Member Author

hebasto commented Apr 21, 2022

Updated 17ef4c9 -> 4cba82d (pr22552.13 -> pr22552.14):

  • rebased
  • PR description has been updated

@hebasto
Copy link
Member Author

hebasto commented May 28, 2022

Rebased 4cba82d -> 83f7c33 (pr22552.14 -> pr22552.15) due to the conflict with #25046.

hebasto added 2 commits July 20, 2022 16:39
-BEGIN VERIFY SCRIPT-
FILES=$(git ls-files depends/packages)
sed -i 's/package=/package := /' -- $FILES
sed -i -e 's/$(package)\(\w\+\)=/$(package)\1 := /' -- $FILES
-END VERIFY SCRIPT-
@hebasto
Copy link
Member Author

hebasto commented Jul 20, 2022

Rebased 83f7c33 -> df6dccd (pr22552.15 -> pr22552.16).

@jarolrod
Copy link
Member

GUIX hashes:

x86:


arm64:

$ env HOSTS='arm-linux-gnueabihf arm64-apple-darwin powerpc64-linux-gnu powerpc64le-linux-gnu riscv64-linux-gnu x86_64-apple-darwin x86_64-linux-gnu x86_64-w64-mingw32' ./contrib/guix/guix-build
$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum

c9f5832b2a7a9138650abd07cb99e61c5e4806b5f0a37632b5e9fcc4e2f2cb50  guix-build-df6dccde8e1c/output/arm-linux-gnueabihf/SHA256SUMS.part
dff03c057136f27718793a3586518599c5fde872506ce6b3d445e9e9975bb125  guix-build-df6dccde8e1c/output/arm-linux-gnueabihf/bitcoin-df6dccde8e1c-arm-linux-gnueabihf-debug.tar.gz
a73569a8aac5940f7b1bd683c2d5ffb3b899beeb29fe521351cb481b4897b747  guix-build-df6dccde8e1c/output/arm-linux-gnueabihf/bitcoin-df6dccde8e1c-arm-linux-gnueabihf.tar.gz
baafc34efccded2ae164b1b3b5ce3c7547322ba81498f7bdf9d163490d4a402e  guix-build-df6dccde8e1c/output/arm64-apple-darwin/SHA256SUMS.part
abb2cac3e4270a107359d3182401a1582f39ca55f8a95b00e441abf6738b3ff6  guix-build-df6dccde8e1c/output/arm64-apple-darwin/bitcoin-df6dccde8e1c-arm64-apple-darwin-unsigned.dmg
c545b8871acad16c3f4ea83e382be59101a1306ed5faf03c9d400311fa914a5a  guix-build-df6dccde8e1c/output/arm64-apple-darwin/bitcoin-df6dccde8e1c-arm64-apple-darwin-unsigned.tar.gz
d6c84396b152c21f94f174505d3b689f94726f7e2d750a9b5415a561f034c6ec  guix-build-df6dccde8e1c/output/arm64-apple-darwin/bitcoin-df6dccde8e1c-arm64-apple-darwin.tar.gz
7cdd953cb6334360e609f74030750ddd64b22fb7787a6faac95939eab8dbc112  guix-build-df6dccde8e1c/output/dist-archive/bitcoin-df6dccde8e1c.tar.gz
0a62c1dcf1e8789fb7051d86dc0ae576e5feb449a9f394224163e3476d73eab9  guix-build-df6dccde8e1c/output/powerpc64-linux-gnu/SHA256SUMS.part
b87fd60479ebb0f6c6659e7911c251dc576260146f3e6ab24df9e2b72f6e029e  guix-build-df6dccde8e1c/output/powerpc64-linux-gnu/bitcoin-df6dccde8e1c-powerpc64-linux-gnu-debug.tar.gz
d18aa375d1bf87e682e10d78621f8ce72306f27c098250de806e6d7aa11b574f  guix-build-df6dccde8e1c/output/powerpc64-linux-gnu/bitcoin-df6dccde8e1c-powerpc64-linux-gnu.tar.gz
827176015b3c1ee7a04f62f189145efe804c5b506cf1c02fac77aff1d695b4ef  guix-build-df6dccde8e1c/output/powerpc64le-linux-gnu/SHA256SUMS.part
bdb7d702ec7f0fed0b97e9abb36dc9b1359422db6ccb777b19e01a367d4b7f23  guix-build-df6dccde8e1c/output/powerpc64le-linux-gnu/bitcoin-df6dccde8e1c-powerpc64le-linux-gnu-debug.tar.gz
56b8d13bcf7e8c5e99a44b9d8716539c3fa2ffdc0c0eba1ca7132d77c4873b0b  guix-build-df6dccde8e1c/output/powerpc64le-linux-gnu/bitcoin-df6dccde8e1c-powerpc64le-linux-gnu.tar.gz
001bd8d3707983f8f497b4efc6d985530c7beaa4373710520cecf63ef20354e3  guix-build-df6dccde8e1c/output/riscv64-linux-gnu/SHA256SUMS.part
ae61d0f8343183dddbf0c0e9e284b085d2246f167ba6e54d5c63e096e1aec363  guix-build-df6dccde8e1c/output/riscv64-linux-gnu/bitcoin-df6dccde8e1c-riscv64-linux-gnu-debug.tar.gz
7a23be4b3c254bd6b808a1edf4412da78fb3d314a5df3d643422eced15d56ec6  guix-build-df6dccde8e1c/output/riscv64-linux-gnu/bitcoin-df6dccde8e1c-riscv64-linux-gnu.tar.gz
e74ab13566563fe55e3330c0832107de2f91eb073573df6fe9c8b2d51b8248e6  guix-build-df6dccde8e1c/output/x86_64-apple-darwin/SHA256SUMS.part
62f4fecf0e72d99997142e3212b8bb2e3f5010420b8ce224ab09befd015c7a15  guix-build-df6dccde8e1c/output/x86_64-apple-darwin/bitcoin-df6dccde8e1c-x86_64-apple-darwin-unsigned.dmg
0a6cc1e2d9358ecacf3b45b9a26a85a5cdddff83ed823e718cca77df692be8e1  guix-build-df6dccde8e1c/output/x86_64-apple-darwin/bitcoin-df6dccde8e1c-x86_64-apple-darwin-unsigned.tar.gz
b4767ce20907aac2d6698c23bc7ca47865d9269e61e1801a610c9642146e170d  guix-build-df6dccde8e1c/output/x86_64-apple-darwin/bitcoin-df6dccde8e1c-x86_64-apple-darwin.tar.gz
e42b4cd134a6690897064fccb6b91ea916f8c37a43d1701c835c20d414ad7b22  guix-build-df6dccde8e1c/output/x86_64-linux-gnu/SHA256SUMS.part
fe94e2e6f807a714a65032f3a4da100b847dbf89cc6e6058a09325cb889c50d1  guix-build-df6dccde8e1c/output/x86_64-linux-gnu/bitcoin-df6dccde8e1c-x86_64-linux-gnu-debug.tar.gz
011b67e13718d024202a7e38a4d31f9bd7c7f3bb2a43ee2d789db54ed35275ce  guix-build-df6dccde8e1c/output/x86_64-linux-gnu/bitcoin-df6dccde8e1c-x86_64-linux-gnu.tar.gz
bb578a81351ddbb25d947a42f7b7649ea518b98bf5dfda9a6b04904c05829f90  guix-build-df6dccde8e1c/output/x86_64-w64-mingw32/SHA256SUMS.part
d4d7a63ba0b1d6ef85bfddf6124a1214bc3c51dfe96d0a24d1bfb90c6e30b246  guix-build-df6dccde8e1c/output/x86_64-w64-mingw32/bitcoin-df6dccde8e1c-win64-debug.zip
28aaf5124d1f15c3cf2ffc0f40b0f95761e921cae13b3cf477dc00d776e664d0  guix-build-df6dccde8e1c/output/x86_64-w64-mingw32/bitcoin-df6dccde8e1c-win64-setup-unsigned.exe
4e3880f2fdb0cbee261313d3d35f14b6a189a4a81d00730961a03b5f1728399b  guix-build-df6dccde8e1c/output/x86_64-w64-mingw32/bitcoin-df6dccde8e1c-win64-unsigned.tar.gz
1edb0861de7ecfe4893b8699a1f16723a11e480f1d6a4a5f3034e895e594ba9d  guix-build-df6dccde8e1c/output/x86_64-w64-mingw32/bitcoin-df6dccde8e1c-win64.zip

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@achow101
Copy link
Member

Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.

@achow101 achow101 closed this Oct 12, 2022
fanquake added a commit to bitcoin-core/gui that referenced this pull request Dec 8, 2022
… to all `$(package)_*_cmds`

affbf58 build: Move environment variables into `$(package)_config_env` (Hennadii Stepanov)
d44fcd3 build: Make $(package)_*_env available to all $(package)_*_cmds (Hennadii Stepanov)

Pull request description:

  On master (1e7564e) 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](bitcoin/bitcoin#22719) in the depends build system has already become a problem at least two times in the past (bitcoin/bitcoin#16883 (comment) and bitcoin/bitcoin#24134). Each time the problem was solved with other means.

  The initial [solution](bitcoin/bitcoin#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](bitcoin/bitcoin#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:https://github.com/bitcoin/bitcoin/blob/1e7564eca8a688f39c75540877ec3bdfdde766b1/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 affbf58

Tree-SHA512: 0ce2cf82870a7774bdf1592fac50857126ae47da902e349f1092d50109223be9d6a8efd5e92ec08c2ca775b17516482aabaf232378950ade36484a883acc177b
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 8, 2022
…`$(package)_*_cmds`

affbf58 build: Move environment variables into `$(package)_config_env` (Hennadii Stepanov)
d44fcd3 build: Make $(package)_*_env available to all $(package)_*_cmds (Hennadii Stepanov)

Pull request description:

  On master (1e7564e) 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#22552.

  Another [bug](bitcoin#22719) in the depends build system has already become a problem at least two times in the past (bitcoin#16883 (comment) and bitcoin#24134). Each time the problem was solved with other means.

  The initial [solution](bitcoin#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](bitcoin#24134).

  The bug is well described in bitcoin#22719.

  Here is another, a bit simpler description, which requires only basic shell (bash, dash etc) experience.
  After creating targets by this code:https://github.com/bitcoin/bitcoin/blob/1e7564eca8a688f39c75540877ec3bdfdde766b1/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#22719.

  ---

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

ACKs for top commit:
  fanquake:
    ACK affbf58

Tree-SHA512: 0ce2cf82870a7774bdf1592fac50857126ae47da902e349f1092d50109223be9d6a8efd5e92ec08c2ca775b17516482aabaf232378950ade36484a883acc177b
@bitcoin bitcoin locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants