You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solution to issue cannot be found in the documentation.
I checked the documentation.
Issue
The builds of Python 3.10.15 and 3.11.10 (maybe others, I have not completed an exhaustive search) use FNV as the hash algorithm, which should not be used (as per PEP 456). This can be observed by running:
In particular this causes Numba to emit warnings that can then cause failures in some test suites (e.g. pytest runs):
UserWarning: FNV hashing is not implemented in Numba. See PEP 456 https://www.python.org/dev/peps/pep-0456/ for rationale over not using FNV. Numba will continue to work, but hashes for built in types will be computed using siphash24. This will permit e.g. dictionaries to continue to behave as expected, however anything relying on the value of the hash opposed to hash as a derived property is likely to not work as expected.
This happens because when cross compiling, HAVE_ALIGNED_REQUIRED is always defined as 1 in CPython's configure script:
if test "$cross_compiling" = yes; then :
ac_cv_aligned_required=yes
# ...
if test "$ac_cv_aligned_required" = yes ; then
$as_echo "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h
fi
then in pyhash.h the default hash algorithm becomes FNV:
I think this can be worked around by supplying --with-hash-algorithm=siphash24 to the configure script when cross-compiling. I'm trying this out locally, and will provide more information (or a PR) once I make more progress.
When cross-compiling, the hash function is forced to be FNV because the
configure script defines `HAVE_ALIGNED_REQUIRED` which is then used by
pyhash.h to change the default to FNV (see conda-forge#718)
This commit fixes the issue by specifying siphash24 to the configure
script when cross-compiling.
When cross-compiling, the hash function is forced to be FNV because the
configure script defines `HAVE_ALIGNED_REQUIRED` which is then used by
pyhash.h to change the default to FNV (see conda-forge#718)
This commit fixes the issue by specifying siphash24 to the configure
script when cross-compiling.
Solution to issue cannot be found in the documentation.
Issue
The builds of Python 3.10.15 and 3.11.10 (maybe others, I have not completed an exhaustive search) use FNV as the hash algorithm, which should not be used (as per PEP 456). This can be observed by running:
whereas it should be e.g.:
In particular this causes Numba to emit warnings that can then cause failures in some test suites (e.g. pytest runs):
This happens because when cross compiling,
HAVE_ALIGNED_REQUIRED
is always defined as1
in CPython'sconfigure
script:https://github.com/python/cpython/blob/0c5fc27217525c4e40b4064e6979f467540c2fc8/configure#L10444-L10445
then in
pyhash.h
the default hash algorithm becomes FNV:https://github.com/python/cpython/blob/0c5fc27217525c4e40b4064e6979f467540c2fc8/Include/pyhash.h#L132-L138
I think this can be worked around by supplying
--with-hash-algorithm=siphash24
to theconfigure
script when cross-compiling. I'm trying this out locally, and will provide more information (or a PR) once I make more progress.cc @bdice
Installed packages
Environment info
The text was updated successfully, but these errors were encountered: