Use git2 version of vergen (#30804)

When compiling Servo on MacOS, the version of libintl that comes bundled
with GStreamer is not compatible with the one used by Homebrew. This can
cause issues when adding GStreamer shared objects to the library
resolution path and then trying to run Homebrew git. Using libgit seems
to work around this issue.

The failure case means that the version compiled into Servo does not
properly include the git hash.
This commit is contained in:
Martin Robinson 2023-12-01 17:05:17 +01:00 committed by GitHub
parent 604979e367
commit 20a122c2f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

26
Cargo.lock generated
View file

@ -2123,6 +2123,19 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "git2"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd"
dependencies = [
"bitflags 2.4.1",
"libc",
"libgit2-sys",
"log",
"url",
]
[[package]]
name = "gl_generator"
version = "0.14.0"
@ -3259,6 +3272,18 @@ dependencies = [
"take_mut",
]
[[package]]
name = "libgit2-sys"
version = "0.16.1+1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c"
dependencies = [
"cc",
"libc",
"libz-sys",
"pkg-config",
]
[[package]]
name = "libloading"
version = "0.7.4"
@ -6475,6 +6500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939"
dependencies = [
"anyhow",
"git2",
"rustversion",
"time 0.3.23",
]

View file

@ -14,7 +14,7 @@ path = "main.rs"
bench = false
[build-dependencies]
vergen = { version = "8.2.6", features = ["git", "gitcl"] }
vergen = { version = "8.2.6", features = ["git", "git2"] }
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"