Modify path for python clang support package

Due to commit 594844244237091347b62e8fbbc8a2851258db50 (update
stable to r468909b) the path for python3-clang support was moved from
   prebuilts/clang/host/linux-x86/clang-stable/lib64/python3/site-packages
to:
   prebuilts/clang/host/linux-x86/clang-stable/lib/python3/site-packages

Change the imports to point to the correct place.

Without the change:
  Traceback (most recent call last):
    File "bionic/libc/kernel/tools/./clean_header.py", line 72, in <module>
      import sys, cpp, kernel, glob, os, re, getopt
    File "bionic/libc/kernel/tools/cpp.py", line 19, in <module>
      import clang.cindex
  ModuleNotFoundError: No module named 'clang'

Bug: 254401594
Test: execute clean_headers.py
Signed-off-by: Pat Tjin <pattjin@google.com>
Change-Id: Ibf1423fbe78ee009366e26905c4a09e68ac8ff9b
This commit is contained in:
Pat Tjin 2022-10-21 11:17:22 -07:00
parent 0f917240bd
commit 00fde2aff6

View file

@ -14,7 +14,7 @@ if top is None:
utils.panic('ANDROID_BUILD_TOP not set.\n')
# Set up the env vars for libclang.
site.addsitedir(os.path.join(top, 'prebuilts/clang/host/linux-x86/clang-stable/lib64/python3/site-packages/'))
site.addsitedir(os.path.join(top, 'prebuilts/clang/host/linux-x86/clang-stable/lib/python3/site-packages/'))
import clang.cindex
from clang.cindex import conf
@ -28,7 +28,7 @@ from clang.cindex import TranslationUnit
# Set up LD_LIBRARY_PATH to include libclang.so, libLLVM.so, and etc.
# Note that setting LD_LIBRARY_PATH with os.putenv() sometimes doesn't help.
clang.cindex.Config.set_library_file(os.path.join(top, 'prebuilts/clang/host/linux-x86/clang-stable/lib64/libclang.so'))
clang.cindex.Config.set_library_file(os.path.join(top, 'prebuilts/clang/host/linux-x86/clang-stable/lib/libclang.so'))
from defaults import *