Heyo!
One of my colleagues at Canonical dug into this, and I think they’ve found the issue (quoting them below)
/snap/obsidian/current/desktop-common.sh is doing:
function can_open_file() {
head -c0 "$1" &> /dev/null
}
...
if can_open_file "$REALHOME/.config/user-dirs.dirs" && can_open_file "$REALHOME/.config/user-dirs.locale"; then
...
# Create links for user-dirs.dirs
if [ $needs_xdg_links = true ]; then
for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do
b="$(realpath "${XDG_SPECIAL_DIRS_PATHS[$i]}" --relative-to="$HOME")"
if [ -e "$REALHOME/$b" ]; then
if [ -d "$HOME/$b" ]; then
rmdir "$HOME/$b" 2> /dev/null
fi
...
Basically trying to replace XDG directories for the snap by symlink to the real dir. In that case it’s a classic snap so it shouldn’t try to do that but
$ gnuhead -c0 ~/Documents; echo $?
0
$ head -c0 ~/Documents; echo $?
head: error reading '/home/ubuntu/Documents': Is a directory
1
The head behavior is different in rust-coreutils which makes the check it does to decide if it needs to do the symlink dance or not fail and try to rmdir ~/Documents and errors out
That launcher script appears to be included as part of electron builder, and hasn’t been updated for some time.
Happy to try and work with any of the maintainers to solve this. The view here is that this was probably a bug in the check, but just sort of happened to work until now!
Cheers (amd thanks to Seb for diving in…!)
Jon