From 3d6bd07c574fb9b072c3604e85e8bb02e5fa938c Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Aug 2023 10:16:12 +0300 Subject: [PATCH] python3.pkgs.numba: fix source hash, and explain upstream .gitattributes --- pkgs/development/python-modules/numba/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index f9bf6d6c3229..da0f72a43375 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -37,9 +37,20 @@ in buildPythonPackage rec { owner = "numba"; repo = "numba"; rev = "fcf94205335dcc6135d2e19c07bbef968d13610d"; - hash = "sha256-9YmIX+ydDA7xcPqjDus1LSrAhsgv6eVpKLZVzX8Cv0w="; + # Upstream uses .gitattributes to inject information about the revision + # hash and the refname into `numba/_version.py`, see: + # + # - https://git-scm.com/docs/gitattributes#_export_subst and + # - https://github.com/numba/numba/blame/5ef7c86f76a6e8cc90e9486487294e0c34024797/numba/_version.py#L25-L31 + # + # Hence this hash may change if GitHub / Git will change it's behavior. + # Hopefully this will not happen until the next release. We are fairly sure + # that upstream relies on those strings to be valid, that's why we don't + # use `forceFetchGit = true;`.` If in the future we'll observe the hash + # changes too often, we can always use forceFetchGit, and inject the + # relevant strings ourselves, using `sed` commands, in extraPostFetch. + hash = "sha256-Wm1sV4uS/Xkz1BkT2xNmwgBZS0X8YziC6jlbfolXGB8="; }; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; nativeBuildInputs = [