-
Notifications
You must be signed in to change notification settings - Fork 6
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
Path config options should get Android-specific defaults #11
Comments
Hmm, this is a bit annoying to fix due to golang's quirks. The first thing RSAF does when initializing rclone is setting the general cache directory. Both I might be able to work around this by setting the |
|
Due to how golang calls each packages' init() functions, it's impossible to have a shared library function that runs before any of the init()s. Instead, we'll set the XDG_CACHE_HOME environment variable. This has its own problems because calling setenv() from the Kotlin side only affects libc's global environ variable, which golang does not use (it maintains its own copy of envp). This commit works around that by importing a new envhack package that explicitly copies libc's environ to golang via CGO. Fixes: #11 Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Due to how golang calls each packages' init() functions, it's impossible to have a shared library function that runs before any of the init()s. Instead, we'll set the XDG_CACHE_HOME environment variable. This has its own problems because calling setenv() from the Kotlin side only affects libc's global environ variable, which golang does not use (it maintains its own copy of envp). This commit works around that by importing a new envhack package that explicitly copies libc's environ to golang via CGO. Fixes: #11 Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Fixed by #12.
RSAF currently does enable the VFS cache. It's equivalent to running I currently have no plans to add caching beyond what rclone's VFS cache provides. |
I'm not sure I follow — do you mean it's enabled by default? |
That's correct. It's enabled by default and cannot be disabled (because the feature is required for some of RSAF's functionality, like random writes). |
Ah, OK — I tested it only by copying, which it isn't supposed to support. So it should work fine as an output directory for BCR, for example, when offline? (Whether the caching is reliable enough for that to be a good idea is a separate question.) |
Ah, yep. rclone's copy/move functionality bypasses the VFS layer completely, in order to support server-side operations when copying/moving files on the same remote. They didn't make a separate implementation (with VFS cache) for other scenarios, like copies across remotes or copies from local to remote.
In theory, I would think so, though I haven't really taken a close look at how long rclone will keep retrying uploads. In the worst case where rclone completely fails to upload, it's possible to manually grab the files out of the VFS cache. You can create an |
Currently, path config options seem to get the typical Linux details. For example, both
db_path
andchunk_path
get/data/local/tmp/rclone/cache-backend
instead of something like/data/data/com.chiller3.rsaf/cache-backend
. The app cannot access the former, which results in an error and the whole cache remote doesn't work.Additionally, the description of
chunk_path
reads:Currently, this is not true in RSAF. If I configure just the
db_path
and not thechunk_path
(which I verified to be the case by exporting the config file), it still tries to access the default/data/local/tmp/rclone/cache-backend
directory which it doesn't have access to. I had to specify an appropriate paths for both of these options to get this remote to work.By the way, I just noticed this fragment on the rclone website:
This seems to explain buggy behavior that I noticed while testing out
cache
in RSAF — though I'm not sure if these are problems with the rclone itself or something specific to RSAF, because I don't have any experience withcache
backend on other systems. This backend seems to have been deprecated in 1.39, which is very unfortunate, because I don't see any good option to userclone mount
on Android, which would be necessary to use the VFS caching layer. I think that some way of caching operations on Android is a must, because mobile devices are more likely to have unstable Internet connections. Do you plan to look into that, maybe?The text was updated successfully, but these errors were encountered: