summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-09-30 15:41:59 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-01 14:51:45 +0100
commit3115aa157de4df5a2e32bd54c8552d8b7a757925 (patch)
tree443590b721f25f2f6625d889a844eb9ad736d83d /meta
parentcf08db9f832687068909209ae36d1c01ef50bed5 (diff)
downloadpoky-3115aa157de4df5a2e32bd54c8552d8b7a757925.tar.gz
python3: Fix sysroot reproducibility
Fixes the reformatting of the sysconfigdata to be reproducible in the sysroot as well as in the package. During this a bug was uncovered in the way that the data was reformatted where it appears that python cannot parse a single line of code over 40000 characters. To work around this, pass a maximum with of "1" to pprint instead of sys.maxsize which will cause it to wrap as often as possible and should keep it reproducible. (From OE-Core rev: 2def2c145c303f27d93ba73876d4c6b214f18166) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/python/python3/reformat_sysconfig.py2
-rw-r--r--meta/recipes-devtools/python/python3_3.9.6.bb4
2 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/meta/recipes-devtools/python/python3/reformat_sysconfig.py
index c4164313e8..5e2b12879d 100644
--- a/meta/recipes-devtools/python/python3/reformat_sysconfig.py
+++ b/meta/recipes-devtools/python/python3/reformat_sysconfig.py
@@ -16,6 +16,6 @@ with open(sys.argv[1], 'r') as f:
16with open(sys.argv[1], 'w') as f: 16with open(sys.argv[1], 'w') as f:
17 for k in sorted(l.keys()): 17 for k in sorted(l.keys()):
18 f.write('%s = ' % k) 18 f.write('%s = ' % k)
19 pprint.pprint(l[k], stream=f, width=sys.maxsize) 19 pprint.pprint(l[k], stream=f, width=1)
20 f.write('\n') 20 f.write('\n')
21 21
diff --git a/meta/recipes-devtools/python/python3_3.9.6.bb b/meta/recipes-devtools/python/python3_3.9.6.bb
index f04bfc3053..aae7837180 100644
--- a/meta/recipes-devtools/python/python3_3.9.6.bb
+++ b/meta/recipes-devtools/python/python3_3.9.6.bb
@@ -161,6 +161,10 @@ do_install:append:class-native() {
161} 161}
162 162
163do_install:append() { 163do_install:append() {
164 for c in ${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do
165 python3 ${WORKDIR}/reformat_sysconfig.py $c
166 done
167
164 mkdir -p ${D}${libdir}/python-sysconfigdata 168 mkdir -p ${D}${libdir}/python-sysconfigdata
165 sysconfigfile=`find ${D} -name _sysconfig*.py` 169 sysconfigfile=`find ${D} -name _sysconfig*.py`
166 cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py 170 cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py