Call for testing: snapcraft 2.43

This file copy error of snaps is due to a snapd being released before our 2.43.1 was able to make it. We are behind on the 2.43.1 release given the review-tools conflict that just showed up today.

Are you using source: . in parts and making modifications there? That could do the trick, @kyrofa care to work with @diddledan on this one?

Thanks for taking a look @diddledan

no, it is literally re-building the same project with no changes whatsoever. e.g. if the previous build failed on the final part to be built, it will still complain about previous parts when you (I) attempt to rebuild just that final part.

I don’t seem to be able to recreate the scenario on a reduced testcase, though :frowning: maybe I was hallucinating…

ok, now I’m seeing this within the same build attempt! i.e. it builds alsa then complains later-on that alsa needs cleaning. During the same snapcraft run.

This is on a freshly cleaned tree:

Staging alsa-plugins 
Pulling alsa 
Hit http://archive.ubuntu.com/ubuntu xenial InRelease                                                                                               
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                                                            
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease                                                                                     
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]                                                                          
Fetched 216 kB in 0s (0 B/s)                                                                                                                        
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]                                                                          
Hit http://archive.ubuntu.com/ubuntu xenial InRelease                                                                                               
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                                                            
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease                                                                                     
Fetched 216 kB in 0s (0 B/s)                                                                                                                        
Pulling desktop-qt5 
Cloning into '/root/build_mycroft/parts/desktop-qt5/src'...
remote: Counting objects: 1195, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 1195 (delta 4), reused 8 (delta 2), pack-reused 1179
Receiving objects: 100% (1195/1195), 210.06 KiB | 0 bytes/s, done.
Resolving deltas: 100% (619/619), done.
Checking connectivity... done.
Pulling patches 
'mimic' has dependencies that need to be staged: patches
Skipping pull patches (already ran)
Building patches 
Staging patches 
Hit http://archive.ubuntu.com/ubuntu xenial InRelease                                                                                               
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                                                            
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]                                                                          
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease                                                                                     
Fetched 216 kB in 0s (0 B/s)                                                                                                                        
Pulling mimic 
Cloning into '/root/build_mycroft/parts/mimic/src'...
remote: Counting objects: 462, done.
remote: Compressing objects: 100% (390/390), done.
remote: Total 462 (delta 200), reused 180 (delta 64), pack-reused 0
Receiving objects: 100% (462/462), 438.82 MiB | 8.69 MiB/s, done.
Resolving deltas: 100% (200/200), done.
Checking connectivity... done.
Checking out files: 100% (418/418), done.
patching file configure.ac
'mpg123' has dependencies that need to be staged: alsa
Failed to reuse files from previous run: The 'pull' step of 'alsa' is out of date:
The source has changed on disk.
To continue, clean that part's 'pull' step by running `snapcraft clean alsa -s pull`.
Stopping local:snapcraft-mycroft
1 Like

@lucyllewy can I see the snapcraft.yaml you’re using, please?

this is the one from the log output above. I’ve not modified it since that log was taken. The build will likely fail before completion the first attempt to run due to bugs in my build process (VLC doesn’t like Protobuf) but you can retry the build to see the snapcraft error with prompting to clean parts that should not have changed.

name: mycroft
version: latest
version-script: |
  cat $SNAPCRAFT_STAGE/mycroft-source/.version | sed -e 's|release/v||'
icon: snap/gui/mycroft.png
summary: Your AI personal assistant!
description: >
  Mycroft is a free and open-source intelligent personal assistant and knowledge
  navigator for Linux-based operating systems that uses a natural language user
  interface. It is the world’s first fully open-source AI voice assistant.

  Mycroft is named after a fictional computer from 1966 science fiction novel
  "The Moon Is a Harsh Mistress".

  Installing skills by voice seems to be broken for now, but you can use
  the `mycroft.msm` command to list, install, and remove skills.

grade: stable
confinement: strict

