macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.47k stars 680 forks source link

included Sparkle in latest DMG has broken symlink #1366

Closed andlabs closed 1 year ago

andlabs commented 1 year ago

The latest version of MacVim includes a file Contents/Frameworks/Sparkle.framework/XPCServices, which is a symlink to Contents/Frameworks/Sparkle.framework/Versions/Current/XPCServices, but that file does not exist. (Since Current is technically a symlink to B, the equivalent file in B is also missing.)

This doesn't appear to be a problem in the normal user workflow of using Finder to install the package, but does break on unattended automated installation using a package manager we deploy internally to our fleet of Macs. (A recursive chmod chokes on the broken symlink.)

ychin commented 1 year ago

Right. We upgraded to Sparkle 2, and the framework contains XPCServices that Sparkle's documentation suggests that we can remove, which we do so in a script (it makes the binary size smaller and this way we won't accidentally turn it on). I missed the top-level symlink as you pointed out though (as in, the script should just delete the Contents/Frameworks/Sparkle.framework/XPCServices symlink as well).

I can fix that. Just curious though, what exactly is the automated installation doing and why does it need to recursively go inside an .app bundle to chmod them? Wouldn't the app "just work"?

Also, is this blocking the workflow for you guys then? Or were you able to work around it? I could release a pre-release version that allows you to deploy it faster if you want.

andlabs commented 1 year ago

We can work around this for now, yes.

The package manager copies the app bundle to a temporary directory, changes the owner from root to the user owner, restores the original permissions (overriding /tmp's umask), and then atomically moves the app bundle into /Applications, so that failed installs don't leave the machine in a broken state. (This is important since we also use it for distributing management software.)

ychin commented 1 year ago

I see, that's interesting to know. I didn't know MacVim is installed this way since I always assumed people mostly just grab a binary release for their own Mac or install via Homebrew.

If it's not blocking you for now, I'll just merge the PR that fixes it and it will be out in the next release, which should be 1.5-2 months from now (there may be pre-release builds in between as well).

andlabs commented 1 year ago

Thanks! Things get weird in enterprise settings compared to individual users, yes =P

ychin commented 1 year ago

This should be fixed for the latest release.