Skip to content

Commit 829fe4d

Browse files
committed
feat(snix/castore): builtins.fetchGit
This adds builtins.fetchgit and the backing git import based on gitoxide. The implementation uses a temporary directory to clone a bare git repository in a separate thread. gitoxide does not yet have full async support for cloning ssh-based repositories, which is why a separate thread is used. builtins.fetchgit has more requirements than the Nix equivalent. rev is always required and a sha256 to check is not supported at this time. Change-Id: I035756c300bd694ab4ca4640ba941e4603925523
1 parent 71d7185 commit 829fe4d

File tree

16 files changed

+8458
-1285
lines changed

16 files changed

+8458
-1285
lines changed

snix/Cargo.lock

Lines changed: 2004 additions & 491 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snix/Cargo.nix

Lines changed: 5645 additions & 742 deletions
Large diffs are not rendered by default.

snix/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ fastcdc = "3.1.0"
7272
fuse-backend-rs = "0.12.0"
7373
futures = "0.3.30"
7474
genawaiter = { version = "0.99.1", default-features = false }
75+
gix = "0.67.0"
7576
glob = "0.3.1"
7677
hex-literal = "0.4.1"
7778
http = "1.1.0"

snix/castore/Cargo.toml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ thiserror.workspace = true
2323
tokio-stream = { workspace = true, features = ["fs", "net"] }
2424
tokio-util = { workspace = true, features = ["io", "io-util", "codec"] }
2525
tokio-tar.workspace = true
26-
tokio = { workspace = true, features = ["fs", "macros", "net", "rt", "rt-multi-thread", "signal"] }
26+
tokio = { workspace = true, features = [
27+
"fs",
28+
"macros",
29+
"net",
30+
"rt",
31+
"rt-multi-thread",
32+
"signal",
33+
] }
2734
toml = { version = "0.8.19", optional = true }
2835
tonic.workspace = true
2936
tower.workspace = true
@@ -56,6 +63,12 @@ virtio-bindings = { workspace = true, optional = true }
5663
wu-manber.workspace = true
5764
auto_impl = "1.2.0"
5865
hashbrown = "0.15.2"
66+
gix = { workspace = true, features = [
67+
"blocking-network-client",
68+
"blocking-http-transport-reqwest",
69+
] }
70+
gix-archive = "0.16.0"
71+
tempfile.workspace = true
5972

6073
[build-dependencies]
6174
prost-build.workspace = true
@@ -64,7 +77,6 @@ tonic-build.workspace = true
6477
[dev-dependencies]
6578
async-process.workspace = true
6679
rstest.workspace = true
67-
tempfile.workspace = true
6880
tokio-retry.workspace = true
6981
hex-literal.workspace = true
7082
rstest_reuse.workspace = true
@@ -75,22 +87,22 @@ tokio-test.workspace = true
7587
[features]
7688
default = ["cloud"]
7789
cloud = [
78-
"dep:bigtable_rs",
79-
"object_store/aws",
80-
"object_store/azure",
81-
"object_store/gcp",
90+
"dep:bigtable_rs",
91+
"object_store/aws",
92+
"object_store/azure",
93+
"object_store/gcp",
8294
]
8395
fs = ["dep:fuse-backend-rs", "dep:threadpool", "dep:libc"]
8496
virtiofs = [
85-
"fs",
86-
"dep:vhost",
87-
"dep:vhost-user-backend",
88-
"dep:virtio-queue",
89-
"dep:vm-memory",
90-
"dep:vmm-sys-util",
91-
"dep:virtio-bindings",
92-
"fuse-backend-rs?/vhost-user-fs", # impl FsCacheReqHandler for SlaveFsCacheReq
93-
"fuse-backend-rs?/virtiofs",
97+
"fs",
98+
"dep:vhost",
99+
"dep:vhost-user-backend",
100+
"dep:virtio-queue",
101+
"dep:vm-memory",
102+
"dep:vmm-sys-util",
103+
"dep:virtio-bindings",
104+
"fuse-backend-rs?/vhost-user-fs", # impl FsCacheReqHandler for SlaveFsCacheReq
105+
"fuse-backend-rs?/virtiofs",
94106
]
95107
fuse = ["fs"]
96108
tonic-reflection = ["dep:tonic-reflection"]

0 commit comments

Comments
 (0)