sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.37k stars 1.05k forks source link

Having 2 exactly the same archives gives unclear non-deterministic errors #2406

Closed mac-cain13 closed 1 year ago

mac-cain13 commented 1 year ago

Summary

Having 2 exactly the same zips in the app cast directory gives errors about files/archives/permissions not being correct. It's pretty unclear what's wrong when this happens, resulting in a very confusing and hard to troubleshoot experience.

Context

In our app cast folder we recently added App.zip which is a copy of the newest version of the app, App.zip is there as a convenience to have a stable URL to the latest version. While releasing a new version we put App-0.2.0.zip in the folder and copied it to App.zip. We expected to be able to just run generate app cast as usual, but got errors.

Reproduction path

  1. Create a new release of the app & put it in place as usual, for example App-0.2.0.zip
  2. Copy this file to App.zip in the same folder
  3. Run generate_appcast

Expected:

Actual: An error that varies every run, caused probably by 2 tasks extracting parallel into the same directory. Errors often are about files not being there, already being there or having incorrect permissions. Also an error about being unable to extract the archive is logged.

Possible Fix

A clear error would be great by detecting there are two files that resolve to the same hash that is used for the temporary folder.

Version

Sparkler 2.4.2

zorgiepoo commented 1 year ago

Indeed, I think we should make this a hard error. generate_appcast has some logic for moving aside old updates and not including them in the appcast so I don't think there's a good way to handle just ignoring duplicate archives like this. Your "stable" release can be in a different directory. I think even a subdirectory of this appcast folder would work since subdirectories should be ignored by the tool.

mac-cain13 commented 1 year ago

A hard error indicating that 2 exact same releases are not being supported would have really helped a lot indeed. Having the "stable" release in a different directory is no issue at all.

This main problem really is that it was very unclear what caused the issue and how to resolve it. Not so much that this isn't supported.