Closed pravic closed 4 months ago
Judging by the mentioned workaround, looks like it's a problem more of https://github.com/rust-lang/git2-rs rather than from cross
?
The error could be correct, just that git2 crate for some reason hits the path that git doesn't like.
Try https://github.com/cross-rs/cross/discussions/1473#discussioncomment-9128550
[build]
pre-build = ["git config --system --add safe.directory '*'"]
Yep, it works. Thanks!
Checklist
Describe your issue
Problem
If https://lib.rs/git2 inside
build.rs
tries to open the project repository in order to describe it, thebuild.rs
fails withApparently, the target is build in Docker using the
root
user but the project directory itself is owned by the host user - which results the mentioned error whengit2
tries to open the repository.build.rs
Workaround
On the other hand, calling
git describe
from the build script works fine:What target(s) are you cross-compiling for?
x86_64-unknown-linux-gnu
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.5 (19be834 2024-05-17)
Example
cargo stderr:
Additional information / notes
Cross is installed from the latest master via
cargo install cross --git
.