-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
Refs #1201: Parallelisation of calls to app signing for macOS #1216
Conversation
…gning is not guaranteed when parallelization is used
…erarchy and updated tests
…and (b) the grouping occurs in a predicable order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I've cleaned up a couple of code style issues that were causing a problem with CI, added a test for a failure case that wasn't being caught, and made a small tweak to how progress bars and group sorting are applied - but this is really solid! Thanks for the contribution!
futures = [] | ||
progress_bar = self.input.progress_bar() | ||
task_id = progress_bar.add_task("Signing App", total=len(names)) | ||
with progress_bar: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a new progress bar for every group/folder; there should be a single progress bar that is reused.
progress_bar = self.input.progress_bar() | ||
task_id = progress_bar.add_task("Signing App", total=len(names)) | ||
with progress_bar: | ||
for path in sorted(names, reverse=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sorts the files in folders, but it doesn't guarantee the folders themselves are in reverse order.
Changes
This PR speeds up signing of files. I tried building the BeeWare helloworld tutorial app sequentially, and then with the parallelised implementation. The sequential signing took about 10 seconds, while the parallelised one took around 2.4s according to my stopwatch.

PR Checklist:
Discussion needed: What parts of apps require signing to occur in a specific sequence, and if so, should parallelisation occur?
There are comments in the sign_app() function that state:
I am not sure about how strict this requirement is. If it is a strict requirement and lots of things might break because of not signing files in order, writing files sequentially may be the preferred implementation.
I tested my parallelised implementation with the BeeWare helloworld tutorial, which only uses Toga. I have not tested this on larger, more complex apps.
Fixes #1201