Skip to content

Allow the snap to access package management folders (local and remote) - #1

Open
pachi wants to merge 1 commit into
typst:mainfrom
pachi:main
Open

pachi wants to merge 1 commit into
typst:mainfrom
pachi:main

Conversation

@pachi

@pachi pachi commented Jul 2, 2024

Copy link
Copy Markdown

Snap apps don't have access by default to hidden files, even to those in the user dir. Typst uses ~/.local/share/typst and ~/.cache/typst for package management and without access to those, local packages or previously downloaded packages can't be used.

The needed package locations are documented at https://github.com/typst/packages/tree/main

The proposed configuration is untested and may be incomplete (sorry, I'm just a snap user). Also, it may need further approval from snapcraft admins so the plugs can be automatically automounted for Typst. This permission should be requested, AFAICT, in the forum. The config and the approval proccess are documented in the personal-files interface documentation here: https://snapcraft.io/docs/personal-files-interface

The needed locations are documented at https://github.com/typst/packages/tree/main

This configuration may be incomplete and may need further approval from snapcraft admins that should be requested in the forum.
@PgBiel

PgBiel commented Jul 3, 2024

Copy link
Copy Markdown

Thank you, this seems relevant to this Discord thread, where a user who installed Typst through Snap couldn't access packages: https://discord.com/channels/1054443721975922748/1257748769257295872

@PgBiel PgBiel linked an issue Aug 17, 2024 that may be closed by this pull request

@reknih reknih left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I tried to troubleshoot it for a few hours today and was not able to get it working. The Snapcraft.yaml modification you shared works and can connect its plugs using snap connect typst:dot-local-share-typst and so forth but Typst will still fail to discover private packages. I have posted to this effect on the Snapcraft Forum and await their response.

Comment thread snapcraft.tpl.yaml
plugs:
dot-local-share-typst:
interface: personal-files
write:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory only needs read access

Suggested change
write:
read:

@Andrew15-5

Copy link
Copy Markdown

This will ignore XDG_DATA_HOME environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typst Snap package can't access local packages

4 participants