As Thomas mentioned PYTHONHASHSEED is sufficient to solve non-determinism
by the hashing. In my experience this hashing, along with datetimes (e.g.
in the bytecode) are typically the only causes of non-determinism in Python
packages.

Someone from I think Debian did mention [1] that they cannot always set
PYTHONHASHSEED and so in certain cases they apply patches to fix
non-determinism. This is what they might be after in the case of
`reportlab` but you best ask them.

I'm not yet sure what to think of that patching approach. E.g., if one
couldn't set PYTHONHASHSEED when building the bytecode in the interpreter
itself, then one would have to convert all sets to lists with potential
negative performance effects.

On Mon, Mar 20, 2017 at 12:35 PM, Thomas Kluyver <tho...@kluyver.me.uk>
wrote:

> On Mon, Mar 20, 2017, at 09:00 AM, Robin Becker wrote:
> > Obviously if I have the ability to embed  repr(some_object)
> > into the document output then it will vary (unless the underlying python
> > is reproducible). I'm not sure if debian runs the whole reportlab test
> > suite, but it makes sense to get this kind of variablity out.
>
> AIUI, it's fine to have the *ability* to produce non-deterministic
> output, and it doesn't matter if your tests do that. The aim of
> reproducible builds is to be able to go from the same source code to an
> identical binary package. Documents generated by running the tests are
> presumably not included in binary packages, so it doesn't matter if they
> change.
>
> >  I believe there was some way to modify the hashing introduced when the
> dos dictionary attacks were an issue.
>
> The PYTHONHASHSEED environment variable:
> https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED
>
> If you have non-determinism introduced by Python hashing, setting a
> constant value of PYTHONHASHSEED should be an easy way to work around
> it.
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG@python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to