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, refactor: Drop useless call Make function #24285

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Feb 7, 2022

Using the call function with $(package)_*_cmds is effectively noop because the latter, which could be found in <package>.mk files, do not use temporary $(1) variable at all.

This PR removes useless calls of the call function, and makes code more readable and easier to reason about.

No change in resulted dependency binaries could be easy verified with bitcoin/bitcoin/#21995.

@hebasto
Copy link
Member Author

hebasto commented Feb 7, 2022

Guix builds:

$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
65670faf41fd8f1c705a92bd19254b4021cf12c400ffcac078d45391c18de36a  guix-build-e644591426fb/output/aarch64-linux-gnu/SHA256SUMS.part
b81317b5259d93e1f59653d8e7bbe77a041d553e0cae4bb7497b7a2cfe6295ef  guix-build-e644591426fb/output/aarch64-linux-gnu/bitcoin-e644591426fb-aarch64-linux-gnu-debug.tar.gz
713a0a152ad55a66435f96a1c007243edecc779d1041acb5e135dfbd2f857f18  guix-build-e644591426fb/output/aarch64-linux-gnu/bitcoin-e644591426fb-aarch64-linux-gnu.tar.gz
31f5e0d164b61db8da8f396f325091426f5153481a1a86c91bb5713bd4c3531d  guix-build-e644591426fb/output/arm-linux-gnueabihf/SHA256SUMS.part
ce36d8574f098ae17d385c615a3c5ea8d64189c669e4457d93e7263be9d9400a  guix-build-e644591426fb/output/arm-linux-gnueabihf/bitcoin-e644591426fb-arm-linux-gnueabihf-debug.tar.gz
5edfc17ae0771046923a6465805d9ba46c67eb4f7e1e88069c8ea0bb8081fb8a  guix-build-e644591426fb/output/arm-linux-gnueabihf/bitcoin-e644591426fb-arm-linux-gnueabihf.tar.gz
64b303bd4956d2b4e59d646d9ed64533d503710cfe033793a91d89c95b19cc2d  guix-build-e644591426fb/output/arm64-apple-darwin/SHA256SUMS.part
efe60e2bcb113557b2998f0e93d8b87ebf851c67d02c2d830d0c822795240945  guix-build-e644591426fb/output/arm64-apple-darwin/bitcoin-e644591426fb-arm64-apple-darwin.tar.gz
b5a1592bbe884777a43f2a4ce6fdde24bfbd71db2984148997f8d92be66e05b8  guix-build-e644591426fb/output/arm64-apple-darwin/bitcoin-e644591426fb-osx-unsigned.dmg
ae6c5e3b75902cf198a5dd15dc1b9a45a209749a716557b622d75944c6c5094e  guix-build-e644591426fb/output/arm64-apple-darwin/bitcoin-e644591426fb-osx-unsigned.tar.gz
aee679939caa0bdcebb039f04db0a8df08a486070818051be79b78afcd7978d7  guix-build-e644591426fb/output/dist-archive/bitcoin-e644591426fb.tar.gz
ea4164e3d8163343cd6f2fa16919513e7c08884c8f19fdd0a4771fa367713595  guix-build-e644591426fb/output/powerpc64-linux-gnu/SHA256SUMS.part
4e952e578b30cfdf6f5679fbeb400556787416e854f35db4756278762bdb2e71  guix-build-e644591426fb/output/powerpc64-linux-gnu/bitcoin-e644591426fb-powerpc64-linux-gnu-debug.tar.gz
673e523c33aff5d6ba6fa6463755a2710e06525e179425524ece9c972e432b3d  guix-build-e644591426fb/output/powerpc64-linux-gnu/bitcoin-e644591426fb-powerpc64-linux-gnu.tar.gz
775f51ad557ee13d5254c9376b24fae14cbf49d60ab1e7b852e78a07c30fea1f  guix-build-e644591426fb/output/powerpc64le-linux-gnu/SHA256SUMS.part
5ec61cff14a8e9991fb68f967eb59322617b1b7fe38d31b94e1df06e25cdf516  guix-build-e644591426fb/output/powerpc64le-linux-gnu/bitcoin-e644591426fb-powerpc64le-linux-gnu-debug.tar.gz
6eee56e0f8e462306a4aa7dfb24e9702a5611e8f17097f41dac19aabffb8146d  guix-build-e644591426fb/output/powerpc64le-linux-gnu/bitcoin-e644591426fb-powerpc64le-linux-gnu.tar.gz
78ec8e65167560de96c44620121a9d633aff8bdfdf82f4eef778c748bcc5c4f9  guix-build-e644591426fb/output/riscv64-linux-gnu/SHA256SUMS.part
89a5a90e1bd49379c6ba55df6efceb5c78e60d1a92ae76f0038610495b0f052e  guix-build-e644591426fb/output/riscv64-linux-gnu/bitcoin-e644591426fb-riscv64-linux-gnu-debug.tar.gz
a0a8d5bc849036cfb2411004481bc610e96a35500fc48a7a58575a4a38a1ea7e  guix-build-e644591426fb/output/riscv64-linux-gnu/bitcoin-e644591426fb-riscv64-linux-gnu.tar.gz
5b147457e4d7344587e3d5bcd1d96d2a12a86e6a5ef7e3e9d58bc58f6f72ac0b  guix-build-e644591426fb/output/x86_64-apple-darwin/SHA256SUMS.part
05fe5b5010e4f01f9b14ec46ca0f44156fd5a5b24109030af443decabb27fc2f  guix-build-e644591426fb/output/x86_64-apple-darwin/bitcoin-e644591426fb-osx-unsigned.dmg
4a4bda289eb8330708e25829b82b4a510cee5c1646048a761ce12757dfc25025  guix-build-e644591426fb/output/x86_64-apple-darwin/bitcoin-e644591426fb-osx-unsigned.tar.gz
1ed06f1b530d4bb7d2288475d8f62f3afa799a7d2408d6e9298abad65fefe11e  guix-build-e644591426fb/output/x86_64-apple-darwin/bitcoin-e644591426fb-osx64.tar.gz
ee1014d94171f499b2238fa606e9577b18afd40fe928d56ab71db23f7a6c1ec3  guix-build-e644591426fb/output/x86_64-linux-gnu/SHA256SUMS.part
3fba1450bbd26cf676ae3495b32f664296df3cb5c8348b2d9ebce71daab76863  guix-build-e644591426fb/output/x86_64-linux-gnu/bitcoin-e644591426fb-x86_64-linux-gnu-debug.tar.gz
44150c9849c8b68db2102ca3a92d694279b267d76350660e8ac94929cc2ca144  guix-build-e644591426fb/output/x86_64-linux-gnu/bitcoin-e644591426fb-x86_64-linux-gnu.tar.gz

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

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

