Auto-connect request: wissance-zerial (serial-port)

This category is for handling requests for privileged interfaces, formerly known as auto-connections. The process is documented in Process for aliases, auto-connections and tracks.

To make the review of your request easier, please use the following template to provide all the required details and also include any other information that may be relevant.


name: wissance-zerial
description: GUI utility to interact with hardware via serial (COM or USB-COM)
snapcraft: https://github.com/Wissance/Zerial/blob/master/snapcraft.yaml
upstream: https://github.com/Wissance/Zerial
upstream-relation: I am the upstream developer and publisher
plugs:
  wissance-zerial-serial-port:
    interface: serial-port
    request-type: auto-connection
    reasoning: Without auto-connection, users are forced to run manual terminal commands (e.g., `sudo snap connect <snap>:<plug-name>`) before they can use the app. This creates a poor user experience and is a significant barrier for non-technical users.
  ...
slots:
  wissance-zerial-serial-port:
    interface: serial-port
    request-type: auto-connection
    reasoning: Without auto-connection, users are forced to run manual terminal commands (e.g., `sudo snap connect <snap>:<plug-name>`) before they can use the app. This creates a poor user experience and is a significant barrier for non-technical users.
  ...

where:

  • : the name of the interface as defined in the snapcraft.yaml .
  • interface: the interface being requested. Only required if different from interface-name
  • attributes: the interface attributes. Only required if attribute are defined in the snapcraft.yaml.
  • request-type: one of installation (ie. permission to upload the snap to the store using this interface), connection (ie. permission to allow the snap interface to be connected) or auto-connection (ie. permission for the snap interface to be automatically connected when the snap is installed).

Example request:

name: foo-snap
description: audio player and recorder
snapcraft: https://github.com/jslarraz/foo/snapcraft.yaml
upstream: https://github.com/jslarraz/foo
upstream-relation: maintainer
plugs:
  audio-record:
    request-type: auto-connection
    reasoning: this is needed to record the microphone, which is one of the core
      functionalities of the snap.
  dot-config-foo:
    interface: personal-files
    attributes:
      write: $HOME/.config/foo
    request-type: auto-connection
    reasoning: the application needs to access its configuration files 
  removable-media
    request-type: manual-connection
    reasoning: media files are frequently stored in external disk. 
slots:
  com-jslarraz-foo:
    interface: dbus
    attributes: 
      bus: session
      name: com.jslarraz.foo
    request-type: manual-connection
    reasoning: Notte is a Flutter/GTK3 desktop application that requires 
      a D-Bus session bus slot (com.notte.notte) for proper desktop integration. 
      The GTK toolkit registers on the session bus for window management, 
      single-instance enforcement, and accessibility services. The bus name 
      matches the application ID. Without this slot, the app fails AppArmor 
      policy checks on launch.

This request has been added to the queue for review by the @reviewers team.

Hi @wissance

I noticed your workflow uses the experimental hotplug feature (experimental.hotplug) and requires restarting snapd. Since users are already executing terminal setup commands for this, running an additional snap connect command shouldn’t add significant friction. Hence, -1 from me to grant auto-connection to serial-port interface.

You can always check whether the interface is connected programmatically from within your application using: snapctl is-connected <plug-name>

Sorry for the inconvenience.

@shishirsub10, Thanks for your reply. I would like to clarify some moments:

  1. After the app is installed, the user could start the app without a snapd restart

  2. snapd restart is called to make the app work with serial ports

  3. auto-connect is required to get rid of all 3 commands mentioned in the documentation (these lines were added to share with users knowledge of how to make the app discover serial devices)

  4. Checking if snapctl is connected in the application is bad because there are other ways of distribution, and application code shouldn’t depend on this.

The problem is sadly a bit different, there is no generic serial-port interface slot anywhere, serial port interfaces are always named and not provided by the system itself but via a gadget snap (hardware definition snap)

So in a manual connection you would do:

snap connect <foo>:serial-port <gadget name>:<serial port slot name>

Since both, the gadget name and the slot name are completely unpredictable (and there might even be multiple serial slots defined in the gadgetm depending on the actual hardware) snapd can simply not auto-connect them.

In the case of hotplug the slot name is randomly generated from info in /dev and /sysfs so even though there is a system slot, the name is again random which causes the same problem.

Auto connect for serial interfaces in the global store is simply not possible (it works in dedicated snap stores for UbuntuCore devices though, where the store owner has full control over the naming of gadget and slots)…