Debian Bug report logs - #990858
dask: reproducible builds: embeds build user home directory in html documentation

Package: dask; Maintainer for dask is Debian Python Team <team+python@tracker.debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Fri, 9 Jul 2021 14:12:01 UTC

Severity: normal

Tags: patch

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian Python Team <team+python@tracker.debian.org>:
Bug#990858; Package dask. (Fri, 09 Jul 2021 14:12:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Debian Python Team <team+python@tracker.debian.org>. (Fri, 09 Jul 2021 14:12:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: dask: reproducible builds: embeds build user home directory in html documentation
Date: Fri, 09 Jul 2021 07:08:45 -0700
[Message part 1 (text/plain, inline)]
Package: dask
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: environment
X-Debbugs-Cc: reproducible-bugs@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
[0001-dask-config.py-do-not-expand-tilde-with-home-directo.patch (text/x-diff, inline)]
From ae0387f269e043a094938e4c71d56b3b03099085 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@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 <vagrant@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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Team <team+python@tracker.debian.org>:
Bug#990858; Package dask. (Mon, 30 Aug 2021 04:06:03 GMT) (full text, mbox, link).


Acknowledgement sent to Diane Trout <diane@ghic.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Team <team+python@tracker.debian.org>. (Mon, 30 Aug 2021 04:06:03 GMT) (full text, mbox, link).


Message #10 received at submit@bugs.debian.org (full text, mbox, reply):

From: Diane Trout <diane@ghic.org>
To: Vagrant Cascadian <vagrant@reproducible-builds.org>, 990858@bugs.debian.org, submit@bugs.debian.org
Subject: Re: Bug#990858: dask: reproducible builds: embeds build user home directory in html documentation
Date: Sun, 29 Aug 2021 20:26:03 -0700
[Message part 1 (text/plain, inline)]
Hi sorry for being slow about looking at this.

This is the ultimate answer after updating the package and looking to
see where the config block is generated I found this text.

   *Note: for historical reasons we also look in the ``~/.dask``
   directory for config files.  This is deprecated and will soon be
   removed.*
   
I think upstream just removed the block that was causing the
unreproducible change you spotted.

I started thinking that the patch probably wouldn't work correctly
because python IO functions won't internally expand "~" when trying to
open files. So, depending on how widely dask.config.paths is used in
dask,  that might cause problems when opening files.

Thanks you for encouraging me to make better packages.

Diane

On Fri, 2021-07-09 at 07:08 -0700, Vagrant Cascadian wrote:
> Package: dask
> Severity: normal
> Tags: patch
> User: reproducible-builds@lists.alioth.debian.org
> Usertags: environment
> X-Debbugs-Cc: reproducible-bugs@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',·'/nonexist
> ent/first-build/.config/dask',·'/nonexistent/first-
> build/.dask']</span> ...
> vs.
>   ...
> <span·class="default_value">['/etc/dask',·'/usr/etc/dask',·'/nonexist
> ent/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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Team <team+python@tracker.debian.org>:
Bug#990858; Package dask. (Mon, 30 Aug 2021 04:06:04 GMT) (full text, mbox, link).


Acknowledgement sent to Diane Trout <diane@ghic.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Team <team+python@tracker.debian.org>. (Mon, 30 Aug 2021 04:06:04 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 12:27:28 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.