Code review ACK e644591

Since in all the instances of call() addressed in this PR, $(1) is equivalent to $(package), and for each package, there is a separate $(package)_*_cmds, where each one had the value of there $(package), hence theoretically there is no need for $(1) value for them.
I also cross-checked for all the $(package)_*_cmds functions to see if any of them was using the $(package) as the parameter provided from call(), and I found none. So I think the changes applied in this PR are safe to merge.

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 8, 2022

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #24279 (build: Make $(package)_*_env available to all $(package)_*_cmds by hebasto)
  • #22811 (build: Fix depends build system when working with subtargets by hebasto)
  • #22126 (build: Disable make builtin rules. by dgoncharov)
  • #19952 (build, ci: Add file-based logging for individual packages by hebasto)

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.

@laanwj
Copy link
Member

laanwj commented Feb 9, 2022

Code review ACK e644591
Might want to ping @theuni on whether he had a specific reason to use call here.

@laanwj laanwj merged commit 9b7eb58 into bitcoin:master Apr 13, 2022
@hebasto hebasto deleted the 220207-call branch April 13, 2022 21:45
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 14, 2022
e644591 build, refactor: Drop useless `call` Make function (Hennadii Stepanov)

Pull request description:

  Using the [`call`](https://www.gnu.org/software/make/manual/html_node/Call-Function.html) function with `$(package)_*_cmds` is effectively noop because the latter, which could be found in `<package>.mk` files, do not use temporary `$(1)` variable at all.

  This PR removes useless calls of the `call` function, and makes code more readable and easier to reason about.

  No change in resulted dependency binaries could be easy verified with bitcoin/bitcoin/bitcoin#21995.

ACKs for top commit:
  laanwj:
    Code review ACK e644591
  shaavan:
    Code review ACK e644591

Tree-SHA512: 8481fa0dc5bbf7dd6a180f7fae5a2ccc07f85b50c7a966bceb2d7e010e07e5f211ee3f74f8ac79bc5acfde5f0764264d599d959ff3ebb8511b1b4a33f79509bd
fanquake added a commit to bitcoin-core/gui that referenced this pull request Feb 7, 2023
…imestamps deterministic

6ebe576 build: Make dependency package archive timestamps deterministic (Hennadii Stepanov)

Pull request description:

  This PR makes testing changes like bitcoin/bitcoin#20641, bitcoin/bitcoin#21593, bitcoin/bitcoin#22142, bitcoin/bitcoin#24279, bitcoin/bitcoin#24285 as easy as comparing hashes.

  With this PR:
  ```
  $ make -C depends clean
  $ make -C depends HOST=x86_64-w64-mingw32
  $ find depends/built/x86_64-w64-mingw32 -name '*.hash' | sort | xargs cat
  1f685a61cbf205f81977ecf88cba91fa1ccdfbe77ab4ec3405dcd33ceb778af4  bdb-4.8.30-ca950bd6d13.tar.gz
  08a9acde276e6e5e5c8913e3ad07eeecda184a996882ae226b3ed056c7ec1b01  boost-1.80.0-b537c466dcb.tar.gz
  144c6d92e4108fcc90740bee27007db58a88336a97be6367f9c8ba4cc208af27  libevent-2.1.12-stable-e13b2bdd8b8.tar.gz
  e3c9c9609bf32bfd460432c6ab99a64e9f8750ed775a193925ff4f5aed363e4c  libnatpmp-07004b97cf691774efebe70404cf22201e4d330d-82255b84667.tar.gz
  62c6a089a4b24a413eccd2f389bf4c8b0716423b0ace5e87e984069635da9f83  miniupnpc-2.2.2-c43fc4cf2f6.tar.gz
  78762700066273e597698a78479a506b33532ea565d18ef561614b9fc3820cf5  qrencode-3.4.4-663de0dc628.tar.gz
  5e2183faf91838510a48e6dbb4b65ae74a7d48ba1abc070b82767c4076582360  qt-5.15.5-986926343e2.tar.gz
  9f8459f8d27fc3af9146712be6ba6577f15741429936504a950cc51c17da1ba8  sqlite-3380500-bec6a4d3299.tar.gz
  0eca5d01d427de50be4bd57c8bb100ab69b017792c32b8733e2b20443f4c9c28  zeromq-4.3.4-8ae81bab6f4.tar.gz
  ```

  As an example, here is an evidence that bitcoin/bitcoin#24279 is a strict refactoring change:
  ```
  $ git fetch origin pull/24279/head
  $ git cherry-pick 706026838d917a3d853e03e83db040f1fd4aeb74
  $ git cherry-pick 3f90ddea8a6a2061cfb347a1d77df2c0a6fa238c
  $ make -C depends clean
  $ make -C depends HOST=x86_64-w64-mingw32
  $ find depends/built/x86_64-w64-mingw32 -name '*.hash' | sort | xargs cat
  1f685a61cbf205f81977ecf88cba91fa1ccdfbe77ab4ec3405dcd33ceb778af4  bdb-4.8.30-c7faf31d5ca.tar.gz
  08a9acde276e6e5e5c8913e3ad07eeecda184a996882ae226b3ed056c7ec1b01  boost-1.80.0-1af3dd1d99e.tar.gz
  144c6d92e4108fcc90740bee27007db58a88336a97be6367f9c8ba4cc208af27  libevent-2.1.12-stable-6228a9f8534.tar.gz
  e3c9c9609bf32bfd460432c6ab99a64e9f8750ed775a193925ff4f5aed363e4c  libnatpmp-07004b97cf691774efebe70404cf22201e4d330d-41aa6194ecc.tar.gz
  62c6a089a4b24a413eccd2f389bf4c8b0716423b0ace5e87e984069635da9f83  miniupnpc-2.2.2-6a93027769c.tar.gz
  78762700066273e597698a78479a506b33532ea565d18ef561614b9fc3820cf5  qrencode-3.4.4-d40cb2d45c9.tar.gz
  5e2183faf91838510a48e6dbb4b65ae74a7d48ba1abc070b82767c4076582360  qt-5.15.5-120c3cb745d.tar.gz
  9f8459f8d27fc3af9146712be6ba6577f15741429936504a950cc51c17da1ba8  sqlite-3380500-bbd4d813c69.tar.gz
  0eca5d01d427de50be4bd57c8bb100ab69b017792c32b8733e2b20443f4c9c28  zeromq-4.3.4-df0858a19d2.tar.gz
  ```

ACKs for top commit:
  TheCharlatan:
    Code review ACK 6ebe576

Tree-SHA512: 20e0222781f5dcb50126c11677d0671bcdd7be144b2e528c75a02983acc494206552fb35039697ccd094de27a21b3fb439e9965c34feb8a6d74627fa20a9a5e7
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 7, 2023
…s deterministic

6ebe576 build: Make dependency package archive timestamps deterministic (Hennadii Stepanov)

Pull request description:

  This PR makes testing changes like bitcoin#20641, bitcoin#21593, bitcoin#22142, bitcoin#24279, bitcoin#24285 as easy as comparing hashes.

  With this PR:
  ```
  $ make -C depends clean
  $ make -C depends HOST=x86_64-w64-mingw32
  $ find depends/built/x86_64-w64-mingw32 -name '*.hash' | sort | xargs cat
  1f685a61cbf205f81977ecf88cba91fa1ccdfbe77ab4ec3405dcd33ceb778af4  bdb-4.8.30-ca950bd6d13.tar.gz
  08a9acde276e6e5e5c8913e3ad07eeecda184a996882ae226b3ed056c7ec1b01  boost-1.80.0-b537c466dcb.tar.gz
  144c6d92e4108fcc90740bee27007db58a88336a97be6367f9c8ba4cc208af27  libevent-2.1.12-stable-e13b2bdd8b8.tar.gz
  e3c9c9609bf32bfd460432c6ab99a64e9f8750ed775a193925ff4f5aed363e4c  libnatpmp-07004b97cf691774efebe70404cf22201e4d330d-82255b84667.tar.gz
  62c6a089a4b24a413eccd2f389bf4c8b0716423b0ace5e87e984069635da9f83  miniupnpc-2.2.2-c43fc4cf2f6.tar.gz
  78762700066273e597698a78479a506b33532ea565d18ef561614b9fc3820cf5  qrencode-3.4.4-663de0dc628.tar.gz
  5e2183faf91838510a48e6dbb4b65ae74a7d48ba1abc070b82767c4076582360  qt-5.15.5-986926343e2.tar.gz
  9f8459f8d27fc3af9146712be6ba6577f15741429936504a950cc51c17da1ba8  sqlite-3380500-bec6a4d3299.tar.gz
  0eca5d01d427de50be4bd57c8bb100ab69b017792c32b8733e2b20443f4c9c28  zeromq-4.3.4-8ae81bab6f4.tar.gz
  ```

  As an example, here is an evidence that bitcoin#24279 is a strict refactoring change:
  ```
  $ git fetch origin pull/24279/head
  $ git cherry-pick 7060268
  $ git cherry-pick 3f90dde
  $ make -C depends clean
  $ make -C depends HOST=x86_64-w64-mingw32
  $ find depends/built/x86_64-w64-mingw32 -name '*.hash' | sort | xargs cat
  1f685a61cbf205f81977ecf88cba91fa1ccdfbe77ab4ec3405dcd33ceb778af4  bdb-4.8.30-c7faf31d5ca.tar.gz
  08a9acde276e6e5e5c8913e3ad07eeecda184a996882ae226b3ed056c7ec1b01  boost-1.80.0-1af3dd1d99e.tar.gz
  144c6d92e4108fcc90740bee27007db58a88336a97be6367f9c8ba4cc208af27  libevent-2.1.12-stable-6228a9f8534.tar.gz
  e3c9c9609bf32bfd460432c6ab99a64e9f8750ed775a193925ff4f5aed363e4c  libnatpmp-07004b97cf691774efebe70404cf22201e4d330d-41aa6194ecc.tar.gz
  62c6a089a4b24a413eccd2f389bf4c8b0716423b0ace5e87e984069635da9f83  miniupnpc-2.2.2-6a93027769c.tar.gz
  78762700066273e597698a78479a506b33532ea565d18ef561614b9fc3820cf5  qrencode-3.4.4-d40cb2d45c9.tar.gz
  5e2183faf91838510a48e6dbb4b65ae74a7d48ba1abc070b82767c4076582360  qt-5.15.5-120c3cb745d.tar.gz
  9f8459f8d27fc3af9146712be6ba6577f15741429936504a950cc51c17da1ba8  sqlite-3380500-bbd4d813c69.tar.gz
  0eca5d01d427de50be4bd57c8bb100ab69b017792c32b8733e2b20443f4c9c28  zeromq-4.3.4-df0858a19d2.tar.gz
  ```

ACKs for top commit:
  TheCharlatan:
    Code review ACK 6ebe576

Tree-SHA512: 20e0222781f5dcb50126c11677d0671bcdd7be144b2e528c75a02983acc494206552fb35039697ccd094de27a21b3fb439e9965c34feb8a6d74627fa20a9a5e7
@bitcoin bitcoin locked and limited conversation to collaborators Apr 13, 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.

4 participants