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: Enable C language in the root CMakeLists.txt #252

Merged
merged 6 commits into from
Jul 12, 2024

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Jul 1, 2024

#192 introduced a regression in the Guix build. For instance, env HOSTS=x86_64-w64-mingw32 ./contrib/guix/guix-build for 1eb1250.

The C language must be enabled before any reference to CMAKE_C_* variables and in the scope of those references (in case of non-cache variables). However, this is not the case on the staging branch at present for the following references:

bitcoin/CMakeLists.txt

Lines 573 to 575 in 1eb1250

if(DEFINED ENV{CFLAGS})
deduplicate_flags(CMAKE_C_FLAGS)
endif()
and
list(JOIN CMAKE_C_COMPILER_LAUNCHER " " c_compiler_command)
string(STRIP "${c_compiler_command} ${CMAKE_C_COMPILER}" c_compiler_command)
string(STRIP "${c_compiler_command} ${CMAKE_C_COMPILER_ARG1}" c_compiler_command)
add_custom_target(test-security-check
COMMAND ${CMAKE_COMMAND} -E env CC=${c_compiler_command} CFLAGS=${CMAKE_C_FLAGS} LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${PYTHON_COMMAND} ${CMAKE_SOURCE_DIR}/contrib/devtools/test-security-check.py TestSecurityChecks.test_${exe_format}
COMMAND ${CMAKE_COMMAND} -E env CC=${c_compiler_command} CFLAGS=${CMAKE_C_FLAGS} LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${PYTHON_COMMAND} ${CMAKE_SOURCE_DIR}/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_${exe_format}
VERBATIM
)

This PR fixes this issue by moving the enable_language(C) to the top of the root listfile.

@hebasto
Copy link
Owner Author

hebasto commented Jul 1, 2024

Friendly ping @TheCharlatan @fanquake @theuni @m3dwards :)

@fanquake
Copy link

fanquake commented Jul 1, 2024

#192 introduced a regression in the Guix build.

Can you elaborate? Why does this failure only happen for Windows?

I ran a Guix build with (1eb1250) and HOSTS="x86_64-linux-gnu" ./contrib/guix/guix-build, and everything passed:

[100%] Built target test_bitcoin
.
----------------------------------------------------------------------
Ran 1 test in 1.220s

OK
.
----------------------------------------------------------------------
Ran 1 test in 0.332s

OK
Built target test-security-check
Checking binary security...
Built target check-security
Running symbol and dynamic library checks...
Built target check-symbols
-- Install configuration: "RelWithDebInfo"
-- Installing: /distsrc-base/distsrc-1eb125095fc5-x86_64-linux-gnu/installed/bitcoin-1eb125095fc5/bin/bitcoin-qt
<snip>

real	15m31.308s
user	102m46.498s
sys	10m35.277s

@hebasto hebasto added the bug Something isn't working label Jul 1, 2024
@hebasto hebasto added this to the Ready for master milestone Jul 1, 2024
@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

#192 introduced a regression in the Guix build.

Can you elaborate? Why does this failure only happen for Windows?

I ran a Guix build with (1eb1250) and HOSTS="x86_64-linux-gnu" ./contrib/guix/guix-build, and everything passed:

The contrib/devtools/test-security-check.py script expects the CC, CFLAGS and LDFLAGS environment variables to be set. However, this is not the case on the staging branch at present. While builds for most platforms tolerate this, the build for Windows does not.

Specifically, the absence of the -O2 flag, which is set in

# CFLAGS
HOST_CFLAGS="-O2 -g"
causes the failure.

@fanquake
Copy link

fanquake commented Jul 2, 2024

While builds for most platforms tolerate this,

I wouldn't have thought there'd be a per-platform difference for something this fundamental? If there's no C compiler available, how is the Ubuntu build even passing? Or, why does it have the environment variables set, if enable_language(C) is missing?

@m3dwards
Copy link

m3dwards commented Jul 2, 2024

I got a matching Guix build
fd8dbd83a5a607cd82208a5e78239c3ef7b89958cc01a66bf06c527ddc5052ea  guix-build-c308f9e61481/output/aarch64-linux-gnu/SHA256SUMS.part
6c7ad8c8b0ea189bddcdd8df3e808df03d78b24da9d46bbff1739eb501dca97e  guix-build-c308f9e61481/output/aarch64-linux-gnu/bitcoin-c308f9e61481-aarch64-linux-gnu-debug.tar.gz
2cea1d5bc88a8b70f96e1492eb92cb15a4125d323c964b7d7ad980e249928d17  guix-build-c308f9e61481/output/aarch64-linux-gnu/bitcoin-c308f9e61481-aarch64-linux-gnu.tar.gz
fcf1cd3e0d34692ced71b55d51b7eda4f205908e6148234579e277c2e91b821f  guix-build-c308f9e61481/output/arm-linux-gnueabihf/SHA256SUMS.part
6e0a355d5a1709cd40e8b4cacd7879076b17e497ad1bd53e8feb6977d48cfd2f  guix-build-c308f9e61481/output/arm-linux-gnueabihf/bitcoin-c308f9e61481-arm-linux-gnueabihf-debug.tar.gz
c659b5255802d85da172a9a1aeab2a0e9d51abf1d43b50920c6d0503871636f3  guix-build-c308f9e61481/output/arm-linux-gnueabihf/bitcoin-c308f9e61481-arm-linux-gnueabihf.tar.gz
4bc69b057e082dbea65f58250c60e4409b19789a74e3fe2b68713d69cfd0fa1c  guix-build-c308f9e61481/output/arm64-apple-darwin/SHA256SUMS.part
f6295d163cc9ea9bb26144d07873e69ecf01fd5e5734c01cb953bab18d27a9e3  guix-build-c308f9e61481/output/arm64-apple-darwin/bitcoin-c308f9e61481-arm64-apple-darwin-unsigned.tar.gz
724d66cd93358d0ba6b5db10c3191fe20eec1354166fa4b10d4c644127cc158b  guix-build-c308f9e61481/output/arm64-apple-darwin/bitcoin-c308f9e61481-arm64-apple-darwin-unsigned.zip
39b5abcb80df4111aba202cca0040deb65b0b1ca885c0797ba484727c807f13b  guix-build-c308f9e61481/output/arm64-apple-darwin/bitcoin-c308f9e61481-arm64-apple-darwin.tar.gz
c73d17ff87b198be00c90f1c5ac567223dba96ab7070656c5a179587e91548b2  guix-build-c308f9e61481/output/dist-archive/bitcoin-c308f9e61481.tar.gz
c044648712c5407a624f514574f3d1f9b8ef905015f73051d06cade4c831adfc  guix-build-c308f9e61481/output/powerpc64-linux-gnu/SHA256SUMS.part
9eb799b8052c2b260d30353a5f8b5c07bb7b0177ff14b924376da7b4f4bdb8bc  guix-build-c308f9e61481/output/powerpc64-linux-gnu/bitcoin-c308f9e61481-powerpc64-linux-gnu-debug.tar.gz
b49d55fa4f3ad9997cc11157cdba0b6887eb970b01b20b52440cf4d79b9a51e2  guix-build-c308f9e61481/output/powerpc64-linux-gnu/bitcoin-c308f9e61481-powerpc64-linux-gnu.tar.gz
3f8195fdcbc38521491f061d054ad096af7ba9bd89935df54b7a69524174d963  guix-build-c308f9e61481/output/riscv64-linux-gnu/SHA256SUMS.part
b7f6cfb5a9c3344cb4652e51095205dbd3d740a4b16e664a5139867bd820471f  guix-build-c308f9e61481/output/riscv64-linux-gnu/bitcoin-c308f9e61481-riscv64-linux-gnu-debug.tar.gz
9b8f1a219e08707ed4821a2a6a6700285f6c8a192a5e3e9439fe86cf616fdff3  guix-build-c308f9e61481/output/riscv64-linux-gnu/bitcoin-c308f9e61481-riscv64-linux-gnu.tar.gz
1761f000eb5e12212682a1da0d339ce2671b34c9a7d95347895a60398bab52e2  guix-build-c308f9e61481/output/x86_64-apple-darwin/SHA256SUMS.part
7306ec047eda82633e2215f2f41de60e05f3181caf22179576b8af7fb31f9d72  guix-build-c308f9e61481/output/x86_64-apple-darwin/bitcoin-c308f9e61481-x86_64-apple-darwin-unsigned.tar.gz
00321d228422e195cdb2e092bd12f90ffd3e9c869ad722353f1e5bbd461854c2  guix-build-c308f9e61481/output/x86_64-apple-darwin/bitcoin-c308f9e61481-x86_64-apple-darwin-unsigned.zip
07777414747a5aaf452616b844b90619c0c17fb455e82a8b569111526e6b720f  guix-build-c308f9e61481/output/x86_64-apple-darwin/bitcoin-c308f9e61481-x86_64-apple-darwin.tar.gz
af16f95222be8f4824459496af540fe7ef13e9ae091361db294f5f1629a95005  guix-build-c308f9e61481/output/x86_64-linux-gnu/SHA256SUMS.part
a44cb9c7c69d2c33fd018b242332f78bd68e2452868b2c04670d538a406eda22  guix-build-c308f9e61481/output/x86_64-linux-gnu/bitcoin-c308f9e61481-x86_64-linux-gnu-debug.tar.gz
9a48a76a1858e894b004b358f165073a56a189084bd746d736be50ff2882df35  guix-build-c308f9e61481/output/x86_64-linux-gnu/bitcoin-c308f9e61481-x86_64-linux-gnu.tar.gz
b49ad9a9e344f9523b55e2b430b9997abf570c56cc74ad9941da05adeb69399c  guix-build-c308f9e61481/output/x86_64-w64-mingw32/SHA256SUMS.part
14914af94c002eb5d9f4af4a52838d30cc4147f3b687806e54d650c2832cfa2f  guix-build-c308f9e61481/output/x86_64-w64-mingw32/bitcoin-c308f9e61481-win64-debug.zip
0db984aa6c17a802941d62f231f9a4271fd8105073aa8cfe64cc56f4b5b9afd8  guix-build-c308f9e61481/output/x86_64-w64-mingw32/bitcoin-c308f9e61481-win64-setup-unsigned.exe
eec17a72cc1bb3cb74cade5dffbab5838b1d4d498a0106c95215899fac204392  guix-build-c308f9e61481/output/x86_64-w64-mingw32/bitcoin-c308f9e61481-win64-unsigned.tar.gz
3480d5c0b2a8a077a1a3598a8b7a18e5abf978ac05ea1ab386783637bcfbecfa  guix-build-c308f9e61481/output/x86_64-w64-mingw32/bitcoin-c308f9e61481-win64.zip

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

