Flatpak includes invalid socket switch when building under Ubuntu 18.04 LTS
Error
When following the steps on the GNOME wiki, the flatpak-builder --force-clean org.gnome.Evolution-stable org.gnome.Evolution-stable.json
step fails right at the "finishing app" stage with error: Unknown socket type pcsc, valid types are: x11, wayland, pulseaudio, session-bus, system-bus, fallback-x11, ssh-auth
.
Error log
This is repeatable as you can see from the shorter log if you re-run the command:
flatpak-builder --force-clean org.gnome.Evolution-stable org.gnome.Evolution-stable.json
Emptying app dir 'org.gnome.Evolution-stable'
Downloading sources
Fetching git repo git://git.0pointer.net/libcanberra.git, ref refs/heads/master
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Fetching git repo https://github.com/libical/libical.git, ref refs/heads/3.0
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Fetching git repo https://git.code.sf.net/p/bogofilter/git, ref refs/heads/main
remote: Total 0 (delta 0), reused 0 (delta 0)
Fetching git repo https://gitlab.gnome.org/GNOME/evolution-data-server.git, ref refs/heads/gnome-40
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Fetching git repo https://gitlab.gnome.org/GNOME/evolution.git, ref refs/heads/gnome-40
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Fetching git repo https://gitlab.gnome.org/GNOME/evolution-ews.git, ref refs/heads/gnome-40
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Starting build of org.gnome.Evolution
Cache hit for intltool, skipping build
Cache hit for libcanberra, skipping build
Cache hit for libical, skipping build
Cache hit for liboauth, skipping build
Cache hit for gnome-online-accounts, skipping build
Cache hit for libgdata, skipping build
Cache hit for geocode-glib, skipping build
Cache hit for libgweather, skipping build
Cache hit for openldap, skipping build
Cache hit for gspell, skipping build
Cache hit for pinentry, skipping build
Cache hit for bogofilter, skipping build
Cache hit for libmspack, skipping build
Cache hit for evolution-data-server, skipping build
Cache hit for evolution, skipping build
Cache hit for flatpak-evolution-wrapper, skipping build
Cache hit for evolution-ews, skipping build
Cache hit for cleanup, skipping
Cache miss, checking out last cache hit
Finishing app
error: Unknown socket type pcsc, valid types are: x11, wayland, pulseaudio, session-bus, system-bus, fallback-x11, ssh-auth
Error: Child process exited with code 1
Fix
The issue is on L29 of the build JSON:
"finish-args": [
"--share=ipc",
"--share=network",
"--socket=x11",
"--socket=wayland",
"--socket=pulseaudio",
"--socket=pcsc",
"--device=dri",
"--filesystem=~/.gnupg:rw",
"--filesystem=xdg-config/gnupg:rw",
"--filesystem=~/.pki:rw",
"--filesystem=xdg-config/pki:rw",
"--filesystem=/run/.heim_org.h5l.kcm-socket",
"--metadata=X-DConf=migrate-path=/org/gnome/evolution/",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.freedesktop.secrets",
"--talk-name=org.gnome.keyring.SystemPrompter",
"--talk-name=org.gnome.OnlineAccounts"
Once "--socket=pcsc",
is removed from the build file everything works.
Environment
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic