Skip to content
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

Parallelise calls to app signing #1201

Closed
freakboy3742 opened this issue Apr 22, 2023 · 2 comments · Fixed by #1216
Closed

Parallelise calls to app signing #1201

freakboy3742 opened this issue Apr 22, 2023 · 2 comments · Fixed by #1216
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start! macOS The issue relates to Apple macOS support.

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

When signing a macOS app, briefcase needs to sign each individual .so file. This is currently being done sequentially, which can take a while.

Describe the solution you'd like

Briefcase should parallelise the calls to sign individual files in the bundle, with the degree of parallelisation reflecting the number of CPUs available on the machine.

Describe alternatives you've considered

Do nothing. Single threading works; it's just slower.

Additional context

ThreadPoolExecutor should be a fairly approachable way to implement this.

@freakboy3742 freakboy3742 added enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start! macOS The issue relates to Apple macOS support. labels Apr 22, 2023
@xairos
Copy link

xairos commented Apr 24, 2023

I'd like to sprint on this!

@nondescryptid
Copy link
Contributor

Hi! I currently have a draft PR for this. It's a draft as I noticed that there are comments in the sign_app() function at src > briefcase > platforms > macOS > init.py that mention:

# Signs code objects in reversed lexicographic order to ensure nesting order is respected
# (objects must be signed from the inside out)

I am not sure of how strict this rule is, and what dependencies/other things rely on this rule being followed. 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 even if it is slower.
I tested my parallelised implementation with the BeeWare helloworld tutorial, which only uses Toga. The parallelised implementation works on the helloworld tutorial app, but I'm not sure if it'll still work on apps that use more than just Toga.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start! macOS The issue relates to Apple macOS support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants