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

Remove Sparkle.framework when configured with --disable-sparkle #1373

Merged

Conversation

ychin
Copy link
Member

@ychin ychin commented Feb 26, 2023

Previously, when configured with --disable-sparkle, the Sparkle.framework would still get linked and copied into the app bundle. This is because Xcode doesn't have an easy way to disable individual build phase. We would either have to make a new build target, or dynamically patch the project file in order for that to not happen. Package managers like Homebrew and Nix have to either manually delete the framework as a post-build step, or manually patch the pbxproj file as a pre-build step to make sure the framework never got linked/copied.

Also, when building MacVim on macOS 10.9-10.12, where Sparkle 2 is not supported, even if you build with --disable-sparkle, the app still wouldn't run since Sparkle 2's framework still got copied into the app and on launch the OS will detect that it's not compatible with the OS version.

To fix this, just add a new env var and have the build cleanup script delete the entire Sparkle.framework as a post-build step, if --disable-sparkle was previously configured.

One thing to note is that currently, even with this, the MacVim binary still has a weak linking dependency to the non-existent Sparkle.framework (can be seen by doing otool -L MacVim.app/Contents/MacOS/MacVim) but it should be fine. A proper way to fix this is to manually link Sparkle instead of letting Xcode do it for us, but considering that this is a relatively niche use case, and it still works regardless, there isn't a pressing need to do so.

Also, add CI check to make sure when --disable-sparkle is used, the actual MacVim binary has 0 references to Sparkle symbols. This makes sure that removing the Sparkle.framework from the app bundle is actually safe.

@ychin ychin added the Updater Issues related to Sparkle updater label Feb 26, 2023
@ychin ychin mentioned this pull request Feb 26, 2023
7 tasks
@ychin ychin force-pushed the remove-sparkle-framework-when-disabled branch 4 times, most recently from b31140a to d0ae5d3 Compare February 27, 2023 21:33
Previously, when configured with `--disable-sparkle`, the
Sparkle.framework would still get linked and copied into the app bundle.
This is because Xcode doesn't have an easy way to disable individual
build phase. We would either have to make a new build target, or
dynamically patch the project file in order for that to not happen.
Package managers like Homebrew and Nix have to either manually delete
the framework as a post-build step, or manually patch the pbxproj file
as a pre-build step to make sure the framework never got linked/copied.

Also, when building MacVim on macOS 10.9-10.12, where Sparkle 2 is not
supported, even if you build with `--disable-sparkle`, the app still
wouldn't run since Sparkle 2's framework still got copied into the app
and on launch the OS will detect that it's not compatible with the OS
version.

To fix this, just add a new env var and have the build cleanup script
delete the entire Sparkle.framework as a post-build step, if
`--disable-sparkle` was previously configured.

One thing to note is that currently, even with this, the MacVim binary
still has a weak linking dependency to the non-existent
Sparkle.framework (can be seen by doing `otool -L
MacVim.app/Contents/MacOS/MacVim`) but it should be fine.  A proper way
to fix this is to manually link Sparkle instead of letting Xcode do it
for us, but considering that this is a relatively niche use case, and it
still works regardless, there isn't a pressing need to do so.

Also, add CI check to make sure when `--disable-sparkle` is used, the
actual MacVim binary has 0 references to Sparkle symbols. This makes
sure that removing the Sparkle.framework from the app bundle is actually
safe.
@ychin ychin force-pushed the remove-sparkle-framework-when-disabled branch from d0ae5d3 to 8aaea5c Compare February 27, 2023 21:42
@ychin ychin merged commit 61281b5 into macvim-dev:master Feb 27, 2023
@ychin ychin deleted the remove-sparkle-framework-when-disabled branch February 27, 2023 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Updater Issues related to Sparkle updater
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant