mackup icon indicating copy to clipboard operation
mackup copied to clipboard

Symlinks replaced by applications (for Library/Preferences)

Open jonasdiemer opened this issue 3 years ago • 15 comments

Hi,

I noticed that applications like BetterTouchTool and iTerm2 replace the symlinks created by mackup in ~/Library/Preferences/ with physical copies of the config files.

Is this expected? Would mackup restore still allow me to sync preferences to a device?

Regards Jonas

jonasdiemer avatar Sep 01 '22 07:09 jonasdiemer

I don't think it's expected, but I know there have been issues with some applications where they manually override the symbolic link.

I don't think we've found a way to fix this as it's the application doing it, which we have no control over.

@lra any suggestions? We'll probably want to do some tests before deciding what to do.

joshmedeski avatar Sep 01 '22 16:09 joshmedeski

For anyone facing the same issue with iTerm2, a quick workaround would be to say iTerm2 to store the configuration in a custom folder, e.g. ~/.config/iterm2. Then, use a custom iterm2-ext-config.cfg :

[application]
name = iTerm2-ext-config

[xdg_configuration_files]
iterm2

Unfortunately, this approach works only for iTerm, and if an app keeps replacing a symbolic link with a file in, and there's no way to isolate that file in a separate folder, I'm afraid there's nothing can be done here.

azuenko avatar Sep 07 '22 15:09 azuenko

Found some discussions on how to approach it here: https://apple.stackexchange.com/questions/385102/how-to-properly-symlink-files-in-the-library-preferences

One option might be to lock the file (chflags nouchg).

jonasdiemer avatar Sep 09 '22 07:09 jonasdiemer

I've also had this with a number of applications,

  • Spotify
  • Telegram
  • Apple Terminal
  • Transmit (non-MAS version)
  • Raycast
  • IINA (media player)

Whenever I launch any of those on either of the two machines I am syncing, the alias to the plist in ~/Library/Preferences is deleted and replaced with a plist.

I'm using iCloud as a storage destination. Curious whether anyone else in this thread is also using iCloud?

gridsystem avatar Sep 28 '22 14:09 gridsystem

This behavior has nothing to do with the storage destination (iCloud or whatever), as the symlink that is overwritten lies on the "source storage".

jonasdiemer avatar Sep 28 '22 14:09 jonasdiemer

I imagine iCloud adds some quirks given that iCloud files can be changed to online-only automatically. I don't know much about how apps interface with .plists but I was wondering if the apps listed might be deleting aliases to online-only files and replacing with new .plists.

gridsystem avatar Sep 28 '22 15:09 gridsystem

No, the symlinks that are put in place of the plist files have nothing to do with the storage destination - they simply point to another path in the filesystem (AFAIK).

I am seeing the same issue with using GitHub (i.e. folder) destination.

jonasdiemer avatar Sep 28 '22 15:09 jonasdiemer

Is it fair to assume this might lead to Mackup being obsolete?

gridsystem avatar Nov 11 '22 11:11 gridsystem

Is it fair to assume this might lead to Mackup being obsolete?

If every application and OS decide to throw away the POSIX concept of file linking, yes. But before it happens, the strategy has always been to remove support for those impacted applications in Mackup.

lra avatar Nov 11 '22 11:11 lra

This seems like something that already is quite common. Are these suggestions valid?

Found some discussions on how to approach it here: https://apple.stackexchange.com/questions/385102/how-to-properly-symlink-files-in-the-library-preferences

One option might be to lock the file (chflags nouchg).

I really want to help on this but I don't know any python. I am tempted to see if I could build a node version that works with mackup's cfg files but it would be a huge investment just to get to the point I could even try addressing this issue so I'm going to fight the urge!

gridsystem avatar Nov 11 '22 14:11 gridsystem

This appears to me to be specific to MacOS Ventura (13) - I don't appear to observe this issue on older releases

anthonysomerset avatar Dec 01 '22 13:12 anthonysomerset

This appears to me to be specific to MacOS Ventura (13) - I don't appear to observe this issue on older releases

I was having this issue on Monterey

gridsystem avatar Dec 04 '22 14:12 gridsystem

This appears to me to be specific to MacOS Ventura (13) - I don't appear to observe this issue on older releases

If it would be as easy as adding that chflags nouchg operation, then I hope it will be added soon :)

Morriz avatar Dec 16 '22 14:12 Morriz

Is there anything in place for donating or sponsoring this to be worked on?

gridsystem avatar Dec 19 '22 15:12 gridsystem

Owner of Raycast start to remove sync options without anybody notice because of this issue: https://github.com/lra/mackup/issues/1980#issuecomment-1884729862 @gridsystem have right. Applications may have they own solution that block copy operation but it seams that is system issue. Maybe is there change in apple ecosystem about handling settings

Triloworld avatar Jan 25 '24 22:01 Triloworld