From 20a122c2f6a1a97cf39938bc90b0d91cc198f0c7 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Fri, 1 Dec 2023 17:05:17 +0100 Subject: [PATCH] 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. --- Cargo.lock | 26 ++++++++++++++++++++++++++ ports/servoshell/Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 43a4529afa1..555e20e03ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", ] diff --git a/ports/servoshell/Cargo.toml b/ports/servoshell/Cargo.toml index 6e3fb9694ea..505346cf5b5 100644 --- a/ports/servoshell/Cargo.toml +++ b/ports/servoshell/Cargo.toml @@ -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"