If there's no C compiler available, how is the Ubuntu build even passing?

C compiler itself is available. At the point of creating the test-security-check target, the CMAKE_C_FLAGS variable is not defined because it is scoped in the secp256k1 subtree.

Or, why does it have the environment variables set, if enable_language(C) is missing?

I don't understand this question. The enable_language() command has nothing to do with environment variables directly; it sets only CMake's variables.

@fanquake
Copy link

fanquake commented Jul 2, 2024

script expects the CC, CFLAGS and LDFLAGS environment variables to be set. However, this is not the case on the staging branch at present.

The enable_language() command has nothing to do with environment variables directly; it sets only CMake's variables.

You're claiming that the issue is that the env vars are not set, and the solution you've presented is enable_language. How are the two not related.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

script expects the CC, CFLAGS and LDFLAGS environment variables to be set. However, this is not the case on the staging branch at present.

The enable_language() command has nothing to do with environment variables directly; it sets only CMake's variables.

You're claiming that the issue is that the env vars are not set, and the solution you've presented is enable_language. How are the two not related.

Let's consider the code of the test-security-check target:

add_custom_target(test-security-check
COMMAND ${CMAKE_COMMAND} -E env CC=${c_compiler_command} CFLAGS=${CMAKE_C_FLAGS} LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${PYTHON_COMMAND} ${CMAKE_SOURCE_DIR}/contrib/devtools/test-security-check.py TestSecurityChecks.test_${exe_format}
COMMAND ${CMAKE_COMMAND} -E env CC=${c_compiler_command} CFLAGS=${CMAKE_C_FLAGS} LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${PYTHON_COMMAND} ${CMAKE_SOURCE_DIR}/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_${exe_format}
VERBATIM
)

It is easy to see that the CFLAGS environment variable is defined to a value of the CMAKE_C_FLAGS variable.

@fanquake
Copy link

fanquake commented Jul 2, 2024

It is easy to see that

Nothing here is easy to see. The explanations are unclear and vauge. The pull request description doesn't mention any of this. It's still also unclear why any other builds would be working, given what you're describing.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

It is easy to see that

Nothing here is easy to see.

That was a figure of speech. I'm sorry if it was offensive. I did not mean it.

The explanations are unclear and vauge. The pull request description doesn't mention any of this.

The comment in the patch contains the explanation. If it sounds vague, I'll be happy to except a better suggestion from anyone.

It's still also unclear why any other builds would be working, given what you're describing.

Why not? What flag in HOST_CFLAGS for Linux is critical for test-security-check.py to pass?

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

One of the possible ways to verify this PR is to check the value of the CFLAGS variable available for the test-security-check.py script:

  • in the master branch
  • in the staging branch
  • in this PR branch (matches the master branch)

@fanquake
Copy link

fanquake commented Jul 2, 2024

Why not?

Why is ${c_compiler_command} (which from what I can tell is built from CMAKE_C_COMPILER_LAUNCHER, CMAKE_C_COMPILER, CMAKE_C_COMPILER_ARG1 etc) available if the C language hasn't been setup?

Specifically, the absence of the -O2 flag, which is set in

This is also unclear. Why does the Windows build fail with no -O2?

The comment in the patch contains the explanation.

The comment claims We enable C here to make all related details and flags available in this scope because the test-security-check.py and test-symbol-check.py scripts rely on them., but, obviously that isn't even true, because the checks for some platforms currently pass fine without it.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

The comment in the patch contains the explanation.

The comment claims We enable C here to make all related details and flags available in this scope because the test-security-check.py and test-symbol-check.py scripts rely on them., but, obviously that isn't even true, because the checks for some platforms currently pass fine without it.

Passing checks does not prove that the comment is not true. It is true for the following reasons:

  1. C-related flags are indeed available in that scope due to the scope behavior of variables in the CMake language.
  2. Both scripts indeed rely on C flags because their invocation includes setting the CFLAGS environment variable.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

Specifically, the absence of the -O2 flag, which is set in

This is also unclear. Why does the Windows build fail with no -O2?

Because of the following error from the Python code:

Traceback (most recent call last):
  File "/distsrc-base/distsrc-917632309725-x86_64-w64-mingw32/contrib/devtools/security-check.py", line 269, in <module>
    if not func(binary):
  File "/distsrc-base/distsrc-917632309725-x86_64-w64-mingw32/contrib/devtools/security-check.py", line 139, in check_PE_control_flow
    section_addr = binary.section_from_rva(main).virtual_address
AttributeError: 'NoneType' object has no attribute 'virtual_address'

And I have no intention to debug it at this moment.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

Why not?

Why is ${c_compiler_command} (which from what I can tell is built from CMAKE_C_COMPILER_LAUNCHER, CMAKE_C_COMPILER, CMAKE_C_COMPILER_ARG1 etc) available if the C language hasn't been setup?

The CMAKE_C_COMPILER is a cache variable. Therefore, its scope is not limited to the secp256k1 subtree.

UPD. C language is setup in the secp256k1 subtree.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

Removed redundant enable_language(C) call in the src subdirectory.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

The pull request description doesn't mention any of this.

The PR description has been updated.

@hebasto
Copy link
Owner Author

hebasto commented Jul 2, 2024

My Guix build:

