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

cmake: Migrate Guix build scripts to CMake #67

Merged
merged 2 commits into from
Jan 16, 2024
Merged

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Dec 16, 2023

Windows and macOS hosts are disabled temporarily as they require GUI for their deploy targets.

@hebasto hebasto force-pushed the 231216-cmake-AO branch 4 times, most recently from 6de765a to 0d9c421 Compare December 17, 2023 18:12
@hebasto hebasto changed the title cmake: Migrate Guix builds to CMake cmake: Migrate Guix build scripts to CMake Jan 8, 2024
@hebasto
Copy link
Owner Author

hebasto commented Jan 8, 2024

Reworked according to bitcoin#29189.

Friendly ping @fanquake @TheCharlatan @theuni :)


add_custom_target(check-symbols
COMMAND ${CMAKE_COMMAND} -E echo "Running symbol and dynamic library checks..."
COMMAND ${PYTHON_COMMAND} ${CMAKE_SOURCE_DIR}/contrib/devtools/symbol-check.py ${executables}

Choose a reason for hiding this comment

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

What about contrib/devtools/utils.py?

Choose a reason for hiding this comment

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

Never mind, this file does not have to be manually added or executed, so no change required.

@TheCharlatan
Copy link

Guix builds (x86 & aarch64)

09d1d5e3099eaa5397e5bb6d7009eb5ed8a2d6f945498ca9502be2d09cdc0ebd  guix-build-27fef64f448c/output/aarch64-linux-gnu/SHA256SUMS.part
55c9ce1bba179191811aa5aa163c02c9c8ad8859a7431457c7318cb0b8159dac  guix-build-27fef64f448c/output/aarch64-linux-gnu/bitcoin-27fef64f448c-aarch64-linux-gnu-debug.tar.gz
06daf7939f16b6ec166452d43317b4be33a4ccacd6f5eb927e6e5bee567d209c  guix-build-27fef64f448c/output/aarch64-linux-gnu/bitcoin-27fef64f448c-aarch64-linux-gnu.tar.gz
fac8e639e3dd14019628c380e683480dfa3300c9820e92ee7eac0916e4b9b964  guix-build-27fef64f448c/output/arm-linux-gnueabihf/SHA256SUMS.part
e17b4312a13cc7cfd9afb1a2a4757a74ca6656b9ec2d05678b8cc945a9755c69  guix-build-27fef64f448c/output/arm-linux-gnueabihf/bitcoin-27fef64f448c-arm-linux-gnueabihf-debug.tar.gz
28c628273ba9a2d1e22f466251531ca7654c59fd29e0ecb324e99b6f003f71c6  guix-build-27fef64f448c/output/arm-linux-gnueabihf/bitcoin-27fef64f448c-arm-linux-gnueabihf.tar.gz
733735c43724ee0dd4b49b47ea58b7c05d6bb8d1f6ee310484680416dd96cc2a  guix-build-27fef64f448c/output/dist-archive/bitcoin-27fef64f448c.tar.gz
258bce68cd0269d362b841d91396551bb53691a086f9b5c45e7071a2a6390c1b  guix-build-27fef64f448c/output/powerpc64-linux-gnu/SHA256SUMS.part
d7379a81573ec8dd865be47ec69827ccc370003831dfa8904706366e109a5dbb  guix-build-27fef64f448c/output/powerpc64-linux-gnu/bitcoin-27fef64f448c-powerpc64-linux-gnu-debug.tar.gz
5d358c754fa2093880ef442fd3b8d66d82b0300634725db38a606df912280c2b  guix-build-27fef64f448c/output/powerpc64-linux-gnu/bitcoin-27fef64f448c-powerpc64-linux-gnu.tar.gz
7fc77eb9e1a5a5cdcfdcbba17d0a696e1b5a88929ccb063ba1335be964372e77  guix-build-27fef64f448c/output/powerpc64le-linux-gnu/SHA256SUMS.part
996b008e6b2d75ddd83390e2ff1d0e94783023f57f1046b5cb2a8ad5788d1bdd  guix-build-27fef64f448c/output/powerpc64le-linux-gnu/bitcoin-27fef64f448c-powerpc64le-linux-gnu-debug.tar.gz
186dd3c2f2033fe48c214adf2f93d6d2f9de624b6f84e49902e744b62876a88e  guix-build-27fef64f448c/output/powerpc64le-linux-gnu/bitcoin-27fef64f448c-powerpc64le-linux-gnu.tar.gz
052df8d1032d6ea20574a53e92a79587e5705e14502289ef5e96f2a6d5c7e1d6  guix-build-27fef64f448c/output/riscv64-linux-gnu/SHA256SUMS.part
d5c160366d8d9010ccfee5062616c625f08be0a1c7f35a0d4a75d3e70b908358  guix-build-27fef64f448c/output/riscv64-linux-gnu/bitcoin-27fef64f448c-riscv64-linux-gnu-debug.tar.gz
99adb65e6b7db728fca79d6df3f5646e986c3d33016ed921df8dcbd159ba63de  guix-build-27fef64f448c/output/riscv64-linux-gnu/bitcoin-27fef64f448c-riscv64-linux-gnu.tar.gz
390abf78f3db84135f35c186b83e8c30a688640ac6318aac9803c8a3d0389575  guix-build-27fef64f448c/output/x86_64-linux-gnu/SHA256SUMS.part
baa30e029f8528bd75ab9c0ef830dbb28bdeeb9214f381f5b72406e25cdee71d  guix-build-27fef64f448c/output/x86_64-linux-gnu/bitcoin-27fef64f448c-x86_64-linux-gnu-debug.tar.gz
da0b40ec0b2cf1dfff5b3d1d9fdefb50db3131d682347c4ede1eacffd555ae0a  guix-build-27fef64f448c/output/x86_64-linux-gnu/bitcoin-27fef64f448c-x86_64-linux-gnu.tar.gz

Copy link

@theuni theuni 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.
Looks ok at a quick glance. Haven't tested yet.

${HOST_LDFLAGS:+LDFLAGS="${HOST_LDFLAGS}"}

sed -i.old 's/-lstdc++ //g' config.status libtool
env CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \
Copy link

Choose a reason for hiding this comment

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

Any reason to prefer env here over setting the CMAKE variables directly?

Copy link
Owner Author

Choose a reason for hiding this comment

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

The LDFLAGS populates both CMake variables: CMAKE_EXE_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS. The code is more concise.

CFLAGS and CXXFLAGS are used in the same way for consistency.

@hebasto
Copy link
Owner Author

hebasto commented Jan 9, 2024

Rebased.

Copy link

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

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

Guix build (x86)

9c6e2c3493f546f683f0dce6f139a67e5b46e746aa7347f9eb6112eef3180287  guix-build-54b4ab66e2f9/output/aarch64-linux-gnu/SHA256SUMS.part
93f1d78f882e9fb1f7b6792d7d05f6730ebaccb2be780b9a80a262e14172f4b2  guix-build-54b4ab66e2f9/output/aarch64-linux-gnu/bitcoin-54b4ab66e2f9-aarch64-linux-gnu-debug.tar.gz
c9675c78e33c2773ff7ade28001a73f54e1b459d0f6de9685ce8e417b801677d  guix-build-54b4ab66e2f9/output/aarch64-linux-gnu/bitcoin-54b4ab66e2f9-aarch64-linux-gnu.tar.gz
c05e90d3163223f31133dc02339b7218cd19c7916d6977b908e6c8840f058408  guix-build-54b4ab66e2f9/output/arm-linux-gnueabihf/SHA256SUMS.part
988c7ffb3cf77fb7e2329c9474cfb211f183db1a958e89567b503d7376c25d0c  guix-build-54b4ab66e2f9/output/arm-linux-gnueabihf/bitcoin-54b4ab66e2f9-arm-linux-gnueabihf-debug.tar.gz
1bcbcc4154808d55588981c793795ea6389750e90efcae0684d4bf469e86749b  guix-build-54b4ab66e2f9/output/arm-linux-gnueabihf/bitcoin-54b4ab66e2f9-arm-linux-gnueabihf.tar.gz
47ac728a81c5f4e26a10ab2cc362eceac0398a3fad4a0fa295fb505ed82814b6  guix-build-54b4ab66e2f9/output/dist-archive/bitcoin-54b4ab66e2f9.tar.gz
a3bc2e70852b8a95b8334fa71e2fa4590a331dbed7a00d00fc5303a1e1c061fe  guix-build-54b4ab66e2f9/output/powerpc64-linux-gnu/SHA256SUMS.part
1c0dd0f27fc600edcf8ff3a8884ae3a81616c0ea31466e0284c2b9753f2e5090  guix-build-54b4ab66e2f9/output/powerpc64-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64-linux-gnu-debug.tar.gz
0eb731e7aec88fc65814e2c49314941cd6a1e75aaa05ea0cf4b22158762ab6bc  guix-build-54b4ab66e2f9/output/powerpc64-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64-linux-gnu.tar.gz
d46de7c6c333d5c1feb206171b2dd049ee0b48daeacbef75ef75033b488f8595  guix-build-54b4ab66e2f9/output/powerpc64le-linux-gnu/SHA256SUMS.part
be193c8d672c6000c3b798df6d75408a91dcbb5ec982f74495954970fce67e29  guix-build-54b4ab66e2f9/output/powerpc64le-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64le-linux-gnu-debug.tar.gz
1fbb475ef5088810d49dd2bed13e32deb52d2dc019c2fbe35ee26c3c92b3b507  guix-build-54b4ab66e2f9/output/powerpc64le-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64le-linux-gnu.tar.gz
e722583e7a44540fe8d815044c957ae4a1fc702c2085c6cdf396c1b4547c615a  guix-build-54b4ab66e2f9/output/riscv64-linux-gnu/SHA256SUMS.part
9d5e6ec589a2c3e06793156dc807c49c47fdb75b945ba0b76a24d24d4ac5a880  guix-build-54b4ab66e2f9/output/riscv64-linux-gnu/bitcoin-54b4ab66e2f9-riscv64-linux-gnu-debug.tar.gz
3001824dea87f57e74b88233e611e7e8c66df1808e01cdcfa7f397fdc9cbd63c  guix-build-54b4ab66e2f9/output/riscv64-linux-gnu/bitcoin-54b4ab66e2f9-riscv64-linux-gnu.tar.gz
58b5734e9f8a28fdf69102c293aca02504eaa13774ecf9c36f06e842d531d6e2  guix-build-54b4ab66e2f9/output/x86_64-linux-gnu/SHA256SUMS.part
7518e11c9031da5c8bca8e52a8a887f0561dbefd7812b25f729d68ddaf67ad19  guix-build-54b4ab66e2f9/output/x86_64-linux-gnu/bitcoin-54b4ab66e2f9-x86_64-linux-gnu-debug.tar.gz
df039c583480046ee969604511b128093a4f3267a076f5386c1a2c26ab27fa73  guix-build-54b4ab66e2f9/output/x86_64-linux-gnu/bitcoin-54b4ab66e2f9-x86_64-linux-gnu.tar.gz

@hebasto
Copy link
Owner Author

hebasto commented Jan 9, 2024

Guix build on x86_64:

9c6e2c3493f546f683f0dce6f139a67e5b46e746aa7347f9eb6112eef3180287  guix-build-54b4ab66e2f9/output/aarch64-linux-gnu/SHA256SUMS.part
93f1d78f882e9fb1f7b6792d7d05f6730ebaccb2be780b9a80a262e14172f4b2  guix-build-54b4ab66e2f9/output/aarch64-linux-gnu/bitcoin-54b4ab66e2f9-aarch64-linux-gnu-debug.tar.gz
c9675c78e33c2773ff7ade28001a73f54e1b459d0f6de9685ce8e417b801677d  guix-build-54b4ab66e2f9/output/aarch64-linux-gnu/bitcoin-54b4ab66e2f9-aarch64-linux-gnu.tar.gz
c05e90d3163223f31133dc02339b7218cd19c7916d6977b908e6c8840f058408  guix-build-54b4ab66e2f9/output/arm-linux-gnueabihf/SHA256SUMS.part
988c7ffb3cf77fb7e2329c9474cfb211f183db1a958e89567b503d7376c25d0c  guix-build-54b4ab66e2f9/output/arm-linux-gnueabihf/bitcoin-54b4ab66e2f9-arm-linux-gnueabihf-debug.tar.gz
1bcbcc4154808d55588981c793795ea6389750e90efcae0684d4bf469e86749b  guix-build-54b4ab66e2f9/output/arm-linux-gnueabihf/bitcoin-54b4ab66e2f9-arm-linux-gnueabihf.tar.gz
47ac728a81c5f4e26a10ab2cc362eceac0398a3fad4a0fa295fb505ed82814b6  guix-build-54b4ab66e2f9/output/dist-archive/bitcoin-54b4ab66e2f9.tar.gz
a3bc2e70852b8a95b8334fa71e2fa4590a331dbed7a00d00fc5303a1e1c061fe  guix-build-54b4ab66e2f9/output/powerpc64-linux-gnu/SHA256SUMS.part
1c0dd0f27fc600edcf8ff3a8884ae3a81616c0ea31466e0284c2b9753f2e5090  guix-build-54b4ab66e2f9/output/powerpc64-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64-linux-gnu-debug.tar.gz
0eb731e7aec88fc65814e2c49314941cd6a1e75aaa05ea0cf4b22158762ab6bc  guix-build-54b4ab66e2f9/output/powerpc64-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64-linux-gnu.tar.gz
d46de7c6c333d5c1feb206171b2dd049ee0b48daeacbef75ef75033b488f8595  guix-build-54b4ab66e2f9/output/powerpc64le-linux-gnu/SHA256SUMS.part
be193c8d672c6000c3b798df6d75408a91dcbb5ec982f74495954970fce67e29  guix-build-54b4ab66e2f9/output/powerpc64le-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64le-linux-gnu-debug.tar.gz
1fbb475ef5088810d49dd2bed13e32deb52d2dc019c2fbe35ee26c3c92b3b507  guix-build-54b4ab66e2f9/output/powerpc64le-linux-gnu/bitcoin-54b4ab66e2f9-powerpc64le-linux-gnu.tar.gz
e722583e7a44540fe8d815044c957ae4a1fc702c2085c6cdf396c1b4547c615a  guix-build-54b4ab66e2f9/output/riscv64-linux-gnu/SHA256SUMS.part
9d5e6ec589a2c3e06793156dc807c49c47fdb75b945ba0b76a24d24d4ac5a880  guix-build-54b4ab66e2f9/output/riscv64-linux-gnu/bitcoin-54b4ab66e2f9-riscv64-linux-gnu-debug.tar.gz
3001824dea87f57e74b88233e611e7e8c66df1808e01cdcfa7f397fdc9cbd63c  guix-build-54b4ab66e2f9/output/riscv64-linux-gnu/bitcoin-54b4ab66e2f9-riscv64-linux-gnu.tar.gz
58b5734e9f8a28fdf69102c293aca02504eaa13774ecf9c36f06e842d531d6e2  guix-build-54b4ab66e2f9/output/x86_64-linux-gnu/SHA256SUMS.part
7518e11c9031da5c8bca8e52a8a887f0561dbefd7812b25f729d68ddaf67ad19  guix-build-54b4ab66e2f9/output/x86_64-linux-gnu/bitcoin-54b4ab66e2f9-x86_64-linux-gnu-debug.tar.gz
df039c583480046ee969604511b128093a4f3267a076f5386c1a2c26ab27fa73  guix-build-54b4ab66e2f9/output/x86_64-linux-gnu/bitcoin-54b4ab66e2f9-x86_64-linux-gnu.tar.gz

$ ./bitcoin-54b4ab66e2f9/bin/bitcoind --version
Bitcoin Core version v26.99.0-g54b4ab66e2f932a83004d303c2dfe0e8fa5d5502
Copyright (C) 2009-2023 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>

Copy link

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

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

lgtm ACK 54b4ab6

@hebasto
Copy link
Owner Author

hebasto commented Jan 16, 2024

@TheCharlatan

lgtm ACK 54b4ab6

Sorry, but this branch had to be rebased on top of the #76.

@hebasto
Copy link
Owner Author

hebasto commented Jan 16, 2024

My Guix build:

x86_64
b7f83c48c48a4b188d2b41a1132ddf4a3fece94d15bcc47a8a57a334bf30eec1  guix-build-32430574f545/output/aarch64-linux-gnu/SHA256SUMS.part
0843be377d4ce37d93a03f7bc6d5036aeb217ec75359d3f226de077a1f2a0db7  guix-build-32430574f545/output/aarch64-linux-gnu/bitcoin-32430574f545-aarch64-linux-gnu-debug.tar.gz
4b7918985f27bb1d23e576ab8fb96f5a411fbaf7395f15d8c6a195bf25a553db  guix-build-32430574f545/output/aarch64-linux-gnu/bitcoin-32430574f545-aarch64-linux-gnu.tar.gz
9e83e491607ed50ab825061f2aaf4e90d6f0262e70c0533c912e7cb9f4fac45c  guix-build-32430574f545/output/arm-linux-gnueabihf/SHA256SUMS.part
4ddad60937a225d35725a2c977f738ef159d40b0e1d1a9945fbe53cffab8cb8a  guix-build-32430574f545/output/arm-linux-gnueabihf/bitcoin-32430574f545-arm-linux-gnueabihf-debug.tar.gz
a45cd9877428b6de608945d7987000151029cf28ac5846fd971bec4b44b0666d  guix-build-32430574f545/output/arm-linux-gnueabihf/bitcoin-32430574f545-arm-linux-gnueabihf.tar.gz
9913cc456167343863d2e7b8f065c8304d52d97c004da691569020d15cdd889a  guix-build-32430574f545/output/dist-archive/bitcoin-32430574f545.tar.gz
aae863f6187ecc5f5eb2774b368f80f0a15c81cc133154e71fe802571dcab506  guix-build-32430574f545/output/powerpc64-linux-gnu/SHA256SUMS.part
d7e5ca61623adf615473fa76522bab94c9e76b14e4b74eaf658bc77a11a89d01  guix-build-32430574f545/output/powerpc64-linux-gnu/bitcoin-32430574f545-powerpc64-linux-gnu-debug.tar.gz
f1d5bb014e268ecf94657e16c9f087d45c9ec02771487804835eaa57a6794d39  guix-build-32430574f545/output/powerpc64-linux-gnu/bitcoin-32430574f545-powerpc64-linux-gnu.tar.gz
65a88178b111f1dbefc4b6a42f8249aae8102a46b1e663f68e87ffebde37e5e8  guix-build-32430574f545/output/powerpc64le-linux-gnu/SHA256SUMS.part
c8027ded8fb4c4b013d29279c28de342233fd9d3810bbef06a0a51458496bd1e  guix-build-32430574f545/output/powerpc64le-linux-gnu/bitcoin-32430574f545-powerpc64le-linux-gnu-debug.tar.gz
9fe55359bb1f65608a2442fa449785933842da70fd0fb4cd827f35f2e499ccde  guix-build-32430574f545/output/powerpc64le-linux-gnu/bitcoin-32430574f545-powerpc64le-linux-gnu.tar.gz
272d0fba46c3afedc8d0abc3e4f4a0581246f3672aee0582d3b695f3ae0d0bbf  guix-build-32430574f545/output/riscv64-linux-gnu/SHA256SUMS.part
17edda3d94c0b1ab6c4742f6dce8c05dddccd83421e42f56f2fa24d3c080614d  guix-build-32430574f545/output/riscv64-linux-gnu/bitcoin-32430574f545-riscv64-linux-gnu-debug.tar.gz
ff619bc302366de71ba88419034b2e4e254bf9c72931a465c52e89f926a4e326  guix-build-32430574f545/output/riscv64-linux-gnu/bitcoin-32430574f545-riscv64-linux-gnu.tar.gz
aab638f2941776cea49a2989ab7d5c32701a91a37b190c7f7f77d649c52b8b6c  guix-build-32430574f545/output/x86_64-linux-gnu/SHA256SUMS.part
2af961cf1ec697ae48d73abc7781cf0b406e81cba77767e4a40b2b4de2e4e1b9  guix-build-32430574f545/output/x86_64-linux-gnu/bitcoin-32430574f545-x86_64-linux-gnu-debug.tar.gz
5a2fe90e2fdf37bd615db12c52d306a0387f6ce9ec6aedfc81a72e1812bc3c32  guix-build-32430574f545/output/x86_64-linux-gnu/bitcoin-32430574f545-x86_64-linux-gnu.tar.gz

@TheCharlatan
Copy link

Mine match @hebasto's

Re-ACK

@hebasto hebasto merged commit 6efdee1 into cmake-staging Jan 16, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants