Bug#1005825: hatchling: please make the build reproducible

Chris Lamb lamby at debian.org
Tue Feb 15 17:22:40 GMT 2022


Source: hatchling
Version: 0.12.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
hatchling could not be built reproducibly.

This is because it included the checksums of (unshipped) .pyc files in
the 'RECORD' file. A patch is attached that strips them out; this change
is analogous to a similar conditional later in the wheel.py file.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch	1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/reproducible-build.patch	2022-02-15 09:17:59.109693142 -0800
@@ -0,0 +1,16 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2022-02-15
+
+--- hatchling-0.12.0.orig/src/hatchling/builders/wheel.py
++++ hatchling-0.12.0/src/hatchling/builders/wheel.py
+@@ -228,6 +228,9 @@ class WheelBuilder(BuilderInterface):
+         metadata_directory = '{}.dist-info'.format(self.project_id)
+         with WheelArchive(metadata_directory, self.config.reproducible) as archive, closing(StringIO()) as records:
+             for included_file in self.recurse_project_files():
++                if included_file.path.endswith('.pyc'):
++                    continue
++
+                 record = archive.add_file(included_file)
+                 records.write(self.format_record(record))
+ 
--- a/debian/patches/series	1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/series	2022-02-15 09:16:38.209602402 -0800
@@ -0,0 +1 @@
+reproducible-build.patch


More information about the Reproducible-bugs mailing list