Skip to content

Commit

Permalink
feat: use git on host computer for git cloning (replaces libgit2) (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
swarnimarun authored Nov 14, 2023
1 parent bd06534 commit 1bd5d9a
Show file tree
Hide file tree
Showing 7 changed files with 413 additions and 307 deletions.
97 changes: 31 additions & 66 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ readme = "README.md"
default = ['native-tls']
native-tls = ['reqwest/native-tls', 'rattler/native-tls']
rustls-tls = ['reqwest/rustls-tls', 'rattler/rustls-tls']
git = ['dep:git2']

[dependencies]
serde = { version = "1.0.190", features = ["derive"] }
Expand Down Expand Up @@ -75,17 +74,18 @@ tempfile = "3.8.1"
chrono = "0.4.31"
sha1 = "0.10.6"
spdx = "0.10.2"
git2 = { version = "0.18.1", features = ["vendored-openssl"], optional = true }
fs_extra = "1.3.0"
ignore = "0.4.20"
globset = "0.4.13"
tracing-indicatif = "0.3.5"
clap-verbosity-flag = "2.1.0"
tracing-core = "0.1.32"
dunce = "1.0.4"

[dev-dependencies]
insta = { version = "1.34.0", features = ["yaml"] }
rstest = "0.18.2"
tracing-test = "0.2.4"

[profile.dev.package."*"]
opt-level = 3
Expand Down
14 changes: 14 additions & 0 deletions rust-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,18 @@ mod tests {
assert_eq!(std::fs::read_to_string(installer).unwrap().trim(), "conda");
check_info(pkg, recipes().join("toml/expected"));
}

#[test]
fn test_git_source() {
let tmp = tmp();
let rattler_build =
rattler().build::<_, _, &str>(recipes().join("llamacpp"), tmp.as_dir(), None);
assert!(rattler_build.is_ok());
let pkg = get_extracted_package(tmp.as_dir(), "llama.cpp");
// this is to ensure that the clone happens correctly
let license = pkg.join("info/licenses/LICENSE");
assert!(license.exists());
let src = std::fs::read_to_string(license).unwrap();
assert!(src.contains(" Georgi "));
}
}
Loading

0 comments on commit 1bd5d9a

Please sign in to comment.