Request classic confinement for incyclist

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: incyclist

  • description: Indoor Cycling App

  • upstream: GitHub

  • upstream-relation: author

  • supported-category: potentially teminal-emulators

  • reasoning: The app has to access various hardware interfaces ( USB, serial, bluetooth) and it needs to run multicast-dns to detect and connect with the SmartTrainers and sensors. Besides that, the app needs to access files outside of the users home directory, as the purpose is that the users can import any GPX or Video file from their local hard disc (or attached device/NAS).

I understand that strict confinement is generally preferred over classic.

I’ve tried the existing interfaces to make the snap to work under strict confinement.

with devmode or strict confinment, I can’t even get the app to start as GLIBC is missing (which is required to access usb and serial). With classic mode this works fine.

This definitely points to a packaging bug, glibc is available to every snap from the base you defined …

There are also interfaces for all the tasks you describe above and there are plenty of strict snaps in the store reading sensors, using Bluetooth, raw USB and serial access just fine through the existing interfaces…

How exactly does your app work as a terminal emulator, how does it compare to xterm or gnome-terminal? The use cases you describe don’t seem to match at all what a terminal emulator would do …

It does not act as a terminal adapater, but it communicates over serial port and native USB (for ANT+) with the Smart Trainers. I only selected the supported category “terminal adapter” as this was the closest I could find.

Nevertheless, this was only one aspect of my request: The other aspect is that I need to access files outside of the home directory ( videos and GPX files)

Any hints on what could lead to the fact hat GLIBC is missing? I’m always getting the error

Uncaught Exception:
Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/incyclist/7/resources/app.asar.unpacked/node_modules/usb/build/Release/usb_bindings.node)

when using strict or devmode confinement. Tha app works fine in classic confinement

Well, “closest” doesn’t justify classic confinement, it has to rather exactly fit a category, there is a reason classic is limited to only this set of things that can definitely not be packaged strictly, all others must be strict…

Ok - let’s keep that aside.

What about accessing files outside of the home directory (videos and GPX files)? I can’t expect that the users are keeping GBytes/TBytes of videos in their home directory

There is the removable-media interface that gives your app access to /mnt and /media for any externally mounted drives (i.e. a NAS or USB disk)

If there are other predictable places you can use a system-files interface…

Regarding your error, it is hard to say something without seeing the full snapcraft.yaml file and whether the error happens on build or at runtime

I honestly can’t predict where the users are placing their videos.

/mnt and /media might be often the case, but I can’t be sure that this will be the only locations.

Would you expect from VLC or any other video player to limit the users where to store the videos? My app does exactly the same. It plays videos (just combined with cycling and adjusting video playback speed to match the cyclling speed)

Well, yes, I exclusively use VLC as snap and I personally don’t have local videos living outside of $HOME, /media or /mnt

But this is a moot discussion, based on “I want my app to access random files” you won’t get classic granted by the reviewers… (I think there is even a mention of that in the doc that holds the list of categories)

BTW, if you attach or link to your snapcraft.yaml we can surely fix your broken packaging so your node modules do not get linked against a wrong libc, something is clearly wrong there in the packaging setup…

The app is build with electron-builder.

I don’t see any snapcraft.yaml. This is done under the hood of electron-builder.

This is my electron-builder config:

{
    "beforePack": "scripts/update-web-bundle.js",
    "publish": {
        "provider": "generic",
        "url": "https://updates.incyclist.com/download/app/latest/linux/x64"
    },
    "appId": "com.incyclist.desktop",
    "productName": "Incyclist",
    "nodeGypRebuild": false,
    "directories": {
        "app": "./",
        "output": "out/make",
        "buildResources": "res"
    },
    "linux": {
        "icon": "res/icon_256.png",
        "category": "Games;Sports",
        "maintainer": "Guido Doumen",
        "desktop":   {
            "name": "Incyclist"
        } ,
        "target": ["AppImage","snap","zip"]
    },
    "snap": {   
        "category":"Game",
        "confinement":"devmode",
        "plugs" : [
            "bluez",
            "bluetooth-control",
            "alsa",
            "audio-playback",
            "cpu-control",
            "display-control",
            "locale-control",
            "network",
            "network-bind",
            "home",
            "serial-port",
            "removable-media" 
        ]
    }
}

It’s in this branch of my repo: GitHub - incyclist/desktop at 75-migrate-to-electron-forge

you can test yourself by running

npm install
npm run make-linux

Ah, i see, there is definitely something wrong in how electron-builder generates it then i guess …

In case you are interested in simply shipping a proper snapcraft.yaml in your tree, here is an example of a snap using electron-builder:

Beyond this you should likely file an issue against electron-builder, not sure where it goes wrong but libc 2.38 has not been in any Ubuntu LTS ever, it looks like the usb module showing the error above was somehow compiled on a wrong OS/Version outside of the snap build …

It seems to be a mixture of various issues here

a) my local machine, seems to have a weird flavour of glibc b) electron-builder does not create a proper snapcraft.yaml

I now also tried to use electron-forge (the builder recommended from Electron) . I can upload the devmode snap and install it locally. But when I launch the app literally nothing happens (no error/nothing is launched)

I now give up for now and will continue to publish AppImages. It’s too much hassle for ~5% of my user base ( BTW: this build was done on GitHub CI - which does not seem to have the weird library issues)

Thanks for your help