Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pachi
Copy link

@pachi pachi commented Jul 2, 2024

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
Copy link

PgBiel commented Jul 3, 2024

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
Copy link
Member

@reknih reknih left a comment

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.

plugs:
dot-local-share-typst:
interface: personal-files
write:
Copy link
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:

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
3 participants