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

feat: implement autoupdates for pacman #8394

Merged
merged 17 commits into from
Oct 6, 2024

Conversation

xyloflake
Copy link
Contributor

@xyloflake xyloflake commented Aug 3, 2024

Introducing autoupdate support for pacman!

I have updated docs & tests plus ran all tests.

I have also pushed an update to the pnpm lockfile which was auto-generated during pnpm update

Copy link

changeset-bot bot commented Aug 3, 2024

🦋 Changeset detected

Latest commit: ae32d77

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
app-builder-lib Major
electron-updater Minor
dmg-builder Major
electron-builder-squirrel-windows Major
electron-builder Major
electron-forge-maker-appimage Major
electron-forge-maker-nsis-web Major
electron-forge-maker-nsis Major
electron-forge-maker-snap Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Aug 3, 2024

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit ae32d77
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/6702ccb8aa396700086875e3
😎 Deploy Preview https://deploy-preview-8394--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@xyloflake
Copy link
Contributor Author

@mmaietta @beyondkmp Is this normal?
image
I only added minor bumps for app-builder-lib and electron-updater as is evident by e0f41a8

@xyloflake
Copy link
Contributor Author

xyloflake commented Aug 3, 2024

As has been discussed in #8370, here's my PR @mmaietta!

@mmaietta
Copy link
Collaborator

mmaietta commented Aug 6, 2024

Nice work @xyloflake! I'm going to work on getting a new release set up on my electron-builder-test repo so that we can have the test pacman download test pass

@xyloflake
Copy link
Contributor Author

xyloflake commented Aug 6, 2024

Nice work @xyloflake! I'm going to work on getting a new release set up on my electron-builder-test repo so that we can have the test pacman download test pass

Yay! Thank you!

As I can see, the tests fails at the Pacman test. I can't seem to figure out what went wrong.

Edit: Figured it out. It fetches the executables from your electron-builder-test repo and it can't verify on pacman because the executable for pacman was never built. I've made a PR to make your work easier. You just need to run a github action for the release now :)

@xyloflake
Copy link
Contributor Author

@mmaietta should this PR result in major or minor version bump? I think minor as according to semver the minor in MAJOR.MINOR.PATCH must be incremented when a new feature is implemented?

@xyloflake
Copy link
Contributor Author

@mmaietta Hi, I wanted to give you an update on the asynchronous install PR—it's about 70% complete, and I'm in the phase of making and testing changes. I've realized that this PR will require another modification once the asynchronous PR is ready because the doInstall functions need to be asynchronous.

The challenge is that I'm working on both PRs simultaneously. To avoid conflicts, one of these PRs will need to be merged after the other. Should I commit the necessary changes for doInstall in this PR or the other one?

This reverts commit 8fc4c1c.
@mmaietta
Copy link
Collaborator

mmaietta commented Aug 8, 2024

It should be a minor bump. I'll take a look into why the Changelog CI action is showing up as a major bump. Nothing immediately stands out to me though

Regarding the rollout of this autoupdate feature. I think you'll need to do 2 releases, one with the initial pacman release with electron-updater pacman support integrated, then another release to actually trigger the pacman autoupdate feature.

Re: the doInstall logic needing to be async. Sounds like we need the async PR merged first (which I need to take a deeper review of), then we can circle back to this PR so you can merge in the latest master from that point?

@xyloflake
Copy link
Contributor Author

It should be a minor bump. I'll take a look into why the Changelog CI action is showing up as a major bump. Nothing immediately stands out to me though

Got it! Thanks.

Regarding the rollout of this autoupdate feature. I think you'll need to do 2 releases, one with the initial pacman release with electron-updater pacman support integrated, then another release to actually trigger the pacman autoupdate feature.

That is absolutely correct, you need to make a release for 1.0.4 with initial Pacman support and then 1.0.5 for testing the update.

