diff options
author | Ross Burton <ross.burton@intel.com> | 2018-01-26 10:44:35 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-29 08:49:50 +0000 |
commit | a889ece9247e5237b800e0750b02603ba8f5e001 (patch) | |
tree | abd37a05cdaf12579362ccddb9044cbeced8c38c /meta/recipes-devtools/python/python3_3.5.3.bb | |
parent | 0db712bd244c5eb94e1ff43eb06c0d84848799d2 (diff) | |
download | poky-a889ece9247e5237b800e0750b02603ba8f5e001.tar.gz |
python: fix parse dependencies
Adding a file-checksums flag for the manifest to do_split_packages doesn't
achieve anything as do_split_packages isn't a task. Changing this to tha task
do_package shows that the path is wrong, but we also know that as the manifest
is in SRC_URI any changes to it would result in a rebuild anyway, so this line
can be deleted.
However there is a problem of the recipe not being reparsed when it needs to be,
if the JSON has changed. The main bitbake process can hash the recipe and use
stale data from the cache as it hasn't considered the manifest file changing. This
results in non-determinism warnings when the worker parses the recipe again and
comes to a different hash (as the manifest has changed, so the packaging
changed).
Solve this by calling bb.parse.mark_dependency() to declare the dependency on
the manifest.
(From OE-Core rev: a321b28c8dafc9775f465ce7c0f6bcbe8ccc2945)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3_3.5.3.bb')
-rw-r--r-- | meta/recipes-devtools/python/python3_3.5.3.bb | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/meta/recipes-devtools/python/python3_3.5.3.bb b/meta/recipes-devtools/python/python3_3.5.3.bb index 970ba63445..3ae0db2b8b 100644 --- a/meta/recipes-devtools/python/python3_3.5.3.bb +++ b/meta/recipes-devtools/python/python3_3.5.3.bb | |||
@@ -228,21 +228,22 @@ FILES_${PN}-man = "${datadir}/man" | |||
228 | BBCLASSEXTEND = "nativesdk" | 228 | BBCLASSEXTEND = "nativesdk" |
229 | 229 | ||
230 | RPROVIDES_${PN} += "${PN}-modules" | 230 | RPROVIDES_${PN} += "${PN}-modules" |
231 | 231 | ||
232 | # We want bytecode precompiled .py files (.pyc's) by default | 232 | # We want bytecode precompiled .py files (.pyc's) by default |
233 | # but the user may set it on their own conf | 233 | # but the user may set it on their own conf |
234 | |||
235 | INCLUDE_PYCS ?= "1" | 234 | INCLUDE_PYCS ?= "1" |
236 | 235 | ||
237 | python(){ | 236 | python(){ |
237 | import json | ||
238 | 238 | ||
239 | pythondir = d.getVar('THISDIR',True) | 239 | filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json') |
240 | # This python changes the datastore based on the contents of a file, so mark | ||
241 | # that dependency. | ||
242 | bb.parse.mark_dependency(d, filename) | ||
240 | 243 | ||
241 | # Read JSON manifest | 244 | with open(filename) as manifest_file: |
242 | import json | ||
243 | with open(pythondir+'/python3/python3-manifest.json') as manifest_file: | ||
244 | python_manifest=json.load(manifest_file) | 245 | python_manifest=json.load(manifest_file) |
245 | 246 | ||
246 | include_pycs = d.getVar('INCLUDE_PYCS') | 247 | include_pycs = d.getVar('INCLUDE_PYCS') |
247 | 248 | ||
248 | packages = d.getVar('PACKAGES').split() | 249 | packages = d.getVar('PACKAGES').split() |
@@ -282,28 +283,24 @@ python(){ | |||
282 | d.setVar('PACKAGES', ' '.join(packages)) | 283 | d.setVar('PACKAGES', ' '.join(packages)) |
283 | d.setVar('ALLOW_EMPTY_${PN}-modules', '1') | 284 | d.setVar('ALLOW_EMPTY_${PN}-modules', '1') |
284 | } | 285 | } |
285 | do_split_packages[file-checksums] += "${THISDIR}/python/python3-manifest.json:True" | ||
286 | |||
287 | |||
288 | 286 | ||
289 | # Files needed to create a new manifest | 287 | # Files needed to create a new manifest |
290 | SRC_URI += "file://create_manifest3.py file://get_module_deps3.py file://python3-manifest.json" | 288 | SRC_URI += "file://create_manifest3.py file://get_module_deps3.py file://python3-manifest.json" |
291 | 289 | ||
292 | do_create_manifest() { | 290 | do_create_manifest() { |
293 | 291 | # This task should be run with every new release of Python. | |
294 | # This task should be run with every new release of Python. | 292 | # We must ensure that PACKAGECONFIG enables everything when creating |
295 | # We must ensure that PACKAGECONFIG enables everything when creating | 293 | # a new manifest, this is to base our new manifest on a complete |
296 | # a new manifest, this is to base our new manifest on a complete | 294 | # native python build, containing all dependencies, otherwise the task |
297 | # native python build, containing all dependencies, otherwise the task | 295 | # wont be able to find the required files. |
298 | # wont be able to find the required files. | 296 | # e.g. BerkeleyDB is an optional build dependency so it may or may not |
299 | # e.g. BerkeleyDB is an optional build dependency so it may or may not | 297 | # be present, we must ensure it is. |
300 | # be present, we must ensure it is. | 298 | |
301 | 299 | cd ${WORKDIR} | |
302 | cd ${WORKDIR} | 300 | # This needs to be executed by python-native and NOT by HOST's python |
303 | # This needs to be executed by python-native and NOT by HOST's python | 301 | nativepython3 create_manifest3.py |
304 | nativepython3 create_manifest3.py | 302 | cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json |
305 | cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json | 303 | } |
306 | } | ||
307 | 304 | ||
308 | # bitbake python -c create_manifest | 305 | # bitbake python -c create_manifest |
309 | addtask do_create_manifest | 306 | addtask do_create_manifest |