question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

electron-builder uses mksquashfs options that are incompatible with snap store

See original GitHub issue

I am a snap store reviewer. We’ve recently re-enabled our resquashfs tests and noticed that electron snaps are now failing automated review with messages like this:

Errors
------
 - security-snap-v2:squashfs_repack_checksum
	checksums do not match. Please ensure the snap is created with either 'snapcraft pack <DIR>' (using snapcraft >= 2.38) or 'mksquashfs <dir> <snap> -noappend -comp xz -all-root -no-xattrs -no-fragments'

At a high-level, the ‘resquash tests’ consist of unsquashing the uploaded snap, then running mksquashfs on it to generate a new snap, then checking the hash of the original and resquashed snaps. The store therefore expects that mksquashfs is invoked with expected options (a new enough snapcraft will do this for you with the ‘snapcraft pack’ command (the last step in a snapcraft build)).

Looking at an affected snap, I see that it is using a non-default blocksize:

$ unsquashfs -s ~/path/to/snap
...
Filesystem size 124212.66 Kbytes (121.30 Mbytes)
Compression xz
Block size 1048576
...

Looking at scripts/snap-template.sh in electron-builder, I see that it uses:

$ mksquashfs ~/squashfs-root /media/psf/test/electron-template-1.snap -b 1048576 -comp xz -Xdict-size 100% -noappend -comp xz -no-xattrs -no-fragments -all-root

The above adds -b 1048576 -comp xz -Xdict-size 100% to mksquashfs options, which causes the resquashed snap to have a different hash.

I’m not an electron-builder developer so I’m not sure how this template script affects normal builds, but I can say that if I unsquash the affected snap, then resquash using ‘snapcraft pack /path/to/squashfs-root’ that its superblock has:

$ unsquashfs -s /path/to/snap/with/expected/options 
...
Filesystem size 133439.50 Kbytes (130.31 Mbytes)
Compression xz
Block size 131072
...

and this resquashed snap passes review. I suspect you used the -b and -Xdict-size arguments to reduce the on disk file size, however this is incompatible with expected options for the snap store (due note that delta uploads and downloads should help with the larger file size of the expected options).

The bottom line is that in order for snap to pass snap store review, electron-builder needs to use ‘snapcraft pack <dir>’ with snapcraft >= 2.38 or generate squashfs files with only the supported options (ie, ‘mksquashfs <dir> <snap> -noappend -comp xz -all-root -no-xattrs -no-fragments’).

Thanks!

Reference: https://forum.snapcraft.io/t/automated-reviews-and-snapcraft-2-38/4982/8

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
develarcommented, Apr 19, 2018

Fixed in 20.9.2 and marked as latest stable release.

0reactions
jdstrandcommented, Apr 18, 2018

@develar - thanks for taking care of this! I’m not sure how electron-builder consumers get fixes like this. When will it be available to your users? (I’d like to add a message to our review-tools to point users to the new release).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automated reviews and snapcraft < 2.38
(at least) electron-builder is running mksquash manually with incompatible arguments; (at least) one partner is using snapcraft 2.35 to work ...
Read more >
Snap - electron-builder
The top-level snap key contains set of options instructing electron-builder on how it should build Snap. base String | “undefined” - A snap...
Read more >
Ubuntu 20.04 LTS' snap obsession has snapped me off of it
I think the last time the startup issue came up on HN we concluded it was because they are mounting a squashfs filesystem...
Read more >
Why is there so much negativity toward snap? : r/Ubuntu - Reddit
105 votes, 241 comments. Hey all, I'm a new Linux user, migrated from Windows a few months ago, and still getting used to...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/24 17 ...
... CFLAGS and LDFLAGS used during build" status:UNCONFIRMED resolution: severity:normal ... Bug:380389 - "ebuild skips EAPI unsupported phases silently" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found