Sparkle: Support Apple Silicon (ARM64)

Created on 24 Jun 2020  路  25Comments  路  Source: sparkle-project/Sparkle

There鈥檚 about six months until ARM Macs are in the wild. To be ready for them, apps that integrate Sparkle must be rebuilt as Universal binaries. To rebuild, they鈥檒l first need a Universal build of Sparkle.

I鈥檓 opening this issue to track that progress and discuss any changes that must be made to support ARM.

I suggest this be made a high priority because it blocks app developers who use Sparkle from rebuilding their own apps.

Most helpful comment

All 25 comments

I've verified that Sparkle works on Big Sur x86-64. I've got a tip that Sparkle is compatible with ARM already.

well-that-was-easy

In the WWDC session on migrating to Apple Silicon they showed an arm64 build of Sparkle but not how they did it. Can the next update posted here please be a Universal 2 binary?

we were able to build successfully Distribution package on Xcode Version 12.0 beta (12A8158a) with no code changes.

lipo -archs Sparkle.framework/Versions/A/Sparkle
x86_64 arm64

hoping to make an update when Xcode 12 release is available.

I got a warning when compiling though: #1621

Sparkle throws an error when you build your project on a DTK in Xcode. It states something about the .framework being compiled for intel and how it will be ignored.

The app builds and runs but when you try anything to do with the update mechanism, it doesn't work.

Im guessing like @bdkjones initially said, we might need a universal variant of the framework.

Did you build an ARM version of Sparkle yourself? Downloads from GitHub releases are compiled for Intel only for now.

Did you build an ARM version of Sparkle yourself? Downloads from GitHub releases are compiled for Intel only for now.

I did not, I actually didn't realise I could compile my own version of the framework for security reasons.

Will this be a hard requirement for only support universal binaries? We are not planning to release one, but rather individual ones, and therefore it would require us some major reengineering effort.

As of now, Sparkle compile well on arm-only and that works. Also, the url paths differ for the architectures (something we already planned on beforehand). Therefore it should be sufficient, that if the current sparkle works (as it does on Apple Silicon), we would not need universal binaries, right?

@rknall I鈥檓 afraid I don鈥檛 understand your comment. Sparkle will definitely need to be compiled for both x86 and ARM64.

@rknall Sparkle source code supports ARM already. Precompiled Sparkle binary releases on our GitHub releases page don't support ARM yet. To get an ARM-compatible Sparkle, you have to compile a Universal Binary yourself.
We will be building for ARM and providing "fat binaries" later.

I meant, is it a requirement for the application to use Sparkle, to only support universal binaries? Not if sparkle is a universal binary. I am assuming as much. But I am worried, that only universal binaries are being supported by sparkle.

@kornelski is there any docs on compiling my own (universal) version of the Sparkle framework?

Exactly the same as for Intel, but you need to do it from Xcode with ARM support. The new Xcode beta does the right thing automatically.

  • Sparkle compiled only for Intel works only with Mac apps compiled only for Intel. Intel-only frameworks don't work with Universal apps.
  • Sparkle compiled only for ARM works only with Mac apps compiled only for ARM. ARM-only frameworks don't work with Universal apps.
  • Sparkle compiled as Universal binary works with Mac apps compiled as Universal binary, as well as Mac apps compiled only for Intel, as well as Mac apps compiled only for ARM.

Here's a bunch of issues I had to fix to make the project compile on a DTK running Big Sur 11.0 Beta (20A5323l), Xcode Version 12.0 beta 3 (12A8169g). Was in a hurry so I didn't dive deep into every issue yet.

All this was tested on master, last commit was https://github.com/sparkle-project/Sparkle/commit/1ff3ed7fad04eda1b29f37c138655db926d301b2

Hope this helps.

I recompiled xz from brew on arm and was able to build Sparkle directly in XCode without any further changes. On Beta3, but have to check XCode again. What went wrong for you without the changes?

@rknall Before changing the target to 10.9 I (rightly) have a

warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'Sparkle Test App' from project 'Sparkle')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'Autoupdate' from project 'Sparkle')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'fileop' from project 'Sparkle')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'bsdiff' from project 'Sparkle')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'BinaryDelta' from project 'Sparkle')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'Distribution' from project 'Sparkle')
** BUILD FAILED **

After changing it I (unexpectedly) get a

bash /Users/cesare/Desktop/Sparkle/Configurations/make-release-package.sh
cp: /var/folders/dt/_81ddhkj6pjbv_bxg3wx8gn40000gn/T/Sparkle.Ts97Mj/Build/Products/Release/BinaryDelta: No such file or directory
Command ExternalBuildToolExecution failed with a nonzero exit code

I removed Parallelized build, and ... voila', everything worked :)

Can't get the "ui-separation-and-xpc" branch to compile with Xcode 12 Beta 6 on Catalina 10.5.6:

`
make release

...
...

* BUILD FAILED *

The following build commands failed:
CompileSwift normal x86_64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
CompileSwift normal arm64
(3 failures)
make: * [release] Error 65
`

@lvandal I was able to fix these issues in #1659 to make the ui-separation-and-xpc branch work with Xcode 12.2 and produce an x86_64/arm64 framework build.

@rknall Sparkle _source code_ supports ARM already. Precompiled Sparkle binary releases on our GitHub releases page _don't_ support ARM yet. To get an ARM-compatible Sparkle, you have to compile a Universal Binary yourself.
We will be building for ARM and providing "fat binaries" later.

@kornelski I am very thankful for your work and don't want to put any pressure in here: But do you have a rough timeline in your mind, what "later" means? :)

If someone makes a pull request that adds fat binaries to make release build

If someone makes a pull request that adds fat binaries to make release build

@kornelski
as @paulz said, no code changes are needed. I checked with Xcode 12.2 released yesterday:
make release produces a framework which returns x86_64 arm64 for lipo -archs Sparkle.framework/Versions/A/Sparkle. So everything works and only a release is required.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tghs picture tghs  路  7Comments

ianbytchek picture ianbytchek  路  5Comments

teologov picture teologov  路  9Comments

mbacchi picture mbacchi  路  3Comments

gnachman picture gnachman  路  5Comments