x86_64
0e77ca8b8331ab360640b252854449fe60dd340350b3a8b123bb63ed658f6e06  guix-build-6f66eeafe504/output/aarch64-linux-gnu/SHA256SUMS.part
26b45ea8a71f462f0fb9262c562b8173ac977f919ede89adbeae8ecf7f189afc  guix-build-6f66eeafe504/output/aarch64-linux-gnu/bitcoin-6f66eeafe504-aarch64-linux-gnu-debug.tar.gz
98a7fbf72760060e509d7430fb8bd17487d03f948dd975043158cba1518f7015  guix-build-6f66eeafe504/output/aarch64-linux-gnu/bitcoin-6f66eeafe504-aarch64-linux-gnu.tar.gz
82b7102d664804513d62396c0147cee2ff8d312131999cfd73ee4a553a7c2abd  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/SHA256SUMS.part
13648bc66372dff1d804d3d1c787e8c6e2a8bbd01f44e51f3192878e9fd98855  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/bitcoin-6f66eeafe504-arm-linux-gnueabihf-debug.tar.gz
09b7728d8437ae1c1235ec2464276d49f98daf4a6720daa5e0911a17cf5a534c  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/bitcoin-6f66eeafe504-arm-linux-gnueabihf.tar.gz
ab06531a8a8371d8d01d9565c641132479ed9f2b3a67f0e7b1616d5429bfe286  guix-build-6f66eeafe504/output/arm64-apple-darwin/SHA256SUMS.part
8345d661244d0cbc0a8979f18cf72e2fd997def74aac6568d3993f4bcf0280ac  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin-unsigned.tar.gz
c9a4db68701513fc8333099d8ee4fecb5fb5a348b5b48cc714cb75db71f633a4  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin-unsigned.zip
070631ab99109fc08bb87e412e8867e83033f7876c4d54cd9a1b51747ee1466d  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin.tar.gz
011dffbc01e25874ea99e206d9f36f828c0f320f226b644607b49a5db41aeef3  guix-build-6f66eeafe504/output/dist-archive/bitcoin-6f66eeafe504.tar.gz
ae771d09b11cc308b15d9cc8760d978f2e74e16d5b428469489c76d833cf6ab4  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/SHA256SUMS.part
4f855f0a35a5f5ec54d91d626d73230c84e5b92f5a306c120cc9dfa414b39324  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/bitcoin-6f66eeafe504-powerpc64-linux-gnu-debug.tar.gz
28264209bd7589167340dbcf05423aa88e873e080067ab42539dc89909e00c22  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/bitcoin-6f66eeafe504-powerpc64-linux-gnu.tar.gz
acd5f0d7e6ec3bb2541f0aa33d5a433e0eba1b2c5f28d257bea98be754ced26e  guix-build-6f66eeafe504/output/riscv64-linux-gnu/SHA256SUMS.part
a9eaf344e1fcf52d29cdb02ff0bef5c5f40d28ad9ae88f03136e4f37ffbac8a6  guix-build-6f66eeafe504/output/riscv64-linux-gnu/bitcoin-6f66eeafe504-riscv64-linux-gnu-debug.tar.gz
eefcaef8d0f0bb9bb9b76bbbf50d8b62db30255eca24f84f22c4b882f531e361  guix-build-6f66eeafe504/output/riscv64-linux-gnu/bitcoin-6f66eeafe504-riscv64-linux-gnu.tar.gz
625279fff306fb6b1667b6fed45f14e462894b62cdc5d5bc564b830a6a60d3a0  guix-build-6f66eeafe504/output/x86_64-apple-darwin/SHA256SUMS.part
993d3e39a634a822b58f60d2bf950f8123ff6f28153131ecdf777a442941622a  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin-unsigned.tar.gz
70eb392a731c0c4eb3905142a87f8326e2af5178289077d42be1f10c7bbab5bb  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin-unsigned.zip
a4d67fd1c607397883633b9bf1252a44bf0b8613126cb07e9a17c6dc87a18f6d  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin.tar.gz
47eff73fdb6ef6a6aa4d5940bff8d2a15f6f1483f1877121b22f1ebffe07cc24  guix-build-6f66eeafe504/output/x86_64-linux-gnu/SHA256SUMS.part
7dc914e7cdbaad4ce854f76769136720a80158415290fbe01ba584fe54ebe41a  guix-build-6f66eeafe504/output/x86_64-linux-gnu/bitcoin-6f66eeafe504-x86_64-linux-gnu-debug.tar.gz
0c1916927d221d3cd2b9048bc5c61e758536f3ee6dc8e72b3c037b232999b34c  guix-build-6f66eeafe504/output/x86_64-linux-gnu/bitcoin-6f66eeafe504-x86_64-linux-gnu.tar.gz
ef5891e01baa11f8afd58f9da14f4df108dd970c117334b03036af6d0c515c80  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/SHA256SUMS.part
667a9fb1fc59f2e43d29a336a6b46620f232cf6288c8382f4cb676e4497c25be  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-debug.zip
b8bf09bea0979db5ed028dd4784d5d506e9c7f29c435cd97489fe2b37ad91ef2  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-setup-unsigned.exe
a74efdf94095a05a3d0d09169b2a8e3ef916637895d53001cd0043ac5d00f898  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-unsigned.tar.gz
48edb2064b2c7a4bb80a7b17f71440b4b2fe96da48adb70aadcd71fceb311bf2  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64.zip

@TheCharlatan
Copy link

Guix builds (aarch64):

0e77ca8b8331ab360640b252854449fe60dd340350b3a8b123bb63ed658f6e06  guix-build-6f66eeafe504/output/aarch64-linux-gnu/SHA256SUMS.part
26b45ea8a71f462f0fb9262c562b8173ac977f919ede89adbeae8ecf7f189afc  guix-build-6f66eeafe504/output/aarch64-linux-gnu/bitcoin-6f66eeafe504-aarch64-linux-gnu-debug.tar.gz
98a7fbf72760060e509d7430fb8bd17487d03f948dd975043158cba1518f7015  guix-build-6f66eeafe504/output/aarch64-linux-gnu/bitcoin-6f66eeafe504-aarch64-linux-gnu.tar.gz
82b7102d664804513d62396c0147cee2ff8d312131999cfd73ee4a553a7c2abd  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/SHA256SUMS.part
13648bc66372dff1d804d3d1c787e8c6e2a8bbd01f44e51f3192878e9fd98855  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/bitcoin-6f66eeafe504-arm-linux-gnueabihf-debug.tar.gz
09b7728d8437ae1c1235ec2464276d49f98daf4a6720daa5e0911a17cf5a534c  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/bitcoin-6f66eeafe504-arm-linux-gnueabihf.tar.gz
ab06531a8a8371d8d01d9565c641132479ed9f2b3a67f0e7b1616d5429bfe286  guix-build-6f66eeafe504/output/arm64-apple-darwin/SHA256SUMS.part
8345d661244d0cbc0a8979f18cf72e2fd997def74aac6568d3993f4bcf0280ac  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin-unsigned.tar.gz
c9a4db68701513fc8333099d8ee4fecb5fb5a348b5b48cc714cb75db71f633a4  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin-unsigned.zip
070631ab99109fc08bb87e412e8867e83033f7876c4d54cd9a1b51747ee1466d  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin.tar.gz
011dffbc01e25874ea99e206d9f36f828c0f320f226b644607b49a5db41aeef3  guix-build-6f66eeafe504/output/dist-archive/bitcoin-6f66eeafe504.tar.gz
ae771d09b11cc308b15d9cc8760d978f2e74e16d5b428469489c76d833cf6ab4  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/SHA256SUMS.part
4f855f0a35a5f5ec54d91d626d73230c84e5b92f5a306c120cc9dfa414b39324  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/bitcoin-6f66eeafe504-powerpc64-linux-gnu-debug.tar.gz
28264209bd7589167340dbcf05423aa88e873e080067ab42539dc89909e00c22  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/bitcoin-6f66eeafe504-powerpc64-linux-gnu.tar.gz
acd5f0d7e6ec3bb2541f0aa33d5a433e0eba1b2c5f28d257bea98be754ced26e  guix-build-6f66eeafe504/output/riscv64-linux-gnu/SHA256SUMS.part
a9eaf344e1fcf52d29cdb02ff0bef5c5f40d28ad9ae88f03136e4f37ffbac8a6  guix-build-6f66eeafe504/output/riscv64-linux-gnu/bitcoin-6f66eeafe504-riscv64-linux-gnu-debug.tar.gz
eefcaef8d0f0bb9bb9b76bbbf50d8b62db30255eca24f84f22c4b882f531e361  guix-build-6f66eeafe504/output/riscv64-linux-gnu/bitcoin-6f66eeafe504-riscv64-linux-gnu.tar.gz
625279fff306fb6b1667b6fed45f14e462894b62cdc5d5bc564b830a6a60d3a0  guix-build-6f66eeafe504/output/x86_64-apple-darwin/SHA256SUMS.part
993d3e39a634a822b58f60d2bf950f8123ff6f28153131ecdf777a442941622a  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin-unsigned.tar.gz
70eb392a731c0c4eb3905142a87f8326e2af5178289077d42be1f10c7bbab5bb  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin-unsigned.zip
a4d67fd1c607397883633b9bf1252a44bf0b8613126cb07e9a17c6dc87a18f6d  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin.tar.gz
47eff73fdb6ef6a6aa4d5940bff8d2a15f6f1483f1877121b22f1ebffe07cc24  guix-build-6f66eeafe504/output/x86_64-linux-gnu/SHA256SUMS.part
7dc914e7cdbaad4ce854f76769136720a80158415290fbe01ba584fe54ebe41a  guix-build-6f66eeafe504/output/x86_64-linux-gnu/bitcoin-6f66eeafe504-x86_64-linux-gnu-debug.tar.gz
0c1916927d221d3cd2b9048bc5c61e758536f3ee6dc8e72b3c037b232999b34c  guix-build-6f66eeafe504/output/x86_64-linux-gnu/bitcoin-6f66eeafe504-x86_64-linux-gnu.tar.gz
ef5891e01baa11f8afd58f9da14f4df108dd970c117334b03036af6d0c515c80  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/SHA256SUMS.part
667a9fb1fc59f2e43d29a336a6b46620f232cf6288c8382f4cb676e4497c25be  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-debug.zip
b8bf09bea0979db5ed028dd4784d5d506e9c7f29c435cd97489fe2b37ad91ef2  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-setup-unsigned.exe
a74efdf94095a05a3d0d09169b2a8e3ef916637895d53001cd0043ac5d00f898  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-unsigned.tar.gz
48edb2064b2c7a4bb80a7b17f71440b4b2fe96da48adb70aadcd71fceb311bf2  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64.zip

@m3dwards
Copy link

m3dwards commented Jul 3, 2024

Updated Guix build also matches
0e77ca8b8331ab360640b252854449fe60dd340350b3a8b123bb63ed658f6e06  guix-build-6f66eeafe504/output/aarch64-linux-gnu/SHA256SUMS.part
26b45ea8a71f462f0fb9262c562b8173ac977f919ede89adbeae8ecf7f189afc  guix-build-6f66eeafe504/output/aarch64-linux-gnu/bitcoin-6f66eeafe504-aarch64-linux-gnu-debug.tar.gz
98a7fbf72760060e509d7430fb8bd17487d03f948dd975043158cba1518f7015  guix-build-6f66eeafe504/output/aarch64-linux-gnu/bitcoin-6f66eeafe504-aarch64-linux-gnu.tar.gz
82b7102d664804513d62396c0147cee2ff8d312131999cfd73ee4a553a7c2abd  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/SHA256SUMS.part
13648bc66372dff1d804d3d1c787e8c6e2a8bbd01f44e51f3192878e9fd98855  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/bitcoin-6f66eeafe504-arm-linux-gnueabihf-debug.tar.gz
09b7728d8437ae1c1235ec2464276d49f98daf4a6720daa5e0911a17cf5a534c  guix-build-6f66eeafe504/output/arm-linux-gnueabihf/bitcoin-6f66eeafe504-arm-linux-gnueabihf.tar.gz
ab06531a8a8371d8d01d9565c641132479ed9f2b3a67f0e7b1616d5429bfe286  guix-build-6f66eeafe504/output/arm64-apple-darwin/SHA256SUMS.part
8345d661244d0cbc0a8979f18cf72e2fd997def74aac6568d3993f4bcf0280ac  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin-unsigned.tar.gz
c9a4db68701513fc8333099d8ee4fecb5fb5a348b5b48cc714cb75db71f633a4  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin-unsigned.zip
070631ab99109fc08bb87e412e8867e83033f7876c4d54cd9a1b51747ee1466d  guix-build-6f66eeafe504/output/arm64-apple-darwin/bitcoin-6f66eeafe504-arm64-apple-darwin.tar.gz
011dffbc01e25874ea99e206d9f36f828c0f320f226b644607b49a5db41aeef3  guix-build-6f66eeafe504/output/dist-archive/bitcoin-6f66eeafe504.tar.gz
ae771d09b11cc308b15d9cc8760d978f2e74e16d5b428469489c76d833cf6ab4  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/SHA256SUMS.part
4f855f0a35a5f5ec54d91d626d73230c84e5b92f5a306c120cc9dfa414b39324  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/bitcoin-6f66eeafe504-powerpc64-linux-gnu-debug.tar.gz
28264209bd7589167340dbcf05423aa88e873e080067ab42539dc89909e00c22  guix-build-6f66eeafe504/output/powerpc64-linux-gnu/bitcoin-6f66eeafe504-powerpc64-linux-gnu.tar.gz
acd5f0d7e6ec3bb2541f0aa33d5a433e0eba1b2c5f28d257bea98be754ced26e  guix-build-6f66eeafe504/output/riscv64-linux-gnu/SHA256SUMS.part
a9eaf344e1fcf52d29cdb02ff0bef5c5f40d28ad9ae88f03136e4f37ffbac8a6  guix-build-6f66eeafe504/output/riscv64-linux-gnu/bitcoin-6f66eeafe504-riscv64-linux-gnu-debug.tar.gz
eefcaef8d0f0bb9bb9b76bbbf50d8b62db30255eca24f84f22c4b882f531e361  guix-build-6f66eeafe504/output/riscv64-linux-gnu/bitcoin-6f66eeafe504-riscv64-linux-gnu.tar.gz
625279fff306fb6b1667b6fed45f14e462894b62cdc5d5bc564b830a6a60d3a0  guix-build-6f66eeafe504/output/x86_64-apple-darwin/SHA256SUMS.part
993d3e39a634a822b58f60d2bf950f8123ff6f28153131ecdf777a442941622a  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin-unsigned.tar.gz
70eb392a731c0c4eb3905142a87f8326e2af5178289077d42be1f10c7bbab5bb  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin-unsigned.zip
a4d67fd1c607397883633b9bf1252a44bf0b8613126cb07e9a17c6dc87a18f6d  guix-build-6f66eeafe504/output/x86_64-apple-darwin/bitcoin-6f66eeafe504-x86_64-apple-darwin.tar.gz
47eff73fdb6ef6a6aa4d5940bff8d2a15f6f1483f1877121b22f1ebffe07cc24  guix-build-6f66eeafe504/output/x86_64-linux-gnu/SHA256SUMS.part
7dc914e7cdbaad4ce854f76769136720a80158415290fbe01ba584fe54ebe41a  guix-build-6f66eeafe504/output/x86_64-linux-gnu/bitcoin-6f66eeafe504-x86_64-linux-gnu-debug.tar.gz
0c1916927d221d3cd2b9048bc5c61e758536f3ee6dc8e72b3c037b232999b34c  guix-build-6f66eeafe504/output/x86_64-linux-gnu/bitcoin-6f66eeafe504-x86_64-linux-gnu.tar.gz
ef5891e01baa11f8afd58f9da14f4df108dd970c117334b03036af6d0c515c80  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/SHA256SUMS.part
667a9fb1fc59f2e43d29a336a6b46620f232cf6288c8382f4cb676e4497c25be  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-debug.zip
b8bf09bea0979db5ed028dd4784d5d506e9c7f29c435cd97489fe2b37ad91ef2  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-setup-unsigned.exe
a74efdf94095a05a3d0d09169b2a8e3ef916637895d53001cd0043ac5d00f898  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64-unsigned.tar.gz
48edb2064b2c7a4bb80a7b17f71440b4b2fe96da48adb70aadcd71fceb311bf2  guix-build-6f66eeafe504/output/x86_64-w64-mingw32/bitcoin-6f66eeafe504-win64.zip

I can replicate the problem that this PR fixes on staging branch.

ACK 6f66eea

After reading all the comments it looks like we haven't got to the bottom of why this only breaks on x86_64-w64-mingw32 builds but I have given my ACK because this brings cmake inline with current master behaviour of providing -O2 and -g (as well as a bunch of -ffile-prefix-map flags). The build runs contrib/devtools/test-security-check.py and that requires a C compiler so it makes sense that cmake would enable_language for C.

Testing methodology was to first check that it fails on cmake-staging and passes with 6f66eea. Then I compared the flags that contrib/devtools/test-security-check.py received for master, cmake-staging and 6f66eea.

CMakeLists.txt Outdated
@@ -55,6 +55,14 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# We enable C here to make all related details and flags
Copy link

Choose a reason for hiding this comment

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

Sorry, but I just can't parse this comment. It's meaningless to anyone who doesn't know exactly what these python scripts do.

Could you please change this comment to explain what it does rather than why it's required?

Copy link
Owner Author

Choose a reason for hiding this comment

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

How about this one:

# A language must be enabled in the highest directory common to all
# targets that use it directly or indirectly. We use the C language in
# the test-security-check target; therefore, we enable it here.

?

All restrictions applied to the enable_language() call are listed in the CMake docs. One of them:

It must be called in the highest directory common to all targets using the named language directly for compiling sources or indirectly through link dependencies. It is simplest to enable all needed languages in the top-level directory of a project.

Copy link

Choose a reason for hiding this comment

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

I still find this very confusing. At a high level, it makes sense to me to enable C if we're going to use it later. But test-security-check is such an obscure reason that I still find the comment confusing.

In fact, why is that script using C rather than C++ anyway? That seems like the real issue here to me.

Copy link
Owner Author

@hebasto hebasto Jul 3, 2024

Choose a reason for hiding this comment

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

I still find this very confusing. At a high level, it makes sense to me to enable C if we're going to use it later. But test-security-check is such an obscure reason that I still find the comment confusing.

In fact, why is that script using C rather than C++ anyway? That seems like the real issue here to me.

I totally agree with the last paragraph. Initially, I had a patch for that code. But it appeared too invasive; therefore, I decided to do not touch that code during the migration to CMake.

Copy link

Choose a reason for hiding this comment

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

I think it makes sense to go ahead and upstream that.

  1. In those scripts we should be testing the language we're actually using (we may need to add more exceptions for c++ deps/symbols along the way)
  2. We can discuss the C language issue here without this crazy dependency getting in the way

Copy link

Choose a reason for hiding this comment

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

Untested branch here: https://github.com/theuni/bitcoin/commits/cxx-security-check/

Lief is broken for me atm for some reason, so I'm unable to test if that's enough.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@hebasto
Copy link
Owner Author

hebasto commented Jul 3, 2024

Taken @theuni's branch from #252 (comment).

@hebasto hebasto force-pushed the 240701-cmake-GP branch 3 times, most recently from 0ca6305 to c39160a Compare July 3, 2024 22:36
@hebasto
Copy link
Owner Author

hebasto commented Jul 4, 2024

My Guix build:

x86_64
6a283b8a2a9968fa548002f1a0a4a0cce3f201738979c6a0f8362ae5e4bf8261  guix-build-c39160ab1ad5/output/aarch64-linux-gnu/SHA256SUMS.part
bffd6aec7a8dbbc5ab10fe8f06886957335c2728c5ef0659c867b1a0dc92f01f  guix-build-c39160ab1ad5/output/aarch64-linux-gnu/bitcoin-c39160ab1ad5-aarch64-linux-gnu-debug.tar.gz
472a9aa0b491ae5ce012b54dedff035219943468eafd277e2fc9d7dc83345096  guix-build-c39160ab1ad5/output/aarch64-linux-gnu/bitcoin-c39160ab1ad5-aarch64-linux-gnu.tar.gz
072b2f03f1f07d28b358370e83cd679842c74e63e9ccf7aece4f223250a747a9  guix-build-c39160ab1ad5/output/arm-linux-gnueabihf/SHA256SUMS.part
3b334b6d961bb28e251d24726320ce85ea53e7095603ef56a80369e921b17cc0  guix-build-c39160ab1ad5/output/arm-linux-gnueabihf/bitcoin-c39160ab1ad5-arm-linux-gnueabihf-debug.tar.gz
ce95b4812c317e6ab72270debab861702ad838cb9caf9fe84d86b8568d49f6a5  guix-build-c39160ab1ad5/output/arm-linux-gnueabihf/bitcoin-c39160ab1ad5-arm-linux-gnueabihf.tar.gz
375ca0e5ff3b2743ac897636d401119a7a047b9707730d24f3ac1fdeeb042fac  guix-build-c39160ab1ad5/output/arm64-apple-darwin/SHA256SUMS.part
4303065be429dfaddf3e7c29f324d45384d941e45f05a20aac1dc3b0ac48e173  guix-build-c39160ab1ad5/output/arm64-apple-darwin/bitcoin-c39160ab1ad5-arm64-apple-darwin-unsigned.tar.gz
e8d8ab48e93d28e09a64253f7b3aa0d4788027a5d36f983feccb627037e32fb4  guix-build-c39160ab1ad5/output/arm64-apple-darwin/bitcoin-c39160ab1ad5-arm64-apple-darwin-unsigned.zip
aa5460fa34039baf3c49edb16811ddc181d7071fd296f2b9fd6143de966c70bd  guix-build-c39160ab1ad5/output/arm64-apple-darwin/bitcoin-c39160ab1ad5-arm64-apple-darwin.tar.gz
d91a3bc8d5387a0f353f7787ad659f061a319c8c17ac1fbfd8249bfd3f2a1a24  guix-build-c39160ab1ad5/output/dist-archive/bitcoin-c39160ab1ad5.tar.gz
853f4b41a13ea8c0e625965e2e060183ab25c86b3ed7739269f3805cf63b75cb  guix-build-c39160ab1ad5/output/powerpc64-linux-gnu/SHA256SUMS.part
5a7907438b73e71bae9b2508f0a26e47de3fd0b062384a28e59d403ccef22dcb  guix-build-c39160ab1ad5/output/powerpc64-linux-gnu/bitcoin-c39160ab1ad5-powerpc64-linux-gnu-debug.tar.gz
75311c72e4b8edb48dd0450cb36560f36c1d4b96e0d780e47042fea15389b1a6  guix-build-c39160ab1ad5/output/powerpc64-linux-gnu/bitcoin-c39160ab1ad5-powerpc64-linux-gnu.tar.gz
7f067ee01a6bc41c451f2316b2dd9dc644254680155fb9a9df1b4a959731dab6  guix-build-c39160ab1ad5/output/riscv64-linux-gnu/SHA256SUMS.part
52ddface10f1b9b9326e11e1438fcba41d83dd28d71ca528fa1461b2b4e53411  guix-build-c39160ab1ad5/output/riscv64-linux-gnu/bitcoin-c39160ab1ad5-riscv64-linux-gnu-debug.tar.gz
c11c12afdc1172461f5a5413aaeffe488169362de58aa54a218d86f2dc1b7043  guix-build-c39160ab1ad5/output/riscv64-linux-gnu/bitcoin-c39160ab1ad5-riscv64-linux-gnu.tar.gz
d0b3cadc5371b1dce78c39e5eae2ee407207b730df4131f96110aeb55a8bffbd  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/SHA256SUMS.part
16707cb1bbe42c60722bdfd5d6bc58fe964dc357827ae11fd2c7bc89ebdae019  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/bitcoin-c39160ab1ad5-x86_64-apple-darwin-unsigned.tar.gz
868d38b9352e50412d829736103663b8793ff714966b946932adf4deac8cb402  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/bitcoin-c39160ab1ad5-x86_64-apple-darwin-unsigned.zip
3da4688e570eedea7636bf5f554321a139a14da90ead614024abd79a4d10eabc  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/bitcoin-c39160ab1ad5-x86_64-apple-darwin.tar.gz
1acd24a206a9e6ef0481b45827c3e91e4e8cf3b47d294dd07fb7836630d6c2aa  guix-build-c39160ab1ad5/output/x86_64-linux-gnu/SHA256SUMS.part
c055d10d69ce13b37149fe0c61dcfb9497140e8953967a58e85fe00d442c5ca4  guix-build-c39160ab1ad5/output/x86_64-linux-gnu/bitcoin-c39160ab1ad5-x86_64-linux-gnu-debug.tar.gz
461011628c6922108c39da41d1bf0d280310e89908dcd261b00fdf9204d948dc  guix-build-c39160ab1ad5/output/x86_64-linux-gnu/bitcoin-c39160ab1ad5-x86_64-linux-gnu.tar.gz
c9d71d94779f778af2d02f91246d71581781bbb507b0b27c00088ed508f03919  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/SHA256SUMS.part
e1d835f2aa5cf2aef7dbd222a6ae999489663a51b09dd25dc97f402ad915a519  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64-debug.zip
b8383a9dff9410b5c497c9ff48c09f12787f8ae794b1526865c25138a12377da  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64-setup-unsigned.exe
ebf4ea209aef53b2c6890b85c09f57deca1a2aa2397d4b9203da0e010003ed09  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64-unsigned.tar.gz
a37249cc9ef0b4aaca16984c00bdaf157608f7528df001bf1639961fccb345f3  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64.zip

