git: add rust opt-in
With v2.52.0, git now includes the option to use a rust implementation of some core logic [1]. Using rust/cargo as part of the build process is currently still optional, though expected to become mandatory in Git v3.0. In preparation, introduce cargo/rustc into the Git package build. This is disabled by default and enabled via a new `rustSupport` argument to mirror the fact that this is opt-in in Git itself. [1]: lore.kernel.org/git/20251002-b4-pks-rust-breaking-change-v8-0-3a89fd5b1ce7@pks.im/
This commit is contained in:
@@ -51,6 +51,9 @@
|
||||
deterministic-host-uname, # trick Makefile into targeting the host platform when cross-compiling
|
||||
doInstallCheck ? !stdenv.hostPlatform.isDarwin, # extremely slow on darwin
|
||||
tests,
|
||||
rustSupport ? false,
|
||||
cargo,
|
||||
rustc,
|
||||
}:
|
||||
|
||||
assert osxkeychainSupport -> stdenv.hostPlatform.isDarwin;
|
||||
@@ -186,6 +189,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optionals withLibsecret [
|
||||
glib
|
||||
libsecret
|
||||
]
|
||||
++ lib.optionals rustSupport [
|
||||
cargo
|
||||
rustc
|
||||
];
|
||||
|
||||
# required to support pthread_cancel()
|
||||
@@ -234,7 +241,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# acceptable version.
|
||||
#
|
||||
# See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent";
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent"
|
||||
# Starting with future Git version 3.0.0, rust will be mandatory. For now, it's optional.
|
||||
++ lib.optional rustSupport "WITH_RUST=YesPlease";
|
||||
|
||||
disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
stdenv.shellPackage
|
||||
|
||||
Reference in New Issue
Block a user