parts:
  alsa:
    after: [alsa-lib, alsa-plugins]
  alsa-lib:
    # configflags needed until LP#1766878 is fixed
    configflags:
    - --prefix=/usr
    - --sysconfdir=/etc
    - --libexec=/usr/lib
    - --libdir=/usr/lib
    - --localstatedir=/var
    - --with-configdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa
    - --with-plugindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/alsa-lib
    - --disable-alisp
    - --disable-aload
    - --disable-python
    - --disable-rawmidi
    - --disable-static
    - --disable-topology
    - --disable-ucm
    - --enable-symbolic-functions
    prime: ['*']
  alsa-plugins:
    after: [alsa-lib]
    # configflags needed until LP#1766878 is fixed
    configflags:
    - --prefix=/usr
    - --sysconfdir=/etc
    - --libexec=/usr/lib
    - --libdir=/usr/lib
    - --localstatedir=/var
    - --disable-arcamav
    - --disable-avcodec
    - --disable-jack
    - --disable-mix
    - --disable-oss
    - --disable-usbstream
    - --with-plugindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/alsa-lib
    - --disable-static
    - LDFLAGS=-L$SNAPCRAFT_STAGE/usr/lib
    prime: ['*']

  patches:
    source: patches
    plugin: dump
    prime:
    - msm-skillsdir.diff
    - mycroft-cache.diff

  scripts:
    source: scripts
    source-type: local
    plugin: dump
    override-pull: |
      snapcraftctl pull
      chmod +x mycroft-launch
    organize:
      mycroft-launch: bin/mycroft-launch

  mimic:
    after: [patches]
    plugin: autotools
    source: https://github.com/MycroftAI/mimic.git
    source-depth: 1
    configflags:
    - --prefix=/usr
    - --disable-static
    - --with-audio=pulseaudio
    override-pull: |
      snapcraftctl pull
      patch -Np1 < $SNAPCRAFT_STAGE/mimic-pulseaudio.diff
    build-packages:
    - libpcre2-dev
    - libpulse-dev
    stage-packages:
    - libpcre2-8-0
    - libpulse0

  portaudio:
    after: [alsa]
    source: http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz
    plugin: cmake
    configflags:
    - -DCMAKE_INSTALL_PREFIX=/usr
    - -DPA_USE_ALSA=ON
    - -DPA_USE_JACK=ON
    build-packages:
    - libjack-dev
    stage-packages:
    - libjack0

  mpg123:
    after: [alsa]
    source: http://sourceforge.mirrorservice.org/m/mp/mpg123/mpg123/1.25.10/mpg123-1.25.10.tar.bz2
    plugin: autotools
    configflags:
    - --prefix=/usr
    - --disable-static
    - --with-default-audio=pulse
    build-packages:
    - libpulse-dev
    stage-packages:
    - libpulse0

  vlc:
    after: [alsa, mpg123, portaudio]
    source: https://download.videolan.org/pub/videolan/vlc/3.0.3/vlc-3.0.3.tar.xz
    source-checksum: sha256/9ba8b04bdb13f7860a2041768ac83b47b397a36549c71c530b94028a3cfd5b51
    plugin: autotools
    override-pull: |
      snapcraftctl pull
      sed -i 's|0\.19\.8|0\.19\.7|'  configure.ac
    override-build: |
      cd extras/tools
      ./bootstrap
      make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT .protoc
      # make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT .nasm
      cd ../../
      export PATH=$PWD/extras/tools/build/bin:$PATH
      cd contrib && mkdir linux && cd linux
      ../bootstrap \
        --disable-a52 \
        --disable-chromaprint \
        --disable-dca \
        --disable-disc \
        --disable-ebml \
        --disable-fluid \
        --disable-fontconfig \
        --disable-freetype2 \
        --disable-gettext \
        --disable-glib \
        --disable-gnutls \
        --disable-gpg-error \
        --disable-jack \
        --disable-jpeg \
        --disable-libdsm \
        --disable-libxml2 \
        --disable-lua \
        --disable-matroska \
        --disable-mfx \
        --disable-modplug \
        --disable-mpcdec \
        --disable-mpg123 \
        --disable-mysofa \
        --disable-ncurses \
        --disable-png \
        --disable-qt \
        --disable-srt \
        --disable-tiff \
        --disable-tiger \
        --disable-tremor \
        --disable-upnp \
        --disable-vncclient \
        --disable-xcb \
        --disable-xcb-proto \
        --disable-xorg-macros \
        --disable-xproto \
        --disable-zlib \
        --disable-zvbi
      make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT fetch
      make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
      make install
      cd ../../
      ./configure \
        --prefix=$SNAPCRAFT_PART_INSTALL/usr \
        --enable-merge-ffmpeg \
        --disable-a52
      make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
      make install
    build-packages:
    - ant
    - autoconf
    - automake
    - bison
    - build-essential
    - cmake
    - curl
    - flex
    - g++
    - gettext
    - git
    - libavahi-client-dev
    - libcdio-dev
    - libdbus-1-dev
    - libdirectfb-dev
    - libebml-dev
    - libfreerdp-dev
    - libfreetype6-dev
    - libfribidi-dev
    - libglib2.0-dev
    - libgnutls28-dev
    - libidn11-dev
    - libjpeg8-dev
    - libjack-dev
    - liblircclient-dev
    - liblua5.2-dev
    - libmatroska-dev
    - libmtp-dev
    - libncursesw5-dev
    - libpng-dev
    - libpulse-dev
    - librsvg2-dev
    - libsecret-1-dev
    - libtool
    - libtool-bin
    - libudev-dev
    - libupnp-dev
    - libv4l-dev
    - libva-dev
    - libvdpau-dev
    - libwayland-dev
    - libx11-dev
    - libxcb-composite0-dev
    - libxcb-keysyms1-dev
    - libxcb-randr0-dev
    - libxcb-shm0-dev
    - libxcb-xfixes0-dev
    - libxcb-xv0-dev
    - libxcb1-dev
    - libxext-dev
    - libxi-dev
    - libxinerama-dev
    - libxkbcommon-x11-dev
    - libxml2-dev
    - libxpm-dev
    - libzvbi-dev
    - lua5.2
    - make
    - pkg-config
    - ragel
    - wayland-protocols
    - xz-utils
    - yasm
    - zlib1g-dev
    stage-packages:
    - breeze-icon-theme
    - dbus-x11
    - fonts-freefont-ttf
    - frameworkintegration
    - libebml4v5
    - libfreerdp-client1.1
    - libfreerdp-core1.1
    - libfreerdp-gdi1.1
    - libfreetype6
    - libfribidi0
    - libgcc1
    - libglib2.0-0
    - libjack0
    - libjpeg8
    - liblua5.2-0
    - libmatroska6v5
    - libmtp9
    - libnotify4
    - libpulse0
    - librsvg2-2
    - libschroedinger-1.0-0
    - libsecret-1-0
    - libupnp6
    - libva-drm1
    - libva-x11-1
    - libva1
    - libvdpau1
    - libwayland-client0
    - libx11-6
    - libxcb-composite0
    - libxcb-keysyms1
    - libxcb-randr0
    - libxcb-shm0
    - libxcb-xv0
    - libxcb1
    - libxext6
    - libxi6
    - libxinerama1
    - libxkbcommon-x11-0
    - libxpm4
    - libzvbi0
    - mesa-utils
    - mesa-vdpau-drivers
    - vdpau-va-driver
    - zlib1g

  mycroft-deps:
    after:
    - alsa
    - mimic
    - mpg123
    - patches
    - portaudio
    - vlc
    plugin: nil
    stage-packages:
    - libgdk-pixbuf2.0-0 # yad
    - libgtk-3-0         # yad
    - libfreetype6       # yad
    - libfontconfig1     # yad
    - libnotify4         # yad
    - libnotify-bin
    - yad
    - bison
    - build-essential
    - coreutils
    - curl
    - flac
    - git
    - jq
    - libc6
    - libfann-dev
    - libffi-dev
    - libgcc1
    - libglib2.0-dev
    - libicu-dev
    - libjpeg-dev
    - libpcre3
    - libssl-dev
    - locales-all
    - pulseaudio-utils
    - python-gobject-2-dev
    - python-setuptools
    - python3-dev
    - rsync
    - swig
    - zlib1g

  mycroft:
    source: https://github.com/MycroftAI/mycroft-core.git
    plugin: dump
    override-pull: |
      snapcraftctl pull
      git checkout $(git describe --tags --abbrev=0 --match release/v*)
      git describe --tags > .version
    organize:
      '*': mycroft-source/
      '.*.yml': mycroft-source/
      '.coveralls': mycroft-source/.coveralls
      '.version': mycroft-source/.version
      '.git*': mycroft-source/

  mycroft-plasma:
    after: [desktop-qt5]
    source: https://anongit.kde.org/plasma-mycroft.git
    plugin: cmake
    configflags:
    - -DCMAKE_INSTALL_PREFIX=/usr
    - -DCMAKE_BUILD_TYPE=Release
    - -DKDE_INSTALL_LIBDIR=lib
    - -DKDE_INSTALL_USE_QT_SYS_PATHS=on
    override-build: |
      snapcraftctl build
      chmod +x usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/*service.sh


apps:
  mycroft:
    command: alsa-launch mycroft-launch start-all
    plugs:
    - desktop
    - desktop-legacy
    - network
    - network-bind
    - pulseaudio
    - x11
    - wayland

  msm:
    command: mycroft-launch python3 "$SNAP_USER_COMMON/mycroft/.venv/bin/msm"
    plugs:
    - desktop
    - desktop-legacy
    - network
    - network-bind
    - pulseaudio
    - x11
    - wayland

  cli:
    command: mycroft-launch python3 -m mycroft.client.text
    plugs:
    - desktop
    - desktop-legacy
    - network
    - x11
    - wayland

  bus:
    command: mycroft-launch python3 -m mycroft.messagebus.service
    plugs:
    - desktop
    - desktop-legacy
    - network
    - network-bind
    - x11
    - wayland

  skills:
    command: mycroft-launch python3 -m mycroft.skills
    plugs:
    - desktop
    - desktop-legacy
    - network
    - x11
    - wayland

  audio:
    command: alsa-launch mycroft-launch python3 -m mycroft.audio
    plugs:
    - desktop
    - desktop-legacy
    - network
    - pulseaudio
    - x11
    - wayland

  voice:
    command: alsa-launch mycroft-launch python3 -m mycroft.client.speech
    plugs:
    - desktop
    - desktop-legacy
    - network
    - pulseaudio
    - x11
    - wayland

@lucyllewy any chance you can come up with a minimal reproducer? I can’t seem to create an example that breaks in this manner. Either that, or can you give me a link to your entire project (since the YAML has many local sources)?

The code is now pushed to:

1 Like

This has made it to a release

1 Like

Could bug #1790819 be a regression?

1 Like

yes Olivier, it is a regression in that it worked before even if we did not really support it, 2.44 should have it fixed.

1 Like

I’m seeing the same issue as @lucyllewy. All builds of the chromium snap now fail on launchpad:

Failed to reuse files from previous run: The 'pull' step of 'launcher' is out of date:
The source has changed on disk.
To continue, clean that part's 'pull' step by running `snapcraft clean launcher -s pull`.
Build failed

See e.g. https://code.launchpad.net/~chromium-team/+snap/chromium-snap-dev/+build/329874.

This is the corresponding snapcraft.yaml. It hasn’t changed significantly since the last successful build (only bumped the version number, which is what triggered the new failed builds), so it looks like this might be a snapcraft regression.

So the problem I was seeing with alsa seemingly changing on disk during a build. Well this was a doozy. It turns out that VSCode was/is changing the timestamp on the .git folder of the project (where snap/snapcraft.yaml lives) the moment it detects that files within the project folder have been altered in some way (such as files within parts/<partname>/build while snapcraft builds stuff). This appears to be part of VSCode’s git-changes tracking feature. Only the timestamp of the .git folder is changed, with no changes to files or folders within. The reason it affected the alsa part specifically is because that part does not specify a source and therefore snapcraft defaults it to mean the ./ folder.

Unfortunately this doesn’t help with launchpad builds seemingly behaving in the same weird way, as VSCode probably isn’t running on the launchpad builder :wink: .

1 Like

@oSoMoN this is due to your use of source: snap in your launcher part. The snap directory is intended for use by snapcraft (i.e. use it for local plugins, hooks, icons etc. but don’t use it for part sources). This has been logged as https://bugs.launchpad.net/snapcraft/+bug/1791773, and the fix has been committed: https://github.com/snapcore/snapcraft/pull/2256 . However, we still recommend not putting part sources into the snap directory, it’s simply not treated the same way as the rest of the project. Newer releases will begin warning about this.

1 Like

Thanks @kyrofa, moving the part out into another directory should be easy enough.
However I’m also seeing the same issue when building a snap that has only remote parts, but for which the definition is under snap/snapcraft.yaml, is that not recommended either?

you’re not specifying a source: on communitheme’s part so I’m guessing you’re hitting a problem similar to mine where vscode changed the project folder:

  communitheme:
    plugin: nil
    build-snaps: [communitheme/latest/edge]
    override-build: |
      set -eu
      snapcraftctl build
      cp -a /snap/communitheme/current/share $SNAPCRAFT_PART_INSTALL/
      rm -rf $SNAPCRAFT_PART_INSTALL/share/gnome-shell/

Bad news for Snapcrafters Template Plus, which currently using the entire snap folder as assets part’s source

Yeah, not recommended.

@oSoMoN and I have been chatting about this on IRC, but I wanted to come back here to loop interested parties in. The snap directory is intended for the snapcraft.yaml, plugins, hooks, icons, and desktop files-- having snap/snapcraft.yaml is perfectly fine and is indeed recommended. However, one of the parts in the project (sassc in particular) actually modified the project’s .git directory during its build process as it was trying to figure out its own version. Snapcraft detected these changes as source changes. I’m looking into making that error a bit more helpful, but @oSoMoN was able to work around this by pulling the trouble part with git instead of using a tarball (so any git operations it performed was on its own repository rather than the project’s).

6 posts were split to a new topic: Containing snap related assets to the snap directory

Split at @sergiusens’s request — people commenting on this topic trigger a “omg panic release is broken” button in his hind-brain.