-
Notifications
You must be signed in to change notification settings - Fork 38.6k
build: use a static .tiff for macOS .dmg rather than generating #23909
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
Conversation
|
Concept ACK. |
|
In my take in #23908 I removed the "PACKAGE_NAME" from the SVG completely, since that was the only reason for the whole SVG dance. Let's do the same thing in this PR since the package name is already shown in the window title and under the icon (see examples below). See https://github.com/bitcoin/bitcoin/pull/23908/files#diff-ed877ecc59088c3387feeabf1b8bb37da20b3101ea17c8e5d794a7b84f6ebba7 + we could also remove the It is also worth keeping the background.svg in the Git even if it is not used directly. Before: After: It is still quite obvious that Bitcoin Core is about to be installed even without the branding embedded in the background. Feel free to take the resulting TIFF from https://github.com/prusnak/bitcoin/blob/827a590896acbfd5ef630aaa913e7ca37d1d5f5c/contrib/macdeploy/background.tiff |
Agree. And document steps required to convert svg to tiff, that anyone could prove the correctness of the latter. |
Here is the script I used to generate the TIFF from above: |
e22d3ba to
835c308
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
prusnak
left a comment
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.
utACK
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 835c308 (see #23909 (comment)), compiled on Linux Mint 20.2 (x86_64) and on macOS Big Sur 11.6.2 (20G314, Intel).
Guix build:
$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
f98bd97ae7335ef3fd9fc1fd4f91359d99490cb630930248b844ea933453803c guix-build-835c308c6a5b/output/dist-archive/bitcoin-835c308c6a5b.tar.gz
0e6e70da98ef7837f611dadbd08ab21b2c054f2442a19d1de30ad0835e5c393c guix-build-835c308c6a5b/output/x86_64-apple-darwin/SHA256SUMS.part
8d36535b0c14144d860246271ccf6457dc7f5323d63a3393c2ac44d707c16add guix-build-835c308c6a5b/output/x86_64-apple-darwin/bitcoin-835c308c6a5b-osx-unsigned.dmg
abbc4f6567758dd8ccf2f83da64e386ad392bd7d5c9b61453cde3bde1085d8c0 guix-build-835c308c6a5b/output/x86_64-apple-darwin/bitcoin-835c308c6a5b-osx-unsigned.tar.gz
16e01a91d184455bee35f23d0a3b177328135beb9d5853669f64ac3f24e80f0c guix-build-835c308c6a5b/output/x86_64-apple-darwin/bitcoin-835c308c6a5b-osx64.tar.gz
Installing bitcoin-835c308c6a5b-osx-unsigned.dmg on macOS Big Sur 11.6.2 (20G314, Intel):

Zero-1729
left a comment
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.
|
Is there a reason to add a 30KB file to the repo? If yes, it would be good to explain why and how you generated it. Locally I am getting 9KB (zip) or 22KB (lzw) Commands: Concept ACK 835c308 🦌 Show signatureSignature: |
835c308 to
5b1fd09
Compare
It came from this branch: https://github.com/prusnak/bitcoin/blob/827a590896acbfd5ef630aaa913e7ca37d1d5f5c/contrib/macdeploy/background.tiff, so I'd assume these were the instructions. I've regenerated it now, and it's about half the size (18KB). I've also removed the Added screenshot to PR description, and added @prusnak as co-author given he also opened a PR. |
|
It seems no background in Guix's |
5b1fd09 to
692b38d
Compare
Should be fixed now. |
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.
Approach ACK 692b38d
Guix build:
$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 ls -l
-rw-r--r-- 1 hebasto hebasto 10760618 Jan 2 09:03 guix-build-692b38d2c47e/output/dist-archive/bitcoin-692b38d2c47e.tar.gz
-rw-r--r-- 1 hebasto hebasto 35000686 Jan 2 09:10 guix-build-692b38d2c47e/output/x86_64-apple-darwin/bitcoin-692b38d2c47e-osx64.tar.gz
-rw-r--r-- 1 hebasto hebasto 16053436 Jan 2 09:09 guix-build-692b38d2c47e/output/x86_64-apple-darwin/bitcoin-692b38d2c47e-osx-unsigned.dmg
-rw-r--r-- 1 hebasto hebasto 16396639 Jan 2 09:09 guix-build-692b38d2c47e/output/x86_64-apple-darwin/bitcoin-692b38d2c47e-osx-unsigned.tar.gz
-rw-r--r-- 1 hebasto hebasto 478 Jan 2 09:10 guix-build-692b38d2c47e/output/x86_64-apple-darwin/SHA256SUMS.part
Running bitcoin-692b38d2c47e-osx-unsigned.dmg:
|
CI failure seems related to building out of source tree. |
|
Maybe --- a/configure.ac
+++ b/configure.ac
@@ -1861,6 +1861,7 @@ AC_CONFIG_LINKS([contrib/devtools/symbol-check.py:contrib/devtools/symbol-check.
AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-security-check.py])
AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py])
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
+AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff])
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py])
AC_CONFIG_LINKS([test/util/test_runner.py:test/util/test_runner.py])? (did not test though) |
Co-authored-by: Pavol Rusnak <[email protected]>
692b38d to
e09773d
Compare
|
Concept NACK. There's no benefit to this; it only serves to sabotage derivative projects. As mentioned in #23778, there's a straightforward solution to avoid the Rust dependency by simply not using the Rust-based librsvg... |
This statement is not true. See OP:
|
|
Not really. You still need those to actually build it. Now you're just injecting a pre-compiled TIFF into Guix, essentially reverting it back to where things were with gitian (except now the trusted "compiler" isn't necessarily even reproducible). And these aren't even deps for an actual end-user build, only for producing the release artefacts. |
|
Concept ACK |
hebasto
left a comment
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 e09773d
|
Reviewers could be interested in historical context: #7192. |
This PR makes it actually easier for derivative projects because they do not need to fiddle with the installer background anymore. |
They didn't have to before... |
I wouldn't have opened a PR if there was no benefit to doing this. As others have mentioned, and as I laid out in the PR description, the benefit is a reduction in the number of dependencies you need to build Bitcoin Core for macOS. In general, if it's possible to simplify a build process with no, or near zero downside (which I certainly think is the case here), then I think it's something we should be doing.
Not even sure how to respond to this, but I really think you need to get some perspective. What's changing here is outlined in the image below. Remembering that this is a view that's only shown during the install procedure, for a single host, and likely, at most, for the few seconds it takes for a user to drag the app icon over to the folder. Note that the project name is still shown in two other places, so it's not like this is removing the only branding / naming that was present in the DMG. How exactly is anything being sabotaged by this few second view only containing 2 instances of the project name, rather than 3?
No, you don't. Once the .tiff exists in .git, no one has to build it ever again, and thus doesn't need to have those tools present in their build envinronment. That's basically the point of this PR.
Comparing the copying of a .tiff into our Guix environment, as the equivalent of reverting back to gitian is absurd. |
You don't need the tiff to build Core (only to package it, which is a special case where deps matter quite a bit less).
The description in the PR said the image was added unmodified. Having seen the actual tiff, I see the change, and agree it is less problematic than I originally understood it to be. (However, I still think this isn't a good approach)
It's like adding a compiled bitcoind binary to git and saying that means we don't need GCC/LLVM anymore. |
I agree it's a special case, but not in the way you're seemingly dismissing it. The makeup of our Guix build (release packaging) environment is our most important build environment, thus a very special case. I completely disagree with the notion that "deps matter quite a bit less" there, in fact, I think the opposite is true. In that environment, every additional dependency (and the dependencies of those dependencies) increases the scope for potential compromise, and/or tool/supply chain related attacks and are just more things we have to potentially maintain / vet / install. So I think any change that reduces the build requirements for that environment, is a good one. In this case, we can drop
Apologies, I'll update the PR description to reflect the current change. However, there were at least 4 screenshots, showing the new DMG view, posted in this thread before you made your comments. |
jarolrod
left a comment
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 e09773d
Clear benefit in this change.
Guix hashes:
find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
c98d67796863f4b1bab0ad600d46bd74e744d94072cbd4bc856a6aeaba3bb329 guix-build-e09773d20a92/output/dist-archive/bitcoin-e09773d20a92.tar.gz
3336f90bab312798cb7665e2b4ae24d1a270fb240647d5fed8dbfcd83e3ed37e guix-build-e09773d20a92/output/x86_64-apple-darwin/SHA256SUMS.part
8fd680c7ee158c64bad212385df7b0b302c6c2143d4e672b4b0eb5da41f9256d guix-build-e09773d20a92/output/x86_64-apple-darwin/bitcoin-e09773d20a92-osx-unsigned.dmg
34f54177c2f0700e8cfaf5d85d91e404807cd9d411e22006cdff82653e5f4af2 guix-build-e09773d20a92/output/x86_64-apple-darwin/bitcoin-e09773d20a92-osx-unsigned.tar.gz
da6b8f54ef755d40330c8eac4f5bd0329637e827be9ee61318600d5d0bdcc3dc guix-build-e09773d20a92/output/x86_64-apple-darwin/bitcoin-e09773d20a92-osx64.tar.gz
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 e09773d
Agree, besides the more minimalist look, having fewer deps would help reduce the potential attack surface.
|
Post-merge ACK e09773d. Much better than requiring rust, and a nice simplification. |
|
Post-merge ACK e09773d |
|
I concur |





For demonstration, after discussion in #23778, and the question as to why we can't just have a
background.tiffthat we copy into the macOS DMG, and do away with the somewhat convoluted image generation steps.From my understanding, the only reason we have this image generation as part of our build system is so that forks of Core can adapt the imagery for their own branding via
PACKAGE_NAME. It don't think it provides much value to us, and could just have a static .tiff that we copy into the dmg (replacing the .svg that currently lives in macdeploy/).Doing this would eliminate the following build dependencies:
For native macOS:
sed(usage in Makefile.am)librsvg(rsvg-convert)tiffutilLinux macOS cross-compile:
sed(usage in Makefille.am)librsvgtiffcpconvert(imagemagick)font-tuffyGuix Build: