Hi,
I am trying to package the pre-built binaries of Facebook’s watchman tool because the version in Ubuntu’s repository is too old for what I need.
The basics are in place, but I cannot figure out how to get rid of the following warning, which occurs on running the installed snap package’s application:
[watchman] while computing sockname: failed to create /usr/local/var/run/watchman/user-state: No such file or directory
I have tried creating the directory inside the snap/local
folder with the permissions detailed in the watchman install instructions, and moving it to the right place in a part, but that just yields a permission denied error when watchman tries to write to the directory.
From what I see there are two ways to handle what watchman needs:
- Create a writable directory inside the snap file system that has the right permissions
- Allow the snap to write on the host file system
It feels like it should be possible to create a writable part on the snap-internal file system, and I’m just not doing it correctly.
My snap is quite simple:
name: watchman # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: 'v2022.06.20.00' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
apps:
watchman:
plugs:
- watchman-socket
command: usr/local/bin/watchman
watchmanctl:
plugs:
- watchman-socket
command: usr/local/bin/watchmanctl
parts:
file-part:
plugin: dump
source: snap/local
source-type: local
stage:
- usr/local/
prime:
- usr/local/
remote-part:
source-subdir: watchman-v2022.06.20.00-linux/
source-type: zip
source: https://github.com/facebook/watchman/releases/download/v2022.06.20.00/watchman- v2022.06.20.00-linux.zip
plugin: dump
organize:
'*': usr/local/
stage:
- usr/local/
prime:
- usr/local/
layout:
/usr/local/lib:
bind: $SNAP/usr/local/lib
Do you have any hints on how I might proceed in this? Thanks
[edit]: I forgot to add a link to the Watchman install documentation. It is here: Installation instructions for MacOS and Linux