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

snap: set compression to lzo, #117852 #118116

Merged
merged 1 commit into from
Mar 8, 2021
Merged

Conversation

soredake
Copy link
Contributor

@soredake soredake commented Mar 4, 2021

@joaomoreno joaomoreno added this to the March 2021 milestone Mar 8, 2021
@joaomoreno joaomoreno merged commit e22c2be into microsoft:main Mar 8, 2021
@joaomoreno
Copy link
Member

Thanks!

@soredake soredake deleted the patch-1 branch March 8, 2021 15:26
RMacfarlane pushed a commit that referenced this pull request Mar 9, 2021
@RMacfarlane
Copy link
Contributor

I've temporarily reverted this since the builds are failing with "Issues while validating snapcraft.yaml: Additional properties are not allowed ('compression' was unexpected)". We're using snapcraft version 4.4.4, I suspect we just need to update to the newest version

@joaomoreno
Copy link
Member

This is strange, since it should be supported according to canonical/snapcraft@48c8047

image

@soredake
Copy link
Contributor Author

Any progress on this?

@joaomoreno
Copy link
Member

Feel free to do some investigation why this doesn't seem to work from the docker image we're using:

image: snapcore/snapcraft:stable

@soredake
Copy link
Contributor Author

Feel free to do some investigation why this doesn't seem to work from the docker image we're using:

image: snapcore/snapcraft:stable

Dunno what's wrong, i've successfully built snap with lzo compression in stable container.

@anonymouse64
Copy link
Contributor

just a note that if you are unable to upgrade the version of snapcraft you are using, you can always just use the passthrough key for situations like this:

name: code
version: ....

passthrough:
  compression: lzo

see https://snapcraft.io/docs/using-in-development-features

@soredake
Copy link
Contributor Author

#119067

@joaomoreno
Copy link
Member

joaomoreno commented Mar 17, 2021

I've used passthrough in https://github.com/microsoft/vscode/tree/joao/retry-pr-118116 and that didn't work:

$ unsquashfs -s code-insider-x64-1615902963.snap | grep Compression
Compression xz

I'm currently reaching out to the Snap team via e-mail. Will let you know the outcome.

@anonymouse64
Copy link
Contributor

@joaomoreno ah yeah that's correct that the compression setting is only consumed by snapcraft and not by snapd sorry about that ...

However, if you still are unable to upgrade the version of snapcraft you are using to build with to one that supports the compression setting, you can manually change it by doing something like this:

$ snapcraft prime
... gives you the prime directory which is everything that goes into the snap
$ snap pack --compression=lzo prime
... gives you a LZO compressed snap

@joaomoreno
Copy link
Member

@anonymouse64 I really wouldn't know how to do that since we just call snapcraft:

(cd $SNAP_ROOT/code-* && sudo --preserve-env snapcraft snap $SNAPCRAFT_TARGET_ARGS --output "$SNAP_PATH")

PR welcome!

@anonymouse64
Copy link
Contributor

@joaomoreno Ah so this is actually a snapcraft working as "intended", VS code is not using base: in it's snapcraft.yaml, so it is getting built with the legacy version of snapcraft which does not get feature updates and thus doesn't understand compression. I think the best way to fix this is for you to add base: core to your snapcraft.yaml, then make sure the snap still works (as you might have to change a few things in the snapcraft.yaml to accommodate slightly stricter rules about things that the new version of snapcraft requires), and then after that change the snapcraft.yaml to use compression: lzo.

@joaomoreno
Copy link
Member

Right, if that's the way to go, we're gonna have to wait. TBH doing big updates on snap has always been quite the adventure with an often large tail of issues. I've created this as a follow-up: #119436

@anonymouse64
Copy link
Contributor

@joaomoreno I understand, in the meantime I can try and submit a PR changing your build script as linked to do the snap pack workaround instead, I don't know how to test out the changes locally but it looks straight forward and it should be run as part of a PR I open, correct? Anyways, perhaps we can continue discussion on the PR I will open momentarily changing your build script...

@joaomoreno
Copy link
Member

Merged #119478

@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux Snap package startup speed
4 participants