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
When soong packages python files into a zip file, it
will take their path relative to the Android.bp file
and preserve that relative path in the zip file. Then
the root directory of the zip file is added to the
PYTHONPATH. Currently, all subdirectories of the top
level zip directory are also added to the PYTHONPATH,
but we want to remove this. Since simpleperf_report_lib was
being added to the zip file under scripts/simpleperf_report_lib,
"import simpleperf_report_lib" works currectly, but won't
work after the PYTHONPATH changes (you'd have to say
"import scripts.simpleperf_report_lib").
To fix this, move the Android.bp file for simpleperf_report_lib
into the scripts folder, so the relative paths don't contain
scripts/. Soong python modules do have a pkg_path attribute,
which essentially adds more folders to the relative path,
but we would need an attribute that removes them, which
doesn't exist. This could also be done with a filegroup
with the "path" attribute, but bp2build doesn't support
that, so I opted to go with this option instead.
Bug: 245583294
Test: Presubmits
Change-Id: Icd13fecc249033cdf1a12c97c7e4bd7db207191f
0 commit comments