From e72eda8dc7047b4a74319d82a2e645655602c1e0 Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Fri, 13 Jun 2025 16:25:01 +0200 Subject: [PATCH] python3Packages.msgspec: fix src hash The source hash changes because they use `$Format:%d$` in their code, and GitHub can substitute this with different things in different times, see https://github.com/NixOS/nixpkgs/issues/84312. In this case, the diff looks like this: ``` diff -ur /nix/store/v2yfg05q83i154bdi2s96g21zi079rgi-source/msgspec/_version.py /nix/store/94zddrfms1ikx61i0plxnqdd3gavfdzr-source/msgspec/_version.py --- /nix/store/v2yfg05q83i154bdi2s96g21zi079rgi-source/msgspec/_version.py 1970-01-01 00:00:01.000000000 +0000 +++ /nix/store/94zddrfms1ikx61i0plxnqdd3gavfdzr-source/msgspec/_version.py 1970-01-01 00:00:01.000000000 +0000 @@ -24,7 +24,7 @@ # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = " (HEAD -> main, tag: 0.19.0)" + git_refnames = " (tag: 0.19.0)" git_full = "dd965dce22e5278d4935bea923441ecde31b5325" git_date = "2024-12-27 11:06:58 -0600" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} ``` Fix the hash and add a comment explaining the situation. --- pkgs/development/python-modules/msgspec/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/msgspec/default.nix b/pkgs/development/python-modules/msgspec/default.nix index 61503c3a51d6f..44bc828d36254 100644 --- a/pkgs/development/python-modules/msgspec/default.nix +++ b/pkgs/development/python-modules/msgspec/default.nix @@ -17,7 +17,11 @@ buildPythonPackage rec { owner = "jcrist"; repo = "msgspec"; tag = version; - hash = "sha256-g2yhw9fMucBHlGx9kAMQL87znXlQT9KbxQ/QcmUetqI="; + # Note that this hash changes after some time after release because they + # use `$Format:%d$` in msgspec/_version.py, and GitHub produces different + # tarballs depending on whether tagged commit is the last commit, see + # https://github.com/NixOS/nixpkgs/issues/84312 + hash = "sha256-CajdPNAkssriY/sie5gR+4k31b3Wd7WzqcsFmrlSoPY="; }; build-system = [ setuptools ];