diff mbox series

python3-numpy: remove obsolete reproducible workaround

Message ID 20231002110405.3695525-1-ross.burton@arm.com
State Accepted, archived
Commit 5c287a896fa9f5cd05b6a2411528fdc8fb2579d6
Headers show
Series python3-numpy: remove obsolete reproducible workaround | expand

Commit Message

Ross Burton Oct. 2, 2023, 11:04 a.m. UTC
From: Ross Burton <ross.burton@arm.com>

We currently delete some pycache files because frozenset wasn't able to
be reproducible, but this has been fixed in Python 3.11:

https://github.com/python/cpython/commit/33d95c6facdfda3c8c0feffa7a99184e4abc2f63

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-devtools/python/python3-numpy_1.26.0.bb | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Richard Purdie Oct. 2, 2023, 12:30 p.m. UTC | #1
On Mon, 2023-10-02 at 12:04 +0100, Ross Burton wrote:
> From: Ross Burton <ross.burton@arm.com>
> 
> We currently delete some pycache files because frozenset wasn't able to
> be reproducible, but this has been fixed in Python 3.11:
> 
> https://github.com/python/cpython/commit/33d95c6facdfda3c8c0feffa7a99184e4abc2f63
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/recipes-devtools/python/python3-numpy_1.26.0.bb | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
> index 4e1e34e8df3..3ae40a33fb4 100644
> --- a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
> +++ b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
> @@ -30,15 +30,6 @@ do_compile:prepend() {
>      export NPY_DISABLE_SVML=1
>  }
>  
> -# Unfortunately the following pyc files are non-deterministc due to 'frozenset'
> -# being written without strict ordering, even with PYTHONHASHSEED = 0
> -# Upstream is discussing ways to solve the issue properly, until then let's
> -# just not install the problematic files.
> -# More info: http://benno.id.au/blog/2013/01/15/python-determinism
> -do_install:append() {
> -	rm ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/typing/tests/data/pass/__pycache__/literal.cpython*
> -}
> -
>  FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a"
>  

Are you 100% sure we use python3-native to build the pyc files? I ask
as I can't face chasing yet another reproducibility bug down!

Cheers,

Richard
Ross Burton Oct. 2, 2023, 1:51 p.m. UTC | #2
On 2 Oct 2023, at 13:30, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> 
> On Mon, 2023-10-02 at 12:04 +0100, Ross Burton wrote:
>> From: Ross Burton <ross.burton@arm.com>
>> 
>> We currently delete some pycache files because frozenset wasn't able to
>> be reproducible, but this has been fixed in Python 3.11:
>> 
>> https://github.com/python/cpython/commit/33d95c6facdfda3c8c0feffa7a99184e4abc2f63
>> 
>> Signed-off-by: Ross Burton <ross.burton@arm.com>
>> ---
>> meta/recipes-devtools/python/python3-numpy_1.26.0.bb | 9 ---------
>> 1 file changed, 9 deletions(-)
>> 
>> diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
>> index 4e1e34e8df3..3ae40a33fb4 100644
>> --- a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
>> +++ b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
>> @@ -30,15 +30,6 @@ do_compile:prepend() {
>>     export NPY_DISABLE_SVML=1
>> }
>> 
>> -# Unfortunately the following pyc files are non-deterministc due to 'frozenset'
>> -# being written without strict ordering, even with PYTHONHASHSEED = 0
>> -# Upstream is discussing ways to solve the issue properly, until then let's
>> -# just not install the problematic files.
>> -# More info: http://benno.id.au/blog/2013/01/15/python-determinism
>> -do_install:append() {
>> - rm ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/typing/tests/data/pass/__pycache__/literal.cpython*
>> -}
>> -
>> FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a"
>> 
> 
> Are you 100% sure we use python3-native to build the pyc files? I ask
> as I can't face chasing yet another reproducibility bug down!

For numpy, I’d hope so, but we can leave this for now :)

Ross
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
index 4e1e34e8df3..3ae40a33fb4 100644
--- a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
+++ b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb
@@ -30,15 +30,6 @@  do_compile:prepend() {
     export NPY_DISABLE_SVML=1
 }
 
-# Unfortunately the following pyc files are non-deterministc due to 'frozenset'
-# being written without strict ordering, even with PYTHONHASHSEED = 0
-# Upstream is discussing ways to solve the issue properly, until then let's
-# just not install the problematic files.
-# More info: http://benno.id.au/blog/2013/01/15/python-determinism
-do_install:append() {
-	rm ${D}${PYTHON_SITEPACKAGES_DIR}/numpy/typing/tests/data/pass/__pycache__/literal.cpython*
-}
-
 FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a"
 
 # install what is needed for numpy.test()