$SNAP_USER_DATA is only set at runtime, not at build time … better use a symlink from an upgrade or install hook or even a command-chain wrapper script for this …
well, $SNAPCRAFT_* variables are build time vars … it will not carry any value at runtime …
you can deduct the arch from the $SNAP_ARCH variable, but it is a bit awkward since you need to craft the triplet itself from i.e. a case function in the script.
or you could dynamically sed the hook content at build time using the SNAPCRAFT_ARCH_TRIPLET variable …
hmm, indeed, i didn’t think about that but the hooks run as root and not as the user executing the install (you might find the link in /root), i guess the link should rather come from some startup wrapper.