@m3dwards
Copy link

m3dwards commented Jul 4, 2024

ACK c39160a

Matching Guix build

6a283b8a2a9968fa548002f1a0a4a0cce3f201738979c6a0f8362ae5e4bf8261  guix-build-c39160ab1ad5/output/aarch64-linux-gnu/SHA256SUMS.part
bffd6aec7a8dbbc5ab10fe8f06886957335c2728c5ef0659c867b1a0dc92f01f  guix-build-c39160ab1ad5/output/aarch64-linux-gnu/bitcoin-c39160ab1ad5-aarch64-linux-gnu-debug.tar.gz
472a9aa0b491ae5ce012b54dedff035219943468eafd277e2fc9d7dc83345096  guix-build-c39160ab1ad5/output/aarch64-linux-gnu/bitcoin-c39160ab1ad5-aarch64-linux-gnu.tar.gz
072b2f03f1f07d28b358370e83cd679842c74e63e9ccf7aece4f223250a747a9  guix-build-c39160ab1ad5/output/arm-linux-gnueabihf/SHA256SUMS.part
3b334b6d961bb28e251d24726320ce85ea53e7095603ef56a80369e921b17cc0  guix-build-c39160ab1ad5/output/arm-linux-gnueabihf/bitcoin-c39160ab1ad5-arm-linux-gnueabihf-debug.tar.gz
ce95b4812c317e6ab72270debab861702ad838cb9caf9fe84d86b8568d49f6a5  guix-build-c39160ab1ad5/output/arm-linux-gnueabihf/bitcoin-c39160ab1ad5-arm-linux-gnueabihf.tar.gz
375ca0e5ff3b2743ac897636d401119a7a047b9707730d24f3ac1fdeeb042fac  guix-build-c39160ab1ad5/output/arm64-apple-darwin/SHA256SUMS.part
4303065be429dfaddf3e7c29f324d45384d941e45f05a20aac1dc3b0ac48e173  guix-build-c39160ab1ad5/output/arm64-apple-darwin/bitcoin-c39160ab1ad5-arm64-apple-darwin-unsigned.tar.gz
e8d8ab48e93d28e09a64253f7b3aa0d4788027a5d36f983feccb627037e32fb4  guix-build-c39160ab1ad5/output/arm64-apple-darwin/bitcoin-c39160ab1ad5-arm64-apple-darwin-unsigned.zip
aa5460fa34039baf3c49edb16811ddc181d7071fd296f2b9fd6143de966c70bd  guix-build-c39160ab1ad5/output/arm64-apple-darwin/bitcoin-c39160ab1ad5-arm64-apple-darwin.tar.gz
d91a3bc8d5387a0f353f7787ad659f061a319c8c17ac1fbfd8249bfd3f2a1a24  guix-build-c39160ab1ad5/output/dist-archive/bitcoin-c39160ab1ad5.tar.gz
853f4b41a13ea8c0e625965e2e060183ab25c86b3ed7739269f3805cf63b75cb  guix-build-c39160ab1ad5/output/powerpc64-linux-gnu/SHA256SUMS.part
5a7907438b73e71bae9b2508f0a26e47de3fd0b062384a28e59d403ccef22dcb  guix-build-c39160ab1ad5/output/powerpc64-linux-gnu/bitcoin-c39160ab1ad5-powerpc64-linux-gnu-debug.tar.gz
75311c72e4b8edb48dd0450cb36560f36c1d4b96e0d780e47042fea15389b1a6  guix-build-c39160ab1ad5/output/powerpc64-linux-gnu/bitcoin-c39160ab1ad5-powerpc64-linux-gnu.tar.gz
7f067ee01a6bc41c451f2316b2dd9dc644254680155fb9a9df1b4a959731dab6  guix-build-c39160ab1ad5/output/riscv64-linux-gnu/SHA256SUMS.part
52ddface10f1b9b9326e11e1438fcba41d83dd28d71ca528fa1461b2b4e53411  guix-build-c39160ab1ad5/output/riscv64-linux-gnu/bitcoin-c39160ab1ad5-riscv64-linux-gnu-debug.tar.gz
c11c12afdc1172461f5a5413aaeffe488169362de58aa54a218d86f2dc1b7043  guix-build-c39160ab1ad5/output/riscv64-linux-gnu/bitcoin-c39160ab1ad5-riscv64-linux-gnu.tar.gz
d0b3cadc5371b1dce78c39e5eae2ee407207b730df4131f96110aeb55a8bffbd  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/SHA256SUMS.part
16707cb1bbe42c60722bdfd5d6bc58fe964dc357827ae11fd2c7bc89ebdae019  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/bitcoin-c39160ab1ad5-x86_64-apple-darwin-unsigned.tar.gz
868d38b9352e50412d829736103663b8793ff714966b946932adf4deac8cb402  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/bitcoin-c39160ab1ad5-x86_64-apple-darwin-unsigned.zip
3da4688e570eedea7636bf5f554321a139a14da90ead614024abd79a4d10eabc  guix-build-c39160ab1ad5/output/x86_64-apple-darwin/bitcoin-c39160ab1ad5-x86_64-apple-darwin.tar.gz
1acd24a206a9e6ef0481b45827c3e91e4e8cf3b47d294dd07fb7836630d6c2aa  guix-build-c39160ab1ad5/output/x86_64-linux-gnu/SHA256SUMS.part
c055d10d69ce13b37149fe0c61dcfb9497140e8953967a58e85fe00d442c5ca4  guix-build-c39160ab1ad5/output/x86_64-linux-gnu/bitcoin-c39160ab1ad5-x86_64-linux-gnu-debug.tar.gz
461011628c6922108c39da41d1bf0d280310e89908dcd261b00fdf9204d948dc  guix-build-c39160ab1ad5/output/x86_64-linux-gnu/bitcoin-c39160ab1ad5-x86_64-linux-gnu.tar.gz
c9d71d94779f778af2d02f91246d71581781bbb507b0b27c00088ed508f03919  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/SHA256SUMS.part
e1d835f2aa5cf2aef7dbd222a6ae999489663a51b09dd25dc97f402ad915a519  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64-debug.zip
b8383a9dff9410b5c497c9ff48c09f12787f8ae794b1526865c25138a12377da  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64-setup-unsigned.exe
ebf4ea209aef53b2c6890b85c09f57deca1a2aa2397d4b9203da0e010003ed09  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64-unsigned.tar.gz
a37249cc9ef0b4aaca16984c00bdaf157608f7528df001bf1639961fccb345f3  guix-build-c39160ab1ad5/output/x86_64-w64-mingw32/bitcoin-c39160ab1ad5-win64.zip

