Plugin overview on specific assumed build environment

design

#1

This is the list of Ubuntu high level specific assumptions found in plugins to aid in the work needed to reach the consistent build environment work ahead using build VMs.

No portability issues describe in the text below exclude potential issues with the python interpreter driving snapcraft itself on the target build environment.

All the plugins are mostly straight forward fixes except for the ROS specific ones (i.e.; ament, catkin, catkin-tools).

ament

  • This plugin is very debian package specific.
  • Requires ROS sources.list

ant

build-packages

  • ant

stage-packages

N/A

Other

  • Inherits from the jdk plugin.
  • Parametrizes calls to ant with proxy information from the conventional (https_proxy, http_proxy) environment variables.

autotools

build-packages

  • autoconf
  • automake
  • autopoint
  • libtool

stage-packages

N/A

Others

  • Assumes make is on PATH once installed through build-packages.
  • Inherits from the make plugin.
  • Cross compiling requires knowledge of the architecture triplet.

catkin

  • This plugin is very debian package specific.
  • Requires ROS sources.list

catkin-tools

  • This plugin is very debian package specific.
  • Requires ROS sources.list
  • Inherits from the catkin plugin.

cmake

build-packages

  • cmake

stage-packages

N/A

Others

  • Assumes make is on PATH once installed through build-packages.
  • Inherits from the make plugin.
  • Sets environment CMAKE_INCLUDE_PATH using architecture triplet.

copy

  • This plugin is deprecated.
  • It has no portability issues.

dotnet

build-packages

N/A

stage-packages

  • libcurl3
  • libcurl3-gnutls
  • libicu55
  • liblttng-ust0
  • libunwind8
  • lldb
  • libssl1.0.0
  • libgssapi-krb5-2
  • zlib1g
  • libgcc1

Others

  • Uses debian architecture
  • For older versions of the SDK, uses the Ubuntu target names (from the SDK).

dump

build-packages

N/A

stage-packages

N/A

Others

  • Has exception logic for libc6 Ubuntu package file list for LP: #1658774

godeps

build-packages

  • golang-go
  • git

stage-packages

N/A

Others

  • Assumes go and git are on PATH once installed through build-packages.
  • Uses standard go tool primitives to setup godeps

go

build-packages

  • golang-go

stage-packages

N/A

Others

  • Assumes go is on PATH once installed through build-packages.
  • Sets environment for CGO using architecture triplet.
  • Sets environment GOARCH using deb arch.

gradle

build-packages

  • ca-certificates-java
  • gradle

stage-packages

  • N/A

Others

  • gradle is added as build-packages only if gradlew is not part of the project source tree.
  • Parametrizes calls to gradle or gradlew with proxy information from the conventional (https_proxy, http_proxy) environment variables.
  • Inherits from the jdk plugin.

gulp

build-packages

N/A

stage-packages

N/A

Others

  • Sets up npm from upstream tarball
  • Sets up gulp with npm

jdk

build-packages

N/A

stage-packages

  • default-jdk

Others

  • Paths for environment assuming java related paths from default-jdk from build-packages.
  • This plugin has minimal use on its own and only availbale for backwards compatibility.

jhbuild

build-packages

  • apt-file
  • autoconf
  • automake
  • autopoint
  • autotools-dev
  • bison
  • build-essential
  • ca-certificates
  • cvs
  • docbook
  • docbook-xml
  • docbook-xsl
  • flex
  • gettext
  • git
  • intltool
  • iso-codes
  • libtext-csv-perl
  • libtool
  • libxml-parser-perl
  • make
  • ninja-build
  • pkg-config
  • python-dev
  • python3-dev
  • subversion
  • symlinks
  • yelp-tools
  • zlib1g-dev

stage-packages

  • N/A

Others

  • Requires building as non-root.
  • Uses sudo to escalate.

kbuild

build-packages

  • bc
  • gcc
  • make

stage-packages

N/A

Others

  • Has specific option for kconfigflavour for Ubuntu kernels (not affected if not used).
  • Cross compiling requires knowledge of the architecture triplet.

