-
Cloning a repo with git2, the rust wrapper around libgit2, fails, but only when using zig and pyo3. Both using the default linker with pyo3 and using a binary linked with zig works. Minimized example: [package]
name = "git_fail"
version = "0.1.0"
edition = "2021"
[lib]
name = "git_fail"
crate-type = ["cdylib", "rlib"]
[dependencies]
git2 = { version = "0.14.4", features = ["vendored-openssl", "vendored-libgit2"] }
libz-sys = { version = "1.1.8", features = ["static"] }
pyo3 = { version = "0.16.5", optional = true, features = ["abi3-py37", "extension-module"] }
[features]
default = []
python-bindings = ["pyo3"] use git2::Repository;
#[cfg_attr(feature = "python-bindings", pyo3::pyfunction)]
pub fn run() {
Repository::clone("https://github.com/sokrypton/ColabFold", "repodir").unwrap();
}
#[cfg(feature = "python-bindings")]
#[pyo3::pymodule]
fn git_fail(_py: pyo3::Python<'_>, m: &pyo3::types::PyModule) -> pyo3::PyResult<()> {
m.add_function(pyo3::wrap_pyfunction!(run, m)?)?;
Ok(())
} use git_fail::run;
fn main() {
println!("Hello, world!");
run()
}
I'd like to try without the vendored/static, but then zig cc (unlike gcc) doesn't find the headers anymore, so i'd also appreciate any hints how to get zig cc to use the system headers. Any idea how to even debug this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Can you use |
Beta Was this translation helpful? Give feedback.
-
Does |
Beta Was this translation helpful? Give feedback.
Does
CFLAGS="-Ixxx"
work?