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

Print a more helpful error message if manifest path is not writable #390

Closed
wants to merge 1 commit into from

Conversation

bbhtt
Copy link
Contributor

@bbhtt bbhtt commented Nov 3, 2023

See flathub/org.flathub.flatpak-external-data-checker#117

I'm not convinced it is a good idea to print custom messages than the inbuilt ones...

The other places I saw a file was being opened as writable is in add_release_to_file and dump_manifest. I don't think the appdata can get updated independently of the manifest, so both should be handled by this.

Some of the git operations might fail due to lack of permissions/whatever but I haven't checked for those as they have no error handling.

Eg. try committing changes from the flatpaked version without access to the git's config file (if it in xdg-config/git, not handled by --filesystem=host) - it prints an ugly error message. Try committing changes without any actual change - same thing.

src/manifest.py Outdated Show resolved Hide resolved
@dreua
Copy link

dreua commented Nov 3, 2023

I was thinking about an even more concrete hint like:

Run the app with flatpak run --filesystem=$(pwd) org.flathub.flatpak-external-data-checker [args]

The use case is to educate people who are not familiar with the flatpak CLI or just forget stuff they used to know while still having all the benefits of sandboxing.

@dreua
Copy link

dreua commented Nov 3, 2023

I now see the issue with git and it's config files, that might indeed be a problem. In GUI apps we need and have some defaults too which get passed in the sandbox to get everything to work but it is probably not as mature for CLI. On the other hand, when I last used this the above hint really helped me and was sufficient.

@bbhtt
Copy link
Contributor Author

bbhtt commented Nov 3, 2023

I was thinking about an even more concrete hint like:

That won't work. You can be running the checker in a different working directory while having the manifest in a separate directory. Then --filesystem=$(pwd) would resolve to the current working directory, not the location of the manifest.

Eg. try running it in ~/Downloads while having the manifest not in ~/Downloads or any of its subdirectory like in ~/Projects.

@dreua
Copy link

dreua commented Nov 3, 2023

I know that. The use case is a developer with some experience in Linux who understands stuff like that but just doesnt know or think about the faltpak specific necessities and commands.

@bbhtt bbhtt force-pushed the rw-error branch 3 times, most recently from 69f6fea to 2e78340 Compare November 5, 2023 07:09
@bbhtt
Copy link
Contributor Author

bbhtt commented Nov 5, 2023

Added a bit better hint.

@wjt
Copy link
Contributor

wjt commented Nov 9, 2023

I think it's better to just let it write to whatever it can see. I will merge flathub/org.flathub.flatpak-external-data-checker#223.

@wjt wjt closed this Nov 9, 2023
@bbhtt bbhtt deleted the rw-error branch November 9, 2023 16:37
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.

3 participants