kernel

build-packages

  • kmod

stage-packages

N/A

Others

  • Inherits from the kbuild plugin.
  • Tied to base snap to rebuild initrd (until split initrd happens).
  • Depends on debian architecture with default settings.
  • Uses unsquashfs provided as a core dependency of snapcraft (from deb Depends or snap).

make

build-packages

  • make

stage-packages

N/A

Others

  • Assumes make is on PATH once installed through build-packages.
  • Assumes the convention of the existence of an install target which could be overriden.

maven

build-packages

  • maven

stage-packages

N/A

Other

  • Inherits from the jdk plugin.
  • Creates settings.xml to pickup the proxy from the conventional (https_proxy, http_proxy) environment variables.

meson

build-packages

  • meson
  • ninja-build

stage-packages

N/A

Others

  • Assumes meson and ninja are on PATH once installed through build-packages.
  • Uses ninja to execute the build.

nil

N/A

nodejs

build-packages

N/A

stage-packages

N/A

Others

  • Retrieves npm and yarn from upstream urls.
  • Uses the debian architecture as a key to download.
  • Parametrizes calls to yarn with proxy information from the conventional (https_proxy, http_proxy) environment variables.

plainbox-provider

build-packages

  • intltool

Others

  • Missing dependency on python3 (assumes already resolved).
  • This plugin is not maintained by the snapcraft team.
  • Assumes python sitecustomize.py paths

python

build-packages

For python3:

  • python3-dev
  • python3-pip
  • python3-pkg-resources
  • python3-setuptools

For python2:

  • python-dev
  • python-pip
  • python-pkg-resources
  • python-setuptools

stage-packages

For python3:

  • python3

For python2:

  • python

Others

  • Requires python binaries to be called python and python3 for version 2 and 3 respectively.
  • Plugin fileset paths may be Ubuntu specific.
  • If pip, setuptools and/or wheel is provided as a stage-packages entry or manually provided, those are preferred, if not, they are retrieved from PyPI.

qmake

build-packages

For qt5:

  • qt5-qmake
  • qtbase5-dev

For qt4:

  • qt4-qmake
  • libqt4-dev

stage-packages

N/A

Others

N/A

ruby

build-packages

  • gcc
  • g++
  • make
  • zlib1g-dev
  • libssl-dev
  • libreadline-dev

stage-packages

N/A

Others

  • Downloads the ruby source from upstream.
  • Builds ruby/gems using ./configure && make && make install.

rust

build-packages

  • gcc
  • git
  • curl
  • file

stage-packages

N/A

Others

  • Sets up rustc and cargo using rustup.

scons

build-packages

  • scons
  • ninja-build

stage-packages

N/A

Others

    • Assumes scons is on PATH once installed through build-packages.

tar-content

build-packages

N/A

stage-packages

N/A

Others

  • This plugin is pure python.
  • This plugin has been deprecated in favour of the dump plugin.

waf

build-packages

  • python-dev:native

stage-packages

N/A

Others

  • waf is part of the project’s source tree.
  • Cross compiling requires knowledge of the architecture triplet.

[DRAFT] Consistent Build Environments: Build VMs
Status Tracking for Build VM
#2

The most obvious one is that everything involving packages expects apt and Ubuntu. Once we have things like the Fedora base, this is going to completely break for that.


#3

Keen eye, I am writing a separate post on the ubuntuisms in the core of snapcraft. Keping them separate to not make them too dense.

I have two proposals for this, if the manager is widely used, have something in the snapcraft code base to handle this, but also be able to override it and through build environment configuration be able to add your own provider. The reason for this is we already need backwards compatibility. Another possibility would be to strip out stage-package handling entirely and make it pip installable, then each base gain the benefits of pulling in this common logic (which would also pull in, maybe dynamically, into snapcraft to maintain backwards compatibility).


#4

@Conan_Kudo let me add that you might want to take a peek at the linked forum post (still in flight, but I thought I’d capture relevant data before moving it further).


Status Tracking for Build VM