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

Add fpm option to build script due to rpm upgrade issue #543

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Daeraxa
Copy link
Member

@Daeraxa Daeraxa commented May 20, 2023

This PR is an attempt to fix #544, first reported in https://github.com/orgs/pulsar-edit/discussions/178

It seems on upgrade the rpm is performing an uninstall to remove the pulsar script from /usr/bin but nothing puts it back.

The option picked was from:
https://www.electron.build/configuration/linux#linuxtargetspecificoptions-apk-freebsd-pacman-p5p-and-rpm-options
and
https://fpm.readthedocs.io/en/latest/cli-reference.html

@Daeraxa
Copy link
Member Author

Daeraxa commented May 20, 2023

This failed, still removing from /user/bin after upgrade.

So it looks like the options should be ok - builder-effective-config.yaml contains:

deb:
  afterInstall: script/post-install.sh
  afterRemove: script/post-uninstall.sh
rpm:
  afterInstall: script/post-install.sh
  afterRemove: script/post-uninstall.sh
  compression: xz
  fpm:
    - '--rpm-rpmbuild-define=_build_id_links none'
    - '--after-upgrade=script/post-install.sh'

Interestingly I saw this log on this system after electron-builder crashed, the next run failed to work and brings up, along with other stuff, this, which I think is the complete fpm command.

command=/home/dae/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86_64/fpm -s dir --force -t rpm -d gtk3 -d libnotify -d nss -d libXScrnSaver -d libXtst -d xdg-utils -d at-spi2-core -d libuuid --rpm-os linux --rpm-compression xzmt --architecture amd64 --after-install /tmp/t-5aWbQI/0-post-install.sh --after-remove /tmp/t-5aWbQI/1-post-uninstall.sh --description 'A Community-led Hyper-Hackable Text Editor' --version 1.105.0-dev --package /home/dae/pulsardev/pulsar/dist/pulsar-1.105.0-dev.x86_64.rpm --name pulsar --maintainer 'Pulsar-Edit <[email protected]>' --url 'https://github.com/pulsar-edit/pulsar#readme' --vendor 'Pulsar-Edit <[email protected]>' --rpm-summary 'A Community-led Hyper-Hackable Text Editor' --license MIT '--rpm-rpmbuild-define=_build_id_links none' --after-upgrade=script/post-install.sh /home/dae/pulsardev/pulsar/dist/linux-unpacked/=/opt/Pulsar /home/dae/pulsardev/pulsar/resources/icons/16x16.png=/usr/share/icons/hicolor/16x16/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/22x22.png=/usr/share/icons/hicolor/22x22/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/24x24.png=/usr/share/icons/hicolor/24x24/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/32x32.png=/usr/share/icons/hicolor/32x32/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/48x48.png=/usr/share/icons/hicolor/48x48/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/64x64.png=/usr/share/icons/hicolor/64x64/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/128x128.png=/usr/share/icons/hicolor/128x128/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/256x256.png=/usr/share/icons/hicolor/256x256/apps/pulsar.png /home/dae/pulsardev/pulsar/resources/icons/384x384.png=/usr/share/icons/hicolor/384x384/apps/pulsar.png /tmp/t-5aWbQI/2-Pulsar.desktop=/usr/share/applications/pulsar.desktop

The interesting parts are:
--after-install /tmp/t-5aWbQI/0-post-install.sh
--after-remove /tmp/t-5aWbQI/1-post-uninstall.sh
and
--after-upgrade=script/post-install.sh

The last is of interest as it indicates why the script doesn't get executed on --after-upgrade? Or am I barking up the wrong tree?

Other interesting reading:
https://github.com/electron-userland/electron-builder/blob/80a3ae857b9305aff1774e1b2b932601af50231b/packages/app-builder-lib/src/targets/FpmTarget.ts#L59-L62
https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/linux/after-install.tpl
https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/linux/after-remove.tpl

I don't know if I'm getting closer or further away...

Copy link
Contributor

@mauricioszabo mauricioszabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll trust that you tried this, and it worked 👍

@Daeraxa
Copy link
Member Author

Daeraxa commented May 30, 2023

No it didn't lol, I need to take this back to draft (although it didn't appear to break anything...)

This failed, still removing from /user/bin after upgrade.

@Daeraxa Daeraxa marked this pull request as draft May 30, 2023 00:35
@DeeDeeG
Copy link
Member

DeeDeeG commented Oct 17, 2024

I think we can close this PR, in my testing #1091 has finally resolved this issue!

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

Successfully merging this pull request may close these issues.

RPM upgrade process loses /usr/bin binary
3 participants