-
Notifications
You must be signed in to change notification settings - Fork 5
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: Fix cmake_install
scripts for macOS
#321
Conversation
Fix `cmake_install` scripts for the Darwin platform.
My Guix build:
|
Should the fix be in the build system? Otherwise it's fixed for Guix, but still broken for anyone building with older versions of CMake. |
Yes, ideally. But CMake doesn't provide any means to customize the
True. In that case, the user still able to use the
It seems possible to add flags to the
Not at the moment.
True. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e61dbee
Ugh so cmake install won't work for apple outside of guix? This is a really ugly fix :( Also this from upstream CMake:
We used chained fixups. With that hack, do the binaries even work? |
To be precise, what is broken is the So, outside the Guix, the user has two options:
I agree.
Yes, I also saw this notice. FWIW, it is not CMake-specific. It also applies to the current Autotools-based variant. |
Isn't it going to be cross-compilation (on Linux) where this is most likely to be a problem? So I don't think brews CMake is that relevant here. Also, wouldn't anyone building on macOS be using Apple |
Yes, it is.
However, cross-compiling on macOS for another arch macOS is still a case; and I mentioned Homebrew's CMake version for that case. |
Right, but that will still be using Apple |
Right. It doesn't matter. |
Am I right that this problem manifests only if all of the below are true:
What is the outcome when all of those are true? Does the build fail or is the error ignored? The report from https://gitlab.kitware.com/cmake/cmake/-/issues/24601 says that "Note that the build is “successful”, i.e. CPack ignores this error." |
No. It will primarily happen on Linux. However I assume it will happen on macOS if using LLVM tools.
The outcome is that CMake just ignores the failure and continues on. Which is why I assume it persisted in the Guix build for so long before anyone noticed. |
Yes, the binaries work. And they are stripped of the debug info the same way as on the master branch. |
Are you sure? Linux's
Here is a user citing some of the CMake's code which enables Or do you mean "cross-compiling on Linux for MacOS"? And then the outcome is that the install succeeds but the binaries are not stripped? |
Yes. Hence the broken Guix build. |
Why is |
Because we use a Clang and LLVM based toolchain to build for macOS. |
A minor clarification: with |
So, this problem manifests only if all of the below are true:
The outcome is:
ACK e61dbee |
... with the Just |
Updated the previous comment slightly to clarify that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunate, but I don't see another way forward here. I hope cmake learns to expose the variable for these tools, so we don't end up having to do this for more tools in the future.
Guix build:
find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
72c94bf27482ed0442218d1bce9bc882cf92f80ffb3cca74bd53a376261de25f guix-build-e61dbee3c2c0/output/arm64-apple-darwin/SHA256SUMS.part
654f93660b3e8108c2ca6f262b8f87cbcdb4f535eb56508f4882f3c5cbbb2443 guix-build-e61dbee3c2c0/output/arm64-apple-darwin/bitcoin-e61dbee3c2c0-arm64-apple-darwin-unsigned.tar.gz
9f940d388afb39bfb8310f9b2a18b7fbed3c1326f9e0d4767deb1fcfd04aa656 guix-build-e61dbee3c2c0/output/arm64-apple-darwin/bitcoin-e61dbee3c2c0-arm64-apple-darwin-unsigned.zip
97cf720b8bc006604e297a2e781e635e82f3b10ee93de3dd8f942e696c1cac5c guix-build-e61dbee3c2c0/output/arm64-apple-darwin/bitcoin-e61dbee3c2c0-arm64-apple-darwin.tar.gz
e994d2052c377a8670257c12f660ab5d3098afc4faa5d669e5ce4a9f2a90f1da guix-build-e61dbee3c2c0/output/dist-archive/bitcoin-e61dbee3c2c0.tar.gz
7e88f422d627e6bfa1bd09574d672807e383b66a17d2b9e8fb4731f496b563a7 guix-build-e61dbee3c2c0/output/x86_64-apple-darwin/SHA256SUMS.part
399e7cfc640b83b3dbad9421025a7b6fc7aa183a0de001d40b607c4501397123 guix-build-e61dbee3c2c0/output/x86_64-apple-darwin/bitcoin-e61dbee3c2c0-x86_64-apple-darwin-unsigned.tar.gz
9c27401ef081c9eab05e2ad10bcbf59af591a33e5004a1d61012e2adbeb7c636 guix-build-e61dbee3c2c0/output/x86_64-apple-darwin/bitcoin-e61dbee3c2c0-x86_64-apple-darwin-unsigned.zip
0ece9e1bd1a9cc3be3b2413bea40f3f9683dce81c47adff10485cf84ed338cf3 guix-build-e61dbee3c2c0/output/x86_64-apple-darwin/bitcoin-e61dbee3c2c0-x86_64-apple-darwin.tar.gz
Also tested the zipped .app package on macos 12.7.4
The current Guix's
cmake-minimal
package has version 3.24.2, which has a bug that causes wrong options forllvm-strip
.This PR has exactly the same effect as the fixed CMake versions >= 3.27.
Addresses bitcoin#30454 (comment):