cleanbuild (through lxd)

Bug #1480144 reported by Simon Eisenmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Wishlist
Sergio Schvezov

Bug Description

I was trying out snapcraft current head and found that it is not the tool i can use at the moment, as i cannot compile everything quickly on the target architecture in a clean environment.

For debian packages we use a combination of cowbuilder, cowdancer and pbuilder to provide clean repeatable build environment on the various target environments.

It should be evaluated how building of snaps can be integrated with gear like that so it is possible to build snaps with similar gear. Ultimatively something like "ARCH=armhf snapcraft --cowbuilder ..." should produce snaps using the defined environment.

Tags: wishlist
Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1480144] [NEW] Snapcraft should be able to run in clean environment with pbuilder/cowbuilder

Thanks for the feedback, Simon.

We want to support both a developer-centric "quick iterative build"
experience, and a "clean-room build". The former would be aimed at
code-compile-run iteration, and probably wants to happen in a native
environment (rather than via an emulator) on a laptop, the latter is
probably best done in a clean, repeatable VM or build farm.

I think your report is about the latter, in which case I agree we want
to support a "ship this snap off for building cleanly" experience.

Can you comment on the iterative use case?

Mark

Revision history for this message
Simon Eisenmann (longsleep) wrote : Re: Snapcraft should be able to run in clean environment with pbuilder/cowbuilder

Hi Mark,

I am indeed referring for a repeatable build environment for clean-room builds required to ship stable releases.

Though i think it is kind of the same for developer builds. Developer machines might have different versions of system components not compatible with the snap one wants to build and might want to build even quick iterative builds inside a designated environment.

For example in my current case i am developing on amd64 but the snap needs building for armhf. I could set up a specific compile armhf system, though that would get bloated quickly and needs rollback all the time again (which is a pain). For debian packages we have an armhf compile cluster which makes use of generic cowbuilder environments for building - so the cluster stays clean as the build environment is created from image and destroyed after building.

Thus it would be nice to have something similar to snapcraft, so the developer can provide the environment to use with a bunch of commandline parameters / environment variables.

For now i wrote my own snapcraft plugin which can download compiled deb files independent from the current system. That way i get clean builds using gear for deb files and merge them together using snapcraft. That even works cross arch. I can open up a merge request for that plugin if you think that is something others could make use of.

Simon

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1480144] Re: Snapcraft should be able to run in clean environment with pbuilder/cowbuilder

hi Simon

Your plugin sounds very useful, please do contribute it!

Thanks,
Mark

Revision history for this message
Simon Eisenmann (longsleep) wrote : Re: Snapcraft should be able to run in clean environment with pbuilder/cowbuilder

Hi Mark, yes I already did that - see https://code.launchpad.net/~longsleep/snapcraft/snapcraft-debs-plugin/+merge/266650 for the merge request. I used it to build a Spreed Webrtc snap for armhf on amd64. It passed automatic store review - so Cceck it out with your snappy armhf device.

Best regards,
Simon

Michael Vogt (mvo)
affects: snappy → snapcraft
Changed in snapcraft:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Leo Arias (elopio) wrote :
Changed in snapcraft:
status: Triaged → Invalid
Changed in snapcraft:
status: Invalid → Triaged
summary: - Snapcraft should be able to run in clean environment with
- pbuilder/cowbuilder
+ cleanbuild (through lxd)
Changed in snapcraft:
milestone: none → 2.2
Changed in snapcraft:
importance: High → Wishlist
Changed in snapcraft:
assignee: nobody → Sergio Schvezov (sergiusens)
status: Triaged → In Progress
Changed in snapcraft:
milestone: 2.2 → none
Changed in snapcraft:
milestone: none → next
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.