-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
fix(packager): "packaging application" log never stops when building for multiple architectures #3006
fix(packager): "packaging application" log never stops when building for multiple architectures #3006
Conversation
…iple architectures There's some kinda complex race condition ish behaviour in the current way the packagerSpinner is handled. At the moment there's one variable for all architectures, that gets created in one of the later afterCopyHooks, and dismissed both in the first hook, and at the end of all the hooks. This would work if architectures where built for sequentially, but, at least on my system, these builds happen in parallel. Meaning one of the architectures packageSpinners overwrites the other, before the first is dismissed. At the end of the build the second packageSpinner has success fired on it, while the first continues to spin, preventing the process from exiting. The solution in this commit is far less than ideal. Constraints: - Without access to the list of architectures (the function to generate that list is not exported from electron-packer) we don't even know how many architectures we're building for. - This one is a little self-imposed, and maybe not a constraint for the project, but the code aims not to change any public facing apis. So we need to have one spinner we can pass to the postPackage hook. https://www.electronforge.io/configuration#postpackage Given these constraints the solution in this commit has one initial prepare / package spinner. AS well as prepare / package spinners per architecture. One downside is if the afterCopyHooks are executed one architecture at a time, instead of parallelized by architecture, the overarching prepareSpinner could be ended early, (though architecture specific prepare spinners would still be accurate).
Note: I'm not super happy with the way this came out. I'd really prefer to keep state around what's going on and assemble clear strings / limit us to one spinner at any time. Without the validateListFromOptions function from Tests are failing locally for me (I haven't looked into if that's because of my setup or the code changes), but if we want to move forward with this / a variant of this I'll make sure those work. |
I think the better solution looks something like this (psuedocode)
We pass the "final spinner" into As for the issue of knowing what arches we're building for, I think it makes sense for packager to help forge out a little here. I think a new hook in packager Thanks for tackling this one head on 😅 |
Though to be fair actually thinking about using |
I used to be able to build with |
Is this something that I / We / You can get added? |
@macdja38 I think this should let us do what we need to do: |
@MarshallOfSound yup that looks perfect! I'll update this PR to use that tonight! (EST) |
Updated to mostly match feedback. Preparing to package has been mostly removed. New logs once completed are:
In progress has platforms in it for now.
We can definitely remove the platform, not sure if it's helpful or not. (or we can add it to the completed messages) I included |
@macdja38 I took the liberty of rebasing your PR and updating it with the latest released electron-packager 😄 |
Summarize your changes:
Issue / minimal test case available here
There's some kinda complex race condition ish behaviour in the current way the packagerSpinner is handled.
At the moment there's one variable for all architectures, that gets created in one of the later afterCopyHooks, and dismissed both in the first hook, and at the end of all the hooks. This would work if architectures where built for sequentially, but, at least on my system, these builds happen in parallel. Meaning one of the architectures packageSpinners overwrites the other, before the first is dismissed. At the end of the build the second packageSpinner has success fired on it, while the first continues to spin, preventing the process from exiting.
The solution in this commit is far less than ideal.
Constraints:
Given these constraints the solution in this commit has one initial prepare / package spinner. AS well as prepare / package spinners per architecture.
One downside is if the afterCopyHooks are executed one architecture at a time, instead of parallelized by architecture, the overarching prepareSpinner could be ended early, (though architecture specific prepare spinners would still be accurate).