radicle-heartwood-lfs/crates/radicle-node/src
Lorenz Leutgeb 2149770a4b
storage: Rewrite temporary repositories for clones
On Windows, all attempts to clone repositories failed with

    Fetch failed for rad:… from z6Mk…: Access is denied. (os error 5)

The reason is that, other than Unix-like systems, it forbids that
directories that are in use are moved.

To improve the situation, take back control over what is moved and
removed exactly by implementing `cleanup` instead of relying
on `impl Drop for tempfile::TempDir`.

A new type `TempRepository` is introduced to capture a repository that can be
used temporarily, and either cleaned up on failure, or moved on success.
This `TempRepository` can be constructed using `Storage::temporary_repository` –
renamed from `Storage::lock_repository` since it is only creating a temporary
resource and not locking it.

In the future (once Rust 1.89 is a little less cutting edge and more
widely available), we may opt for actual locking via
`std::fs::File::lock`.
2025-10-06 11:52:42 +02:00
..
runtime node: Use winpipe for control socket on Windows 2025-08-22 15:45:20 +01:00
test node: e2e test for canonical ref update 2025-08-25 18:49:43 +01:00
tests radicle: Allow creating bare clones 2025-09-15 10:21:09 +01:00
worker storage: Rewrite temporary repositories for clones 2025-10-06 11:52:42 +02:00
control.rs node/control: Please the borrow checker 2025-08-24 20:04:00 +02:00
fingerprint.rs node: Make location of secret key configurable 2025-09-26 13:03:57 +01:00
lib.rs node: Make location of secret key configurable 2025-09-26 13:03:57 +01:00
main.rs node/log: Define syslog identifier 2025-10-01 16:46:46 +02:00
runtime.rs node/systemd: Check that received sockets are AF_UNIX 2025-08-25 17:17:34 +01:00
test.rs node, protocol: Refactor 2025-07-16 21:15:52 +02:00
tests.rs Introduce a node event for canonical reference updates 2025-08-25 18:49:43 +01:00
wire.rs protocol: Refactor encoding 2025-08-25 11:57:44 +01:00
worker.rs Replace unit-returning-closure with drop() 2025-08-19 10:57:37 +01:00