Re: the doInstall logic needing to be async. Sounds like we need the async PR merged first (which I need to take a deeper review of), then we can circle back to this PR so you can merge in the latest master from that point?

Seems like the most appropriate thing to do! I'm completely okay with that :)

@xyloflake
Copy link
Contributor Author

@mmaietta can we merge this instead? And change it for pacman in the other PR.

@mmaietta
Copy link
Collaborator

@xyloflake how can I test this locally on a linux VM? Preferably via Parallels Desktop. I trust your testing, but I feel I should still give it a look once-over

@xyloflake
Copy link
Contributor Author

xyloflake commented Aug 13, 2024

@xyloflake how can I test this locally on a linux VM? Preferably via Parallels Desktop. I trust your testing, but I feel I should still give it a look once-over

You need some arch linux or derivative linux distro to support pacman. Otherwise there's no other way. If you want, I can give you remote access to my arch machine but we'd need to be in a call then because testing it is complicated. However I 100% do guarantee that this is not flawed and has been appropriately tested.

If you do want to use a linux VM, you need the arch VM

@xyloflake
Copy link
Contributor Author

xyloflake commented Aug 13, 2024

@mmaietta Alright I'll write up the instructions for once you get an arch VM up and running. Please use pnpm as patches are easier to configure. And most importantly, find out a way to display your version in the electron app before doing all of this as to confirm that update was indeed successful.

  1. Create a sample electron app with electron builder support
  2. Patch/Use yalc to link this PR's electron-updater and app-builder-lib for usage in the electron app
  3. For patching you may use pnpm patch app-builder-lib and similarly for electron-updater
  4. Configure feedurl provider to be generic and url being http://127.0.0.1:8080.
  5. pnpm i -g http-server
  6. http-server -p 8080 - of course you can change the port according to your preference but if you do, change it in 4th step as well
  7. Build one version as pnpm build --linux pacman - I'm assuming you've set up the build script.
  8. After completion, install first version with pacman -U yourapp.pacman
  9. Then build another version after changing version in package.json
  10. Open the first app after completion and relaunch if already running
  11. You will receive a notification saying that update is ready and will be installed once you quit
  12. Quit the application
  13. Enter password (you need to have a desktop environment setup btw)
  14. Relaunch the app and check version

@xyloflake
Copy link
Contributor Author

@xyloflake how can I test this locally on a linux VM? Preferably via Parallels Desktop. I trust your testing, but I feel I should still give it a look once-over

Sorry I do not know how Parallel Desktop works and I haven't personally used it. But you'd need to setup an arch vm somehow to test this. And let me warn you before you try: installing arch is one of the most complicated things to do. One wrong command like using archinstall instead of the documented commands might break your system and drive. It's overwhelmingly frustrating and time consuming. It took me about 1.5 hours to get arch up and running.

If you have the time, patience and can afford breaking your system, I'll be happy to help. Otherwise this can go through an alpha version and once it's considered stable, we can make it beta.

@xyloflake
Copy link
Contributor Author

I can upload a video proof of updation taking place if you want as well. My colleague @gamersi has also tested it on 2 different devices.

@gamersi
Copy link

gamersi commented Aug 13, 2024

@xyloflake how can I test this locally on a linux VM? Preferably via Parallels Desktop. I trust your testing, but I feel I should still give it a look once-over

Sorry I do not know how Parallel Desktop works and I haven't personally used it. But you'd need to setup an arch vm somehow to test this. And let me warn you before you try: installing arch is one of the most complicated things to do. One wrong command like using archinstall instead of the documented commands might break your system and drive. It's overwhelmingly frustrating and time consuming. It took me about 1.5 hours to get arch up and running.

If you have the time, patience and can afford breaking your system, I'll be happy to help. Otherwise this can go through an alpha version and once it's considered stable, we can make it beta.

On a VM you can just use archinstall, works 9/10 times as there is just one disk. Where archinstall is really bad is with custom disk configurations which you don't have on a VM.

@Bug-Reaper
Copy link

Happy to test w/Arch on real hardware if needed (been daily-driving arch since 2012).

@xyloflake
Copy link
Contributor Author

We're investigating having it as an async process in a detached shell, however, it breaks NSIS updaters currently. It's a future project but I have bigger fish to fry atm 😅

I think you're talking about me lol. I'm the one who opened that draft PR and reported NSIS isn't working.

@xyloflake
Copy link
Contributor Author

@mmaietta are you talking about #8405? In that case, that'd be me 😄

@mmaietta
Copy link
Collaborator

mmaietta commented Oct 2, 2024

Haha yep, that's you. My bad 😅

@beyondkmp any feedback on this PR? Otherwise, I think it may be good to merge. (Still trying to figure out how to get a minor semver bump without it being a major semver update per the changesets CI - right now I've set it to patch for app-builder-lib, but ideally this should be a minor bump)

@xyloflake
Copy link
Contributor Author

Haha yep, that's you. My bad 😅

No problem 😄

I'll be working on it after my exams, which are keeping me busy atm but thank you for the acknowledgement.

@xyloflake
Copy link
Contributor Author

@mmaietta can we merge then?

@xyloflake
Copy link
Contributor Author

@mmaietta ?

@beyondkmp
Copy link
Collaborator

Haha yep, that's you. My bad 😅

@beyondkmp any feedback on this PR? Otherwise, I think it may be good to merge. (Still trying to figure out how to get a minor semver bump without it being a major semver update per the changesets CI - right now I've set it to patch for app-builder-lib, but ideally this should be a minor bump)

LGTM.

@beyondkmp beyondkmp requested review from beyondkmp and removed request for beyondkmp October 5, 2024 05:28
beyondkmp
beyondkmp previously approved these changes Oct 6, 2024
@beyondkmp
Copy link
Collaborator

@mmaietta If you don't have any other questions, I will merge this in.

@mmaietta mmaietta merged commit ae9221d into electron-userland:master Oct 6, 2024
13 checks passed
@beyondkmp
Copy link
Collaborator

@xyloflake Can we refer to macOS's incremental upgrade and see if it's possible to implement incremental upgrades on Linux as well?

@xyloflake
Copy link
Contributor Author

@xyloflake Can we refer to macOS's incremental upgrade and see if it's possible to implement incremental upgrades on Linux as well?

Hello again! I'll have a look at the incremental update code just to make sure I know what we're working with, to make sure that I can tell how complex it would be. @beyondkmp

@xyloflake
Copy link
Contributor Author

xyloflake commented Oct 7, 2024

@beyondkmp at a first glance, nothing in the differential update code seems to contain macOS specific code. It should be migratable to linux kind of easily.

That being said, it might not be as easy if we try to implement it. I'll take a look whenever I can and will open a PR if I succeed, sounds good?

@beyondkmp
Copy link
Collaborator

@beyondkmp at a first glance, nothing in the differential update code seems to contain macOS specific code. It should be migratable to linux kind of easily.

That being said, it might not be as easy if we try to implement it. I'll take a look whenever I can and will open a PR if I succeed, sounds good?

Great.

mmaietta pushed a commit that referenced this pull request Jan 26, 2025
## 26.0.0

### Major Changes

-
[#8782](#8782)
[`633490cb`](633490c)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: removing
conditional logic that would build HFS+ dmg on non-arm64 macs as HFS+
was sunset in macos 15.2
-
[#8582](#8582)
[`6a9597b4`](6a9597b)
Thanks [@mmaietta](https://github.com/mmaietta)! - chore: remove
deprecated fields from `winOptions` and `macOptions`. (For `winOptions`
signing configuration, it has been moved to `win.signtoolOptions` in
order to support `azureOptions` as a separate field and avoid bloating
`win` configuration object. For `macOptions`, notarize options has been
deprecated in favor of env vars for quite some time. Env vars are much
more secure)
-
[#8572](#8572)
[`0dbe357a`](0dbe357)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: allowing
additional entries in .desktop file, such as `[Desktop Actions
<actionName>]`. Requires changing configuration `desktop` property to
object to be more extensible in the future
-
[#8562](#8562)
[`b8185d48`](b8185d4)
Thanks [@beyondkmp](https://github.com/beyondkmp)! - support including
node_modules in other subdirectories

### Minor Changes

-
[#8787](#8787)
[`cdf18d9a`](cdf18d9)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: add `pwsh`
detection to enable azure trusted signing within docker image
-
[#8711](#8711)
[`6f0fb8e4`](6f0fb8e)
Thanks [@hrueger](https://github.com/hrueger)! - Add `host` property to
support self-hosted Keygen instances
-
[#8636](#8636)
[`88cc0b06`](88cc0b0)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: add support for
AppArmor with template profile and configuration property
-
[#8609](#8609)
[`d672b04b`](d672b04)
Thanks [@iongion](https://github.com/iongion)! - feat: support
completely custom AppxManifest.xml
-
[#8607](#8607)
[`f123628c`](f123628)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: allow disabling
of building a universal windows installer
-
[#8588](#8588)
[`8434e10d`](8434e10)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: adding
integration with @electron/fuses
-
[#8570](#8570)
[`c8484305`](c848430)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: migrate to
official `electron/asar` packaging
-
[#8525](#8525)
[`13f55a3e`](13f55a3)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat: migrate
`electronDist` to be an electron-builder `Hook`
-
[#8394](#8394)
[`ae9221d9`](ae9221d)
Thanks [@xyloflake](https://github.com/xyloflake)! - feat: Implement
autoupdates for pacman
-
[#8741](#8741)
[`eacbbf59`](eacbbf5)
Thanks [@0xlau](https://github.com/0xlau)! - Add `forcePathStyle` option
to S3Options

### Patch Changes
-
[#8575](#8575)
[`dfa35c32`](dfa35c3)
Thanks [@doctolivier](https://github.com/doctolivier)! - chore(deps):
update @electron/rebuild to v3.7.0
-
[#8576](#8576)
[`3eab7143`](3eab714)
Thanks [@beyondkmp](https://github.com/beyondkmp)! - fix: packages in
the workspace not being under node_modules
-
[#8577](#8577)
[`e9eef0c1`](e9eef0c)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: add additional
default exclusions to copy logic
-
[#8596](#8596)
[`e0b0e351`](e0b0e35)
Thanks [@mmaietta](https://github.com/mmaietta)! - chore: refactor files
for publishing to electron-publish
-
[#8601](#8601)
[`215fc36b`](215fc36)
Thanks [@mmaietta](https://github.com/mmaietta)! - Revert "fix(win): use
appInfo description as primary entry for FileDescription" to resolve
[#8599](#8599)
-
[#8603](#8603)
[`712a8bce`](712a8bc)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: checking
relative path without separator as that doesn't work on Windows
-
[#8604](#8604)
[`d4ea0d99`](d4ea0d9)
Thanks [@beyondkmp](https://github.com/beyondkmp)! - chore(deps): update
app-builder-bin to 5.0.0-alpha.11
-
[#8606](#8606)
[`a0e635c1`](a0e635c)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: add quotes to
surround file path during azure signing to handle files with spaces
-
[#8627](#8627)
[`2a3195d9`](2a3195d)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: add rfc3161
timestamp entry as default for azure signing to resolve Windows Defender
alert
-
[#8631](#8631)
[`dcd91a1f`](dcd91a1)
Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - fix:
Remove path from published binaries
-
[#8632](#8632)
[`645e2abd`](645e2ab)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: only sign
concurrently when using local signtool. azure can't be in parallel due
to resources being locked during usage
-
[#8637](#8637)
[`667ab2f8`](667ab2f)
Thanks [@mmaietta](https://github.com/mmaietta)! - chore: migrate
default recommends and default depends for fpm from app-builder-bin to
JS code
-
[#8645](#8645)
[`f4d40f91`](f4d40f9)
Thanks [@beyondkmp](https://github.com/beyondkmp)! - fix: smart unpack
for local module with dll
-
[#8653](#8653)
[`796e1a07`](796e1a0)
Thanks [@IsaacAderogba](https://github.com/IsaacAderogba)! - fix:
cscIKeyPassword must support empty string arguments
-
[#8654](#8654)
[`9e11358f`](9e11358)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: check
ResolvedFileSet src when verifying symlinks to be within project
directory
-
[#8661](#8661)
[`6a294c97`](6a294c9)
Thanks [@t3chguy](https://github.com/t3chguy)! - chore: remove stale
handler for `extend-info` in electronMac plist creation
-
[#8689](#8689)
[`1d7f87c1`](1d7f87c)
Thanks [@Lemonexe](https://github.com/Lemonexe)! - fix(win): corrupt
asar integrity file path on crossplatform build
-
[#8693](#8693)
[`6a6bed46`](6a6bed4)
Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps):
update dependency cross-spawn to v7.0.5 [security]
-
[#8714](#8714)
[`66334502`](6633450)
Thanks [@kttmv](https://github.com/kttmv)! - chore: Remove informal
Russian messages in the NSIS installer
-
[#8715](#8715)
[`4c394d54`](4c394d5)
Thanks [@beyondkmp](https://github.com/beyondkmp)! - fix: does not work
with NPM workspaces
-
[#8717](#8717)
[`9381513d`](9381513)
Thanks [@beyondkmp](https://github.com/beyondkmp)! - fix(deps): update
dependency eslint to v9.16.0 [security]
-
[#8783](#8783)
[`a5558e33`](a5558e3)
Thanks [@mmaietta](https://github.com/mmaietta)! - chore(deps): upgrade
cross spawn 7.0.6
-
[#8805](#8805)
[`c6d6b6e5`](c6d6b6e)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: ASAR files in
extraResources are not included in integrity calculations
-
[`a1ee0419`](a1ee041)
Thanks [@mmaietta](https://github.com/mmaietta)! - fix: use FileCopier
for copying files and queue creation of symlinks

## electron-updater 6.4.0

### Minor Changes

-
[#8711](#8711)
[`6f0fb8e4`](6f0fb8e)
Thanks [@hrueger](https://github.com/hrueger)! - Add `host` property to
support self-hosted Keygen instances
-
[#8633](#8633)
[`96f5c3eb`](96f5c3e)
Thanks [@mmaietta](https://github.com/mmaietta)! - feat(updater): allow
usage of `autoRunAppAfterInstall` on mac updater
-
[#8394](#8394)
[`ae9221d9`](ae9221d)
Thanks [@xyloflake](https://github.com/xyloflake)! - feat: Implement
autoupdates for pacman

### Patch Changes

-
[#8802](#8802)
[`4a68fd2d`](4a68fd2)
Thanks [@erijo](https://github.com/erijo)! - fix(linux): AppImage update
fails when filename contains spaces
-
[#8623](#8623)
[`cfa67c01`](cfa67c0)
Thanks [@DamonYu6](https://github.com/DamonYu6)! - fix: copyFileSync
operation will block the main thread
-
[#8695](#8695)
[`819eff7b`](819eff7)
Thanks [@peter-sanderson](https://github.com/peter-sanderson)! - fix:
respect `disableDifferentialDownload` flag for AppImage
@mmaietta
Copy link
Collaborator

@xyloflake just a heads up since I think you were using a patch file while electron-updater was in alpha. It's been fully released to next tag, most recent release is 6.4.1.

@xyloflake
Copy link
Contributor Author

@xyloflake just a heads up since I think you were using a patch file while electron-updater was in alpha. It's been fully released to next tag, most recent release is 6.4.1.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants