Skip to content

Commit

Permalink
Copy snap configuration from chromium’s snapcraft.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Nov 21, 2023
1 parent 5adc25b commit e2e0f88
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,22 @@ parts:
parse-info: [usr/share/appdata/mailspring.appdata.xml]
stage-packages:
- libxkbfile1
- libnss3
stage:
- -usr/lib/*/libsecret-*

cleanup:
after: [mailspring]
plugin: nil
build-snaps: [core22, gnome-42-2204]
override-prime: |
set -eux
build_snaps="core22 gnome-42-2204"
for snap in $build_snaps; do
cd "/snap/$snap/current" && \
find . -type f,l -exec rm -fv "$CRAFT_PRIME/{}" "$CRAFT_PRIME/usr/{}" \;
done
for CRUFT in bug lintian man; do
rm -rf $CRAFT_PRIME/usr/share/$CRUFT
done
find $CRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete -print
find $CRAFT_PRIME/usr/share -type d -empty -delete -print
libsecret:
source: https://gitlab.gnome.org/GNOME/libsecret.git
source-depth: 1
source-tag: '0.20.5'
plugin: meson
meson-parameters:
- --prefix=/usr
- -Dgtk_doc=false
- -Dmanpage=false
- -Dgcrypt=false
stage:
- usr/lib/*/libsecret-*

apps:
mailspring:
Expand Down

3 comments on commit e2e0f88

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented on e2e0f88 Nov 23, 2023

Choose a reason for hiding this comment

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

I don't think this change on libsecret is doing anything.

Since the one in gnome is already providing the same.

Also why the cleanup part has been removed? It should have been just added libsecret to after: list.

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented on e2e0f88 Nov 23, 2023

Choose a reason for hiding this comment

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

In fact reverting this commit I can still properly run mailspring from snap...

@bengotow
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey hey @3v1n0 - yeah I agree that these don't really seem like they are doing anything, I'm pretty stumped by what is going on here. Before these changes, a clean install of Ubuntu 22 (in a VM so I could retry this over and over and revert to a snapshot) could write to the password management service but not read the passwords it had written, causing it to reset your credentials every time the app launched. With this custom libsecret build in place, everything works fine.

It might be interesting to track down the git history of Chromium's snapcraft.yaml file and see why they added this stuff, but I wasn't able to find it in their code repository. (I just pulled this code from their snapcraft.yaml after installing the snap).

Unfortunately I think this stuff is a bit more finicky than it's supposed to be (or at least, somewhat dependent on the host environment?) If you can get a simpler version to work on a clean install of Ubuntu 22 I'd definitely revert this, but I'm no longer convinced it working means it'll work everywhere :-(

Please sign in to comment.