Fails to build a core22 base-snap-using snap when executed with:
snapcraft
Returning the following log (pulled from the ~/.cache/snapcraft/log
folder):
2022-10-16 22:05:20.537 Starting Snapcraft 7.2.0
2022-10-16 22:05:20.537 lifecycle command: 'pack', arguments: Namespace(bind_ssh=False, build_for=None, debug=False, destructive_mode=False, directory=None, enable_developer_debug=False, enable_experimental_extensions=False, enable_experimental_target_arch=False, enable_experimental_ua_services=False, enable_manifest=False, http_proxy=None, https_proxy=None, manifest_image_information=None, output=None, provider=None, target_arch=None, ua_token=None, use_lxd=False)
2022-10-16 22:05:20.537 command: pack, arguments: Namespace(bind_ssh=False, build_for=None, debug=False, destructive_mode=False, directory=None, enable_developer_debug=False, enable_experimental_extensions=False, enable_experimental_target_arch=False, enable_experimental_ua_services=False, enable_manifest=False, http_proxy=None, https_proxy=None, manifest_image_information=None, output=None, provider=None, target_arch=None, ua_token=None, use_lxd=False)
2022-10-16 22:05:20.559 Skipping build-on: arm64 build-for: ['arm64'] because build-on doesn't match host arch: amd64
2022-10-16 22:05:20.559 CPU count (from process affinity): 16
2022-10-16 22:05:20.559 Invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT value
2022-10-16 22:05:20.559 Running on amd64 for amd64
2022-10-16 22:05:20.563 Checking build provider availability
2022-10-16 22:05:20.569 Retrieved snap config: {}
2022-10-16 22:05:20.569 Using default provider 'lxd' on linux system.
2022-10-16 22:05:20.570 Emitter: Pausing control of the terminal
2022-10-16 22:05:21.007 Emitter: Resuming control of the terminal
2022-10-16 22:05:21.007 Launching instance...
2022-10-16 22:06:15.455 Emitter: Pausing control of the terminal
2022-10-16 22:08:46.540 Emitter: Resuming control of the terminal
2022-10-16 22:08:48.203 Failed to execute pack in instance.
2022-10-16 22:08:48.203 Detailed information: Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
2022-10-16 22:08:48.207 Traceback (most recent call last):
2022-10-16 22:08:48.207 File "/snap/snapcraft/8420/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 553, in _run_in_provider
2022-10-16 22:08:48.207 instance.execute_run(cmd, check=True, cwd=output_dir)
2022-10-16 22:08:48.207 File "/snap/snapcraft/8420/lib/python3.8/site-packages/craft_providers/lxd/lxd_instance.py", line 289, in execute_run
2022-10-16 22:08:48.207 return self.lxc.exec(
2022-10-16 22:08:48.207 File "/snap/snapcraft/8420/lib/python3.8/site-packages/craft_providers/lxd/lxc.py", line 329, in exec
2022-10-16 22:08:48.207 return runner(final_cmd, **kwargs) # pylint: disable=subprocess-run-check
2022-10-16 22:08:48.207 File "/snap/snapcraft/8420/usr/lib/python3.8/subprocess.py", line 516, in run
2022-10-16 22:08:48.207 raise CalledProcessError(retcode, process.args,
2022-10-16 22:08:48.207 subprocess.CalledProcessError: Command '['lxc', '--project', 'snapcraft', 'exec', 'local:snapcraft-ubuntu-accomplishments-on-amd64-for-amd64-19796221', '--cwd', '/root/project', '--', 'env', 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'SNAPCRAFT_MANAGED_MODE=1', 'snapcraft', 'pack', '--verbosity=brief', '--build-for', 'amd64']' returned non-zero exit status 1.
2022-10-16 22:08:48.207 Full execution log: '/home/dani/.cache/snapcraft/log/snapcraft-20221016-220520.536566.log'
The yaml is below (an attempt at porting ubuntu-accomplishments to core22, but haven’t verified it builds yet cos I need to use 7.2.0 for the passthrough
keyword to be supported in an app
marked as daemon: simple
):
name: ubuntu-accomplishments
base: core22
version: '0.2'
summary: Ubuntu Accomplishments
description: |
The Ubuntu Accomplishments system provides a simple, cohesive way to browse
different opportunities in the Ubuntu community and beyond, find out how to
participate and accomplish them, and see different accomplishments in one
place.
grade: stable
confinement: strict
compression: lzo
architectures:
- build-on: amd64
build-for: amd64
- build-on: arm64
build-for: arm64
parts:
flutter-git:
source: https://github.com/flutter/flutter.git
source-branch: stable
plugin: nil
override-build: |
set -eux
mkdir -p $CRAFT_PART_INSTALL/usr/bin
mkdir -p $CRAFT_PART_INSTALL/usr/libexec
cp -r $CRAFT_PART_SRC $CRAFT_PART_INSTALL/usr/libexec/flutter
ln -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter
export PATH="$CRAFT_PART_INSTALL/usr/bin:$PATH"
flutter doctor
flutter channel stable
flutter upgrade
build-packages:
- clang
- cmake
- curl
- ninja-build
- unzip
override-prime: ''
daemon:
after: [flutter-git]
plugin: nil
source: https://github.com/UbuntuAccomplishments/daemon.git
override-build: |
dart pub get
dart run build_runner build --delete-conflicting-outputs
dart compile exe --output accomplishments-daemon bin/accom_daemon.dart
install -m755 -D -t $SNAPCRAFT_PART_INSTALL/bin accomplishments-daemon
install -m644 -D -t $SNAPCRAFT_PART_INSTALL/usr/share/accomplishments/daemon/data data/ubuntu-accomplishments-system.svg
install -m644 -D -t $SNAPCRAFT_PART_INSTALL/usr/share/accomplishments/daemon data/daemon/validation-key.pub
stage-packages:
- klibc-utils
- python3
- python3-launchpadlib # for community-accomplishments
- python3-requests # for community-accomplishments
viewer:
after: [flutter-git]
plugin: nil
source: https://github.com/UbuntuAccomplishments/viewer.git
build-packages: [rsync]
override-build: |
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
flutter build linux --release -v
craftctl set version="$(jq -r '.version' build/flutter_assets/version.json)"
mkdir -p $CRAFT_PART_INSTALL/bin
cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/bin/
sed -i -e 's|\(Icon=\).*|\1/bin/data/flutter_assets/data/media/ubuntu-accomplishments.svg|' \
$CRAFT_PART_INSTALL/bin/data/flutter_assets/data/software.desktop
community-accomplishments:
plugin: nil
source: https://github.com/UbuntuAccomplishments/community-accomplishments.git
override-build: |
./install.sh $SNAPCRAFT_PART_INSTALL/usr/share/accomplishments
desktop-accomplishments:
plugin: nil
source: https://github.com/UbuntuAccomplishments/desktop-accomplishments.git
override-build: |
./install.sh $SNAPCRAFT_PART_INSTALL/usr/share/accomplishments
stage:
# these still need porting or removing entirely
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/accessories/accomplishments-shared-with-validation-server.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/gaming/gnomine*.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/gaming/mahjongg*.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/gaming/sudoku*.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/general/installed-on-nexus7.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/multimedia/importshotwell.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/multimedia/multimedia-added-music.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/multimedia/multimedia-added-photos.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/multimedia/musicinrhythmbox.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/networking/gwibber-*.accomplishment
- -usr/share/accomplishments/accomplishments/ubuntu-desktop/*/productivity/libreoffice-create-document.accomplishment
layout:
/usr/share/libdrm/amdgpu.ids:
symlink: $SNAP/gnome-platform/usr/share/libdrm/amdgpu.ids
slots:
accomplishments-service:
interface: dbus
bus: session
name: org.ubuntu.Accomplishments
plugs:
accomplishments-viewer:
interface: dbus
bus: session
name: org.ubuntu.Accomplishments
etc-lsb-release:
interface: system-files
read:
- /etc/lsb-release
# gnomine-scores:
# interface: personal-files
# read:
# - $HOME/.local/share/gnome-mines/scores
# mahjongg-scores:
# interface: system-files
# read:
# - $HOME/.local/share/gnome-mahjongg/history
# sudoku-scores:
# interface: personal-files
# read:
# - $HOME/.local/share/gnome-sudoku/finished
# missing rythmbox plug
# missing shotwell plug
apps:
daemon:
command: bin/accomplishments-daemon
daemon: simple
passthrough:
daemon-scope: user
slots:
- accomplishments-service # the dbus service
plugs:
- gsettings
- hardware-observe
- home
- log-observe
- network
# our custom system access below:
# - gnomine-scores
# - mahjongg-scores
# - sudoku-scores
- etc-lsb-release
ubuntu-accomplishments:
command: bin/accomplishments_viewer
common-id: org.ubuntu.Accomplishments
desktop: bin/data/flutter_assets/data/software.desktop
extensions: [gnome]
plugs:
- accomplishments-viewer # the dbus service
The yaml above should be used to replace the yaml currently sitting in https://github.com/UbuntuAccomplishments/accomplishments-snap.