fanquake and others added 6 commits July 11, 2024 19:19
Set minimum required glibc to 2.31.
The glibc 2.31 branch is still maintained:
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.31/master.

Remove the stack-protector check from test-security-check, as the test
no-longer fails, and given the control we have of the end, the actual
security-check test seems sufficient (this might also be applied to some
of the other checks).

Drops runtime support for Ubuntu Bionic 18.04 and RHEL-8 from the release binaries.
We don't actually use a c compiler as part of Core's build (only for secp).
We should be testing against what we're actually using instead.
@hebasto
Copy link
Owner Author

hebasto commented Jul 11, 2024

Rebased on top of the bitcoin#30387 @ 9010b13.

The first commit was cherry-picked from bitcoin#29987 to avoid conflicts with the following ones.

@hebasto
Copy link
Owner Author

hebasto commented Jul 12, 2024

My Guix build:

x86_64
b4203e9e8738919ecf28caef295ba97c39431eac9c4c1d7ddc17c95d3e7f4add  guix-build-77876cacbf5c/output/aarch64-linux-gnu/SHA256SUMS.part
bb11b1280cea7b1533396913acd8310c4e781adbcc1385fe1fbbb29d612226ca  guix-build-77876cacbf5c/output/aarch64-linux-gnu/bitcoin-77876cacbf5c-aarch64-linux-gnu-debug.tar.gz
55b06f759d9c74aec7b0bb8790eac91d5f864ada5dc4d2927c63d3673ffa1ec9  guix-build-77876cacbf5c/output/aarch64-linux-gnu/bitcoin-77876cacbf5c-aarch64-linux-gnu.tar.gz
c6c7602f0b8ad25d236766665c5b4ab28fc87a6775a0dc9d3282c0a2eda2d1e5  guix-build-77876cacbf5c/output/arm-linux-gnueabihf/SHA256SUMS.part
497e6f4d5f3bd0be6aa723c681e76599d5a7af0aa319c2d42b865dc6ea1c332c  guix-build-77876cacbf5c/output/arm-linux-gnueabihf/bitcoin-77876cacbf5c-arm-linux-gnueabihf-debug.tar.gz
af9329d045fba135507c58ed03a070baa72830b1888bea092fe91e69366d20fc  guix-build-77876cacbf5c/output/arm-linux-gnueabihf/bitcoin-77876cacbf5c-arm-linux-gnueabihf.tar.gz
758ce94c0a8f5b27fdb5164345d2077fe7cdfde47604a118c5149bcf475d746e  guix-build-77876cacbf5c/output/arm64-apple-darwin/SHA256SUMS.part
a294da52d2add86acb06283dda42c9066107f425f2d1acbebc9997edd1bac89f  guix-build-77876cacbf5c/output/arm64-apple-darwin/bitcoin-77876cacbf5c-arm64-apple-darwin-unsigned.tar.gz
4cfb6d468b1c639d93503c7cd27d60285f8a9d8318d786de816707d964097464  guix-build-77876cacbf5c/output/arm64-apple-darwin/bitcoin-77876cacbf5c-arm64-apple-darwin-unsigned.zip
cc19857dea405d5356ab3fe71023a164afbd1fccefb5b20bbe0ce42362f5af6c  guix-build-77876cacbf5c/output/arm64-apple-darwin/bitcoin-77876cacbf5c-arm64-apple-darwin.tar.gz
61c529fa1b28a14b4c8974b5103cc0163c6adfbb538a1e9607e6be9b841b12eb  guix-build-77876cacbf5c/output/dist-archive/bitcoin-77876cacbf5c.tar.gz
c78d507e68f4cef12ba1c07d0f861e79488bef9f1ef95c11d6890ca72b6408fb  guix-build-77876cacbf5c/output/powerpc64-linux-gnu/SHA256SUMS.part
52e7a1087808d1c4cf6e3e714e4196bae6173c63011c7458146d7570f6913524  guix-build-77876cacbf5c/output/powerpc64-linux-gnu/bitcoin-77876cacbf5c-powerpc64-linux-gnu-debug.tar.gz
d56cd4e6a9f67827991e8a0085274f9adcf5c4eadd708db2ab62c9dd9681fea3  guix-build-77876cacbf5c/output/powerpc64-linux-gnu/bitcoin-77876cacbf5c-powerpc64-linux-gnu.tar.gz
55fb4a2b89e7d92e3e97606f8ccfea93c74d56c98d541bf8ed95f5c2246463b1  guix-build-77876cacbf5c/output/riscv64-linux-gnu/SHA256SUMS.part
b7654f1f349457276539d73d48d0ed5e048f2b412a151bc1e43f03b1da882590  guix-build-77876cacbf5c/output/riscv64-linux-gnu/bitcoin-77876cacbf5c-riscv64-linux-gnu-debug.tar.gz
9ea766b8cbc9bb6afec632df01717f37b77abf349ae15364ec591ed6af1a35dd  guix-build-77876cacbf5c/output/riscv64-linux-gnu/bitcoin-77876cacbf5c-riscv64-linux-gnu.tar.gz
15132ea755b1f79e040bee6c7a0ecfa354e9cbc5237295ac7f8dbb0b41b269c7  guix-build-77876cacbf5c/output/x86_64-apple-darwin/SHA256SUMS.part
6d3b04c4d7a097ab13ea44a027db73ad5a40bd7db9726a4ce403c3074ef5b2a9  guix-build-77876cacbf5c/output/x86_64-apple-darwin/bitcoin-77876cacbf5c-x86_64-apple-darwin-unsigned.tar.gz
5d3f94642e023f6a2c96b8c0f29ebf3438052128ccbe76afa134cbaa68405687  guix-build-77876cacbf5c/output/x86_64-apple-darwin/bitcoin-77876cacbf5c-x86_64-apple-darwin-unsigned.zip
47ea90abe4d80192501d3d4d1d23dfa8512d6e1530d9848acf4c4880e0ef7c22  guix-build-77876cacbf5c/output/x86_64-apple-darwin/bitcoin-77876cacbf5c-x86_64-apple-darwin.tar.gz
48631937ac0e1d04b27ac4732869d149f8109a4b753eb81f396f6118d7e638d8  guix-build-77876cacbf5c/output/x86_64-linux-gnu/SHA256SUMS.part
669a6366e09236a210ee28df08ef4a09a9df13cd8aff08653286a48d79b4e9f1  guix-build-77876cacbf5c/output/x86_64-linux-gnu/bitcoin-77876cacbf5c-x86_64-linux-gnu-debug.tar.gz
c6b2406ad6e8711724e62e41b16cf2f62a5c25c2dfcc414ec1c60d2f44d323b4  guix-build-77876cacbf5c/output/x86_64-linux-gnu/bitcoin-77876cacbf5c-x86_64-linux-gnu.tar.gz
49d16aae6053375290ad57741f6aa309162ef9702bbdcbefb5df6dd612428a3c  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/SHA256SUMS.part
477a95d67abcc111a030db9f6ae6eac8e98b7b9abc0f5a64356bdd451b7e0706  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64-debug.zip
30281f3ca601d344859ab4936cc4d3c6ec27bf1e240fa534cf4d2e614d028ecf  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64-setup-unsigned.exe
ac34f96fcca703518375ada0ea8b09e55818eb95ea4931559c689a8087f75e43  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64-unsigned.tar.gz
608ea72157d8792936bd67a2faff16aab85f8577b20da8be69d237ca1c72a30f  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64.zip

