Trouble getting layouts working with confined snap

I’m working on pulling together a snap of a terminal program with some basic config in /etc that users can extend/overwrite with config in their home directories. Here is what I have for a snapcraft.yaml so far:

name: stimmtausch
base: core18
version: git
summary: Terminal-based MU* client
description: |
  Stimmtausch is a terminal-based MU* client for connecting to multi-user
  online roleplaying games such as MUDs, MUSHes, MUCKs, and MOOs.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

plugs:
  config-files:
    interface: personal-files
    read:
      - $HOME/.strc
      - $HOME/.config/stimmtausch
  share-files:
    interface: personal-files
    write:
      - $HOME/.local/share/stimmtausch
  log-files:
    interface: personal-files
    write:
      - $HOME/.local/log/stimmtausch

layout:
  /etc/stimmtausch:
    symlink: $SNAP/etc/stimmtausch

apps:
  stimmtausch:
    command: bin/stimmtausch
    plugs: [config-files, share-files, log-files, network]

parts:
  stimmtausch:
    plugin: go
    go-packages:
      - github.com/makyo/stimmtausch
    source: .
    source-type: git
    source-branch: snap
  config:
    after: [stimmtausch]
    plugin: dump
    source: _conf/global
    source-type: local
    organize:
      '*': etc/stimmtausch/

Unfortunately, during the normal development process, it seems like the layout portion just isn’t happening. I suspect I’m missing something super obvious, but would appreciate help all the same.

snapcraft, version 3.11

snap 2.44.3+20.04
snapd 2.44.3+20.04
series 16
ubuntu 20.04
kernel 5.4.0-26-generic

Are you saying that the symlink isn’t appearing?

I noticed that layouts only appear “within” the snap. Did you inspect it using snap run --shell stimmtausch.config or did you just look at the host filesystem?

1 Like

Apologies for being unclear, and thanks for the tip of snap run. I hadn’t seen that one before.

Looking in the snap, I am indeed seeing the layout symlink there, which is a good sign. Logging was betraying me on this one.

Thanks for the help!

1 Like

No problem! Glad to help.