diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 8dd55a5c6a611fe7921d6186a97c40798e97dfee..e921186003eb236a46b4a588acd33d8cc57a7289 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -799,11 +799,13 @@ def main(): )"; PythonScript lol(script2); - + // OHOS_LOCAL begin + // Adapt to Python3.11.4 EXPECT_THAT_EXPECTED(lol(), llvm::Failed(testing::Property( &PythonException::ReadBacktrace, - testing::ContainsRegex("unprintable MyError")))); + testing::ContainsRegex("exception str\\(\\) failed")))); + // OHOS_LOCAL end } TEST_F(PythonDataObjectsTest, TestRun) { diff --git a/llvm-build/build.py b/llvm-build/build.py index 34895415f6e5cb618e819285442a8b136d33c84a..50e1d69c4904d02df5f625a816c69ae57669f0d4 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -92,9 +92,9 @@ class BuildConfig(): self.OPENHOS_SFX = '-linux-ohos' self.LITEOS_SFX = '-liteos-ohos' - self.LLDB_PY_VERSION = '3.10' + self.LLDB_PY_VERSION = '3.11' self.LLDB_PYTHON = 'python3' - self.LLDB_PY_DETAILED_VERSION = self.LLDB_PY_VERSION + '.2' + self.LLDB_PY_DETAILED_VERSION = self.LLDB_PY_VERSION + '.4' self.CLANG_VERSION = prebuilts_clang_version self.MINGW_TRIPLE = 'x86_64-windows-gnu' self.build_libs_with_hb = self.build_libs_flags == 'OH' or self.build_libs_flags == 'BOTH' @@ -618,8 +618,6 @@ class BuildUtils(object): def get_python_dir(self): platform_path = self.platform_prefix() - if (self.host_is_darwin()): - platform_path = "darwin-x86" python_dir = os.path.join(self.buildtools_path, self.build_config.LLDB_PYTHON, platform_path, self.build_config.LLDB_PY_DETAILED_VERSION) return python_dir @@ -2598,7 +2596,8 @@ class LlvmPackage(BuildUtils): # Redefining necessary bin files for Windows. windows_forbidden_list_bin_files = ['clang-%s%s' % (vers_major, ext), 'scan-build%s' % ext, 'scan-view%s' % ext] - windows_additional_bin_files = ['liblldb%s' % shlib_ext, 'libpython3.10%s' % shlib_ext, 'libclang%s' % shlib_ext] + windows_additional_bin_files = ['liblldb%s' % shlib_ext, 'libpython%s%s' % (self.build_config.LLDB_PY_VERSION, shlib_ext), + 'libclang%s' % shlib_ext] if self.build_config.build_libxml2: windows_additional_bin_files += ['libxml2%s' % shlib_ext] diff --git a/llvm-build/python_builder.py b/llvm-build/python_builder.py index 1663b59168753e7aedeff266b9e073f77d427566..f0a42cd8606fd7699f8fe7760bf3ecf2ff1c6a16 100755 --- a/llvm-build/python_builder.py +++ b/llvm-build/python_builder.py @@ -26,11 +26,14 @@ class PythonBuilder: self.repo_root = Path(build_config.REPOROOT_DIR).resolve() self._out_dir = Path(build_config.OUT_PATH).resolve() self._clang_toolchain_dir = self._out_dir / 'llvm-install' + self._lldb_py_version = build_config.LLDB_PY_VERSION self._version = build_config.LLDB_PY_DETAILED_VERSION version_parts = self._version.split('.') self._major_version = version_parts[0] + '.' + version_parts[1] self._source_dir = self.repo_root / 'third_party' / 'python' self._patch_dir = self._source_dir / 'patches' + self._prebuilts_path = os.path.join(self.repo_root, 'prebuilts', 'python3', 'linux-x86', self._version) + self._prebuilts_python_path = os.path.join(self._prebuilts_path, 'bin', 'python%s' % self._lldb_py_version) self._install_dir = "" self._clean_patches() @@ -179,7 +182,7 @@ class MinGWPythonBuilder(PythonBuilder): super().__init__(build_config) self.target_platform = "x86_64-w64-mingw32" - self.patches = ["cpython_mingw_v3.10.2.patch"] + self.patches = [ f'cpython_mingw_v{self._version}.patch' ] self._mingw_install_dir = self._out_dir / 'mingw' / build_config.MINGW_TRIPLE self._build_dir = self._out_dir / 'python-windows-build' @@ -226,6 +229,7 @@ class MinGWPythonBuilder(PythonBuilder): f'--prefix={self._install_dir}', f'--build={build_platform}', f'--host={self.target_platform}', + f'--with-build-python={self._prebuilts_python_path}', '--enable-shared', '--without-ensurepip', '--enable-loadable-sqlite-extensions', @@ -302,6 +306,7 @@ class OHOSPythonBuilder(PythonBuilder): f'--prefix={self._install_dir}', f'--build={build_platform}', f'--host={self.target_platform}', + f'--with-build-python={self._prebuilts_python_path}', '--enable-shared', '--without-ensurepip', '--enable-loadable-sqlite-extensions',