@m3dwards
Copy link

My Guix build matches

b4203e9e8738919ecf28caef295ba97c39431eac9c4c1d7ddc17c95d3e7f4add  guix-build-77876cacbf5c/output/aarch64-linux-gnu/SHA256SUMS.part
bb11b1280cea7b1533396913acd8310c4e781adbcc1385fe1fbbb29d612226ca  guix-build-77876cacbf5c/output/aarch64-linux-gnu/bitcoin-77876cacbf5c-aarch64-linux-gnu-debug.tar.gz
55b06f759d9c74aec7b0bb8790eac91d5f864ada5dc4d2927c63d3673ffa1ec9  guix-build-77876cacbf5c/output/aarch64-linux-gnu/bitcoin-77876cacbf5c-aarch64-linux-gnu.tar.gz
c6c7602f0b8ad25d236766665c5b4ab28fc87a6775a0dc9d3282c0a2eda2d1e5  guix-build-77876cacbf5c/output/arm-linux-gnueabihf/SHA256SUMS.part
497e6f4d5f3bd0be6aa723c681e76599d5a7af0aa319c2d42b865dc6ea1c332c  guix-build-77876cacbf5c/output/arm-linux-gnueabihf/bitcoin-77876cacbf5c-arm-linux-gnueabihf-debug.tar.gz
af9329d045fba135507c58ed03a070baa72830b1888bea092fe91e69366d20fc  guix-build-77876cacbf5c/output/arm-linux-gnueabihf/bitcoin-77876cacbf5c-arm-linux-gnueabihf.tar.gz
758ce94c0a8f5b27fdb5164345d2077fe7cdfde47604a118c5149bcf475d746e  guix-build-77876cacbf5c/output/arm64-apple-darwin/SHA256SUMS.part
a294da52d2add86acb06283dda42c9066107f425f2d1acbebc9997edd1bac89f  guix-build-77876cacbf5c/output/arm64-apple-darwin/bitcoin-77876cacbf5c-arm64-apple-darwin-unsigned.tar.gz
4cfb6d468b1c639d93503c7cd27d60285f8a9d8318d786de816707d964097464  guix-build-77876cacbf5c/output/arm64-apple-darwin/bitcoin-77876cacbf5c-arm64-apple-darwin-unsigned.zip
cc19857dea405d5356ab3fe71023a164afbd1fccefb5b20bbe0ce42362f5af6c  guix-build-77876cacbf5c/output/arm64-apple-darwin/bitcoin-77876cacbf5c-arm64-apple-darwin.tar.gz
61c529fa1b28a14b4c8974b5103cc0163c6adfbb538a1e9607e6be9b841b12eb  guix-build-77876cacbf5c/output/dist-archive/bitcoin-77876cacbf5c.tar.gz
c78d507e68f4cef12ba1c07d0f861e79488bef9f1ef95c11d6890ca72b6408fb  guix-build-77876cacbf5c/output/powerpc64-linux-gnu/SHA256SUMS.part
52e7a1087808d1c4cf6e3e714e4196bae6173c63011c7458146d7570f6913524  guix-build-77876cacbf5c/output/powerpc64-linux-gnu/bitcoin-77876cacbf5c-powerpc64-linux-gnu-debug.tar.gz
d56cd4e6a9f67827991e8a0085274f9adcf5c4eadd708db2ab62c9dd9681fea3  guix-build-77876cacbf5c/output/powerpc64-linux-gnu/bitcoin-77876cacbf5c-powerpc64-linux-gnu.tar.gz
55fb4a2b89e7d92e3e97606f8ccfea93c74d56c98d541bf8ed95f5c2246463b1  guix-build-77876cacbf5c/output/riscv64-linux-gnu/SHA256SUMS.part
b7654f1f349457276539d73d48d0ed5e048f2b412a151bc1e43f03b1da882590  guix-build-77876cacbf5c/output/riscv64-linux-gnu/bitcoin-77876cacbf5c-riscv64-linux-gnu-debug.tar.gz
9ea766b8cbc9bb6afec632df01717f37b77abf349ae15364ec591ed6af1a35dd  guix-build-77876cacbf5c/output/riscv64-linux-gnu/bitcoin-77876cacbf5c-riscv64-linux-gnu.tar.gz
15132ea755b1f79e040bee6c7a0ecfa354e9cbc5237295ac7f8dbb0b41b269c7  guix-build-77876cacbf5c/output/x86_64-apple-darwin/SHA256SUMS.part
6d3b04c4d7a097ab13ea44a027db73ad5a40bd7db9726a4ce403c3074ef5b2a9  guix-build-77876cacbf5c/output/x86_64-apple-darwin/bitcoin-77876cacbf5c-x86_64-apple-darwin-unsigned.tar.gz
5d3f94642e023f6a2c96b8c0f29ebf3438052128ccbe76afa134cbaa68405687  guix-build-77876cacbf5c/output/x86_64-apple-darwin/bitcoin-77876cacbf5c-x86_64-apple-darwin-unsigned.zip
47ea90abe4d80192501d3d4d1d23dfa8512d6e1530d9848acf4c4880e0ef7c22  guix-build-77876cacbf5c/output/x86_64-apple-darwin/bitcoin-77876cacbf5c-x86_64-apple-darwin.tar.gz
48631937ac0e1d04b27ac4732869d149f8109a4b753eb81f396f6118d7e638d8  guix-build-77876cacbf5c/output/x86_64-linux-gnu/SHA256SUMS.part
669a6366e09236a210ee28df08ef4a09a9df13cd8aff08653286a48d79b4e9f1  guix-build-77876cacbf5c/output/x86_64-linux-gnu/bitcoin-77876cacbf5c-x86_64-linux-gnu-debug.tar.gz
c6b2406ad6e8711724e62e41b16cf2f62a5c25c2dfcc414ec1c60d2f44d323b4  guix-build-77876cacbf5c/output/x86_64-linux-gnu/bitcoin-77876cacbf5c-x86_64-linux-gnu.tar.gz
49d16aae6053375290ad57741f6aa309162ef9702bbdcbefb5df6dd612428a3c  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/SHA256SUMS.part
477a95d67abcc111a030db9f6ae6eac8e98b7b9abc0f5a64356bdd451b7e0706  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64-debug.zip
30281f3ca601d344859ab4936cc4d3c6ec27bf1e240fa534cf4d2e614d028ecf  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64-setup-unsigned.exe
ac34f96fcca703518375ada0ea8b09e55818eb95ea4931559c689a8087f75e43  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64-unsigned.tar.gz
608ea72157d8792936bd67a2faff16aab85f8577b20da8be69d237ca1c72a30f  guix-build-77876cacbf5c/output/x86_64-w64-mingw32/bitcoin-77876cacbf5c-win64.zip

@theuni
Copy link

theuni commented Jul 12, 2024

LGTM

@hebasto hebasto merged commit ab2ac62 into cmake-staging Jul 12, 2024
38 checks passed
fanquake added a commit to bitcoin/bitcoin that referenced this pull request Jul 16, 2024
…nary checks

9010b13 contrib: c++ify test stubs after switching to c++ compilers (Cory Fields)
261f770 contrib: rename cc to cxx in binary checking scripts (Cory Fields)
a38c960 contrib: use c++ rather than c for binary tests (Cory Fields)

Pull request description:

  From hebasto's CMake repo. See discussion here: hebasto#252 (comment)

  Use CXX/CXXFLAGS rather than CC/CFLAGS to test our actual compiler for binary checks rather than the one we only forward to secp256k1.

ACKs for top commit:
  hebasto:
    ACK 9010b13.
  fanquake:
    ACK 9010b13

Tree-SHA512: 7b8788d7d3760103062eff10056c995e1ad14c0c487d9414683ad54d816c255d0ca751f4d0e2d2ad7f9e8a7101d8c7f1e9333fa5b137558ed68fa593c4b4ce6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants