gitMinimal: enable rust support

Git 3.0 will require Rust, so we should get this out of the way now.
This commit is contained in:
Winter
2026-09-27 09:32:48 +02:00
parent 27245c4444
commit 6e9e4313d5
3 changed files with 23 additions and 3 deletions

View File

@@ -13,6 +13,15 @@
firefox-esr-unwrapped,
}:
let
# This pin basically never gets updated.
headers = fetchFromGitHub {
owner = "WebAssembly";
repo = "WASI";
rev = "59cbe140561db52fc505555e859de884e0ee7f00";
hash = "sha256-qCZI+aQfzddO7J5OY5SphrcyAuwGecNQveVZycVMfXM=";
};
in
stdenvNoLibc.mkDerivation (finalAttrs: {
pname = "wasilibc";
version = "32";
@@ -23,14 +32,18 @@ stdenvNoLibc.mkDerivation (finalAttrs: {
owner = "WebAssembly";
repo = "wasi-libc";
tag = "wasi-sdk-${finalAttrs.version}";
hash = "sha256-iP/SFYvO8zQMwwbY4VvIboO+Kx195L9brpMq8cbsA7c=";
fetchSubmodules = true;
hash = "sha256-7SL/205NkcbJvGsNYX3tjOjwM418y7z0QCUe4WDu4ls=";
# We don't use `fetchSubmodules` here to avoid a cycle between `gitMinimal` -> `rustc` -> LLVM -> bintools -> rustc
};
patches = [
./0000-relax-version-bounds.patch
];
postPatch = ''
ln -s ${headers} tools/wasi-headers
'';
nativeBuildInputs = [
cmake
lld

View File

@@ -6,6 +6,9 @@
gitMinimal,
hatchling,
setuptools-scm,
doCheck ? false, # `gitMinimal` for tests depends on Rust, which depends on LLVM, which depends on `hatch-vcs`. So, disable tests by default to easily break the cycle.
hatch-vcs,
}:
buildPythonPackage rec {
@@ -26,6 +29,8 @@ buildPythonPackage rec {
setuptools-scm
];
inherit doCheck;
nativeCheckInputs = [
gitMinimal
pytestCheckHook
@@ -38,6 +43,8 @@ buildPythonPackage rec {
pythonImportsCheck = [ "hatch_vcs" ];
passthru.tests.withChecks = hatch-vcs.override { doCheck = true; };
meta = {
changelog = "https://github.com/ofek/hatch-vcs/releases/tag/v${version}";
description = "Plugin for Hatch that uses your preferred version control system (like Git) to determine project versions";

View File

@@ -1077,8 +1077,8 @@ with pkgs;
osxkeychainSupport = false;
pythonSupport = false;
perlSupport = false;
rustSupport = false; # Needed for bootstrap
withpcre2 = false;
cargo = cargo.override { auditable = false; }; # Break `cargo-auditable` -> `fetch-cargo-vendor` -> `nix-prefetch-git` -> `gitMinimal` cycle
curl = if stdenv.hostPlatform.isFreeBSD then curlMinimal else curl; # Needed for FreeBSD bootstrap
};