After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780472 - Cannot delete files in flatpak version
Cannot delete files in flatpak version
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
: 783946 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-03-23 19:30 UTC by Felix Häcker
Modified: 2017-09-26 23:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
project: use "gio trash" under flatpak (5.36 KB, patch)
2017-09-26 23:02 UTC, Christian Hergert
none Details | Review

Description Felix Häcker 2017-03-23 19:30:56 UTC
In the flatpak version it isn't possible to delete files from the left sidebar. "Move to trash". Nothing is happening.
Comment 1 Christian Hergert 2017-03-25 00:57:37 UTC
Weird, it seems like it should work.

$ flatpak run --talk-name=org.gtk.vfs.* --talk-name=org.gtk.vfs --filesystem=host --filesystem=home org.gnome.Sdk 
sh-4.3$ python3 
>>> from gi.repository import Gio
>>> f = Gio.File.new_for_path('/home/christian/Projects/rtfm/Makecache')
>>> f.query_exists()
True
>>> f.trash()
True
>>> f.query_exists()
False
>>> 

But when running with Builder, I get:

 WARNING: Unable to trash file /home/christian/Projects/jsonrpc-glib/Makecache across filesystem boundaries
Comment 2 Christian Hergert 2017-03-25 01:01:10 UTC
Also, if i do the above test case, but use --command=bash with org.gnome.Builder instead of org.gnome.Sdk, I get the failure. So it must be some issue with our manifest.
Comment 3 Christian Hergert 2017-03-25 01:14:25 UTC
So when I compare the mounts between the above, it looks like we map in /home/christian/.local/share/flatpak to get access to the users Flatpak installation.

However, .local/share/Trash is the location for trash. The descendant bind-mount might be confusing things.
Comment 4 Christian Hergert 2017-03-25 02:27:09 UTC
Okay, bit more digging...

It looks like .var/app/org.gnome.Builder/data/Trash is where Gio is trying to move the file. Then it fails a cross-device check later on.
Comment 5 Christian Hergert 2017-09-26 22:51:37 UTC
*** Bug 783946 has been marked as a duplicate of this bug. ***
Comment 6 Christian Hergert 2017-09-26 23:02:06 UTC
Created attachment 360504 [details] [review]
project: use "gio trash" under flatpak

Until we have a working implementation of trash detecting cross-filesystem
boundary moves, we should have a fallback that still tries to trash the
file correctly (without being destructive).

This falls back to "gio trash $uri" on the host. While not ideal, it should
be enough to do the right thing as a stop gap.
Comment 7 Christian Hergert 2017-09-26 23:43:34 UTC
The workaround we have for this should at least enable things to work, but we should certainly try to fix things better in Gio so that all applications work.

My understanding is that the lower gio layers will need to check /proc/self/mountinfo to determine if something is actually on the same underlying device.