Bug#983852: python-scrapy: please make the build reproducible

2024-05-06 Thread Andrey Rakhmatullin
On Thu, Nov 30, 2023 at 04:22:35PM -0800, Vagrant Cascadian wrote:
> It was suggested drop the practice of using the build year at all and
> manually updating the year... though upstream did not go so far as to
> actually do that as far as I can tell.
We now did, at https://github.com/scrapy/scrapy/pull/6322


-- 
WBR, wRAR


signature.asc
Description: PGP signature


Bug#983852: python-scrapy: please make the build reproducible

2023-11-30 Thread Vagrant Cascadian
On 2021-03-02, Chris Lamb wrote:
> Whilst working on the Reproducible Builds effort [0] we noticed that
> python-scrapy could not be built reproducibly.
>
> This is because it uses the current build year when building the
> documentation which, of course, changes depending which year you
> build the software.
>
> Patch attached that uses SOURCE_DATE_EPOCH [1] instead.

In the upstream pull request:

  https://github.com/scrapy/scrapy/pull/5019

It was suggested drop the practice of using the build year at all and
manually updating the year... though upstream did not go so far as to
actually do that as far as I can tell.

Perhaps a really simple patch with the most recent copyright year
hard-coded that needs to be updated alongside debian/copyright would be
acceptible? It could also check to make sure the most recent year
mentioned in debian/copyright matches the patch year, if you really
wanted to make sure they stayed in sync.

Alternately, going with the SOURCE_DATE_EPOCH patch for now until
upstream decides how to fix it?


live well,
  vagrant


signature.asc
Description: PGP signature


Bug#983852: python-scrapy: please make the build reproducible

2021-03-02 Thread Chris Lamb
Hi,

> […]

The patch I previously sent was slightly corrupted due to a snafu with me
using quilt locally. Please find a cleaner one attached.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-
--- a/debian/patches/0002-Reproducible-build.patch  1970-01-01 
01:00:00.0 +0100
--- b/debian/patches/0002-Reproducible-build.patch  2021-03-02 
09:06:06.826207329 +
@@ -0,0 +1,28 @@
+Description: Make the build reproducible
+Author: Chris Lamb 
+Last-Update: 2021-03-02
+
+--- python-scrapy-2.4.1.orig/docs/conf.py
 python-scrapy-2.4.1/docs/conf.py
+@@ -9,7 +9,9 @@
+ # All configuration values have a default; values that are commented out
+ # serve to show the default.
+ 
++import os
+ import sys
++import time
+ from datetime import datetime
+ from os import path
+ 
+@@ -49,7 +51,10 @@ master_doc = 'index'
+ 
+ # General information about the project.
+ project = 'Scrapy'
+-copyright = f'2008\u2013{datetime.now().year}, Scrapy developers'
++build_date = datetime.utcfromtimestamp(
++int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++)
++copyright = f'2008\u2013{build_date.year}, Scrapy developers'
+ 
+ # The version info for the project you're documenting, acts as replacement for
+ # |version| and |release|, also used in various other places throughout the
--- a/debian/patches/series 2021-03-02 08:55:59.355009205 +
--- b/debian/patches/series 2021-03-02 09:05:31.529789277 +
@@ -1 +1,2 @@
 0001-Disable-hoverxref-and-notfound-Sphinx-extensions.patch
+0002-Reproducible-build.patch


Bug#983852: python-scrapy: please make the build reproducible

2021-03-02 Thread Chris Lamb
Source: python-scrapy
Version: 2.4.1-2
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

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

This is because it uses the current build year when building the
documentation which, of course, changes depending which year you
build the software.

Patch attached that uses SOURCE_DATE_EPOCH [1] instead.

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/specs/source-date-epoch/


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-
--- a/debian/patches/2-Reproducible-build.patch 1970-01-01 
01:00:00.0 +0100
--- b/debian/patches/2-Reproducible-build.patch 2021-03-02 
09:06:06.826207329 +
@@ -0,0 +1,28 @@
+Description: Make the build reproducible
+Author: Chris Lamb 
+Last-Update: 2021-03-02
+
+--- python-scrapy-2.4.1.orig/docs/conf.py
 python-scrapy-2.4.1/docs/conf.py
+@@ -9,7 +9,9 @@
+ # All configuration values have a default; values that are commented out
+ # serve to show the default.
+ 
++import os
+ import sys
++import time
+ from datetime import datetime
+ from os import path
+ 
+@@ -49,7 +51,10 @@ master_doc = 'index'
+ 
+ # General information about the project.
+ project = 'Scrapy'
+-copyright = f'2008\u2013{datetime.now().year}, Scrapy developers'
++build_date = datetime.utcfromtimestamp(
++int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++)
++copyright = f'2008\u2013{build_date.year}, Scrapy developers'
+ 
+ # The version info for the project you're documenting, acts as replacement for
+ # |version| and |release|, also used in various other places throughout the
--- a/debian/patches/2-Reproducible-build.patch~1970-01-01 
01:00:00.0 +0100
--- b/debian/patches/2-Reproducible-build.patch~2021-03-02 
09:05:49.602003318 +
@@ -0,0 +1,28 @@
+Description: Make the build reproducible
+Author: Chris Lamb 
+Last-Update: 2021-03-02
+
+--- python-scrapy-2.4.1.orig/docs/conf.py
 python-scrapy-2.4.1/docs/conf.py
+@@ -9,7 +9,9 @@
+ # All configuration values have a default; values that are commented out
+ # serve to show the default.
+ 
++import os
+ import sys
++import time
+ from datetime import datetime
+ from os import path
+ 
+@@ -49,7 +51,10 @@ master_doc = 'index'
+ 
+ # General information about the project.
+ project = 'Scrapy'
+-copyright = f'2008\u2013{datetime.now().year}, Scrapy developers'
++year = datetime.utcfromtimestamp(
++int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++).year
++copyright = f'2008\u2013{year}, Scrapy developers'
+ 
+ # The version info for the project you're documenting, acts as replacement for
+ # |version| and |release|, also used in various other places throughout the
--- a/debian/patches/series 2021-03-02 08:55:59.355009205 +
--- b/debian/patches/series 2021-03-02 09:05:31.529789277 +
@@ -1 +1,2 @@
 0001-Disable-hoverxref-and-notfound-Sphinx-extensions.patch
+2-Reproducible-build.patch
--- a/docs/conf.py  2021-03-02 08:55:59.355009205 +
--- b/docs/conf.py  2021-03-02 09:06:05.762194727 +
@@ -9,7 +9,9 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
+import os
 import sys
+import time
 from datetime import datetime
 from os import path
 
@@ -49,7 +51,10 @@
 
 # General information about the project.
 project = 'Scrapy'
-copyright = f'2008\u2013{datetime.now().year}, Scrapy developers'
+build_date = datetime.utcfromtimestamp(
+int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
+)
+copyright = f'2008\u2013{build_date.year}, Scrapy developers'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the