Package: dask
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: environment
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The home directory is embedded in html documentation:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/diffoscope-results/dask.html

  /usr/share/doc/python-dask-doc/html/configuration.html

  ... 
<span·class="default_value">['/etc/dask',·'/usr/etc/dask',·'/nonexistent/first-build/.config/dask',·'/nonexistent/first-build/.dask']</span>
 ...
vs.
  ... 
<span·class="default_value">['/etc/dask',·'/usr/etc/dask',·'/nonexistent/second-build/.config/dask',·'/nonexistent/second-build/.dask']</span>
 ...


The attached patch fixes this by modifying dask/config.py to not expand
the tilde to the user home dir.

While the patch does make the documentation reproducible, it needs some
run-time testing to ensure that dask works correctly with the patch
applied (e.g. the configuration is checked for in the user's
~/.config/dask and ~/.dask directories)! Someone familiar with dask
should test this before applying the patch!

If it causes issues, taking a deeper look into fixing this in the
documentation will be needed.


With this patch applied, dask should become reproducible in the
tests.reproducible-builds.org infrastructure.


Thanks for maintaining dask!


live well,
  vagrant
From ae0387f269e043a094938e4c71d56b3b03099085 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Fri, 9 Jul 2021 13:40:56 +0000
Subject: [PATCH] dask/config.py: do not expand tilde with home directory

The home directories to search for should not be embedded when
generating the documentation, as it embeds the home directory of the
build user.

Ideally, this would be expanded at run-time, but not when building the
documentation.
---
 debian/patches/series                  |  1 +
 debian/patches/use-tilde-homedir.patch | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 debian/patches/use-tilde-homedir.patch

diff --git a/debian/patches/series b/debian/patches/series
index 9b7a15e..c6e478a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ use-local-intersphinx.patch
 use-local-reference-yaml.patch
 js-yaml.patch
 use-youtube-nocookie.patch
+use-tilde-homedir.patch
diff --git a/debian/patches/use-tilde-homedir.patch b/debian/patches/use-tilde-homedir.patch
new file mode 100644
index 0000000..6403e7c
--- /dev/null
+++ b/debian/patches/use-tilde-homedir.patch
@@ -0,0 +1,26 @@
+From: Vagrant Cascadian <vagr...@reproducible-builds.org>
+Date: Fri Jul  9 05:22:39 UTC 2021
+Subject: do not expand tilde with home directory
+
+The home directories to search for should not be embedded when
+generating the documentation, as it embeds the home directory of the
+build user.
+
+Ideally, this would be expanded at run-time, but not when building the
+documentation.
+
+diff --git a/dask/config.py b/dask/config.py
+index 27d8492..8dbcfa7 100644
+--- a/dask/config.py
++++ b/dask/config.py
+@@ -15,8 +15,8 @@ no_default = "__no_default__"
+ paths = [
+     os.getenv("DASK_ROOT_CONFIG", "/etc/dask"),
+     os.path.join(sys.prefix, "etc", "dask"),
+-    os.path.join(os.path.expanduser("~"), ".config", "dask"),
+-    os.path.join(os.path.expanduser("~"), ".dask"),
++    os.path.join("~", ".config", "dask"),
++    os.path.join("~", ".dask"),
+ ]
+ 
+ if "DASK_CONFIG" in os.environ:
-- 
2.32.0

Attachment: signature.asc
Description: PGP signature

Reply via email to