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

Improve handling of a symlinked application directory #557

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

intelfx
Copy link

@intelfx intelfx commented Jul 23, 2023

Two changes to better handle a case where the application directory is a symlink (e. g. to a faster/larger storage or a scratch location):

  • when --force-clean is passed, only clear the contents of the application directory, not the dir itself;
  • change the same-filesystem check to consider the application directory rather than its parent.

I had to write some new code in libglnx which is tracked in this MR: https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/49

If `--force-clean` is passed, clear (remove the contents of) the target (app)
directory without deleting the directory itself.

This is useful if the app directory is a symlink, e. g. to a faster disk or a
scratch location.

Submodule subprojects/libglnx 07e3e49d..1a503dcc:
  > shutil: add glnx_shutil_rm_rf_children_at()
  > shutil: specify symlink behavior of glnx_shutil_rm_rf_at(), add tests
  > tests: add a macro to check for positive errno
We only care about the app (== target) directory, not its parent.

This breaks if the target directory is a symlink, like this:

```
$ pwd
/path/to/code

$ realpath state
/path/to/scratch/state

$ realpath build
/path/to/scratch/target

$ flatpak-builder --state-dir=state build org.some.App.yaml
The state dir (/path/to/scratch/state) is not on the same filesystem as the target dir (/path/to/code)
```
@intelfx intelfx marked this pull request as draft July 23, 2023 17:42
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.

None yet

1 participant