[lldb-dev] test suite issue with Python2.7/3.5

Joseph Tremoulet via lldb-dev lldb-dev at lists.llvm.org
Fri Aug 16 07:44:50 PDT 2019


> The 7.0 branch is not compatible with Python 3 .. The first release that is, would be 9.0

Should some/all of the recent Python/CMake changes be ported to the 9.0 release branch?  ‘git log --grep ython’ turns up r367956, r367153, r367127, r367125, r367115, r366447, and r366383, all of which happened after the fork, I’m wondering if any of them (or others) are important as part of supporting Python 3.

I’ll paste the commit messages below for convenience.

Thanks,
-Joseph


Author: Jonas Devlieghere <jonas at devlieghere.com>
Date:   Mon Aug 5 23:54:13 2019 +0000

    [CMake] Remove check for the readline target.

    This was introduced when we were building a custom readline Python
    module on Linux [1]. Now that the readline  target doesn't exist
    anymore, it's safe to remove this dependency.

    This fixes https://llvm.org/PR25136

    [1] https://reviews.llvm.org/D13268

    llvm-svn: 367956

Author: Jonas Devlieghere <jonas at devlieghere.com>
Date:   Fri Jul 26 20:58:10 2019 +0000

    [CMake] Print the correct variables

    This didn't get updated after we decided to set PYTHON_MAJOR_VERSION and
    PYTHON_MINOR_VERSION in find_python_libs_windows, instead of parsing the
    variables ourselves.

    llvm-svn: 367153

Author: Jonas Devlieghere <jonas at devlieghere.com>
Date:   Fri Jul 26 16:32:49 2019 +0000

    [CMake] Fix find_python_libs_windows

    Exporting PYTHON_INCLUDE_DIR to the Python scope somehow got lost in my
    last change. Add it back again. This should fix the Windows bot!

    llvm-svn: 367127

Author: Jonas Devlieghere <jonas at devlieghere.com>
Date:   Fri Jul 26 16:15:19 2019 +0000

    [CMake] Print Python version on Windows

    Trying to figure out what's causing the Windows bot to fail.

    llvm-svn: 367125

Author: Jonas Devlieghere <jonas at devlieghere.com>
Date:   Fri Jul 26 14:26:33 2019 +0000

    [CMake] Loosen Python version check and ignore patch version

    Some versions of macOS report a different patch version for the system
    provided interpreter and libraries.

    Differential revision: https://reviews.llvm.org/D65230

    llvm-svn: 367115

Author: Jonas Devlieghere <jonas at devlieghere.com>
Date:   Thu Jul 18 15:17:42 2019 +0000

    [CMake] Don't set Python_ADDITIONAL_VERSIONS

    Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's
    Python support to 2.7. Now that both LLVM and LLDB both support Python
    3, there's no longer a need to put an arbitrary limit on this.

    However, instead of removing the variable, r365692 expanded the list,
    which has the (presumably unintentional) side-effect of expression
    preference for Python 3.

    Instead, as Michal proposed in the original code review, we should just
    not set the list at all, and let CMake pick whatever Python interpreter
    you have in your path.

    This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm,
    clang and lld. I've also updated the docs with the default behavior and
    how to force a different Python version to be used.

    Differential revision: https://reviews.llvm.org/D64894

    llvm-svn: 366447

Author: Adrian McCarthy <amccarth at google.com>
Date:   Wed Jul 17 22:36:26 2019 +0000

    [NFC] Clarify a Cmake status message regarding Python on LLDBConfig

    llvm-svn: 366383


From: lldb-dev <lldb-dev-bounces at lists.llvm.org> On Behalf Of Jonas Devlieghere via lldb-dev
Sent: Tuesday, July 23, 2019 10:52 AM
To: Romaric Jodin <rjodin at upmem.com>
Cc: LLDB <lldb-dev at lists.llvm.org>
Subject: Re: [lldb-dev] test suite issue with Python2.7/3.5

The 7.0 branch is not compatible with Python 3, at least not if you're not on Windows. The first release that is, would be 9.0, which is currently being qualified. This includes a bunch of compatibility fixes, and a newer version of the vendored pexpect (4.6). As you've noticed, using different versions of Python will not work either.

Your only option is to use Python 2.7, both for building LLDB and for running the test suite. Making sure the 2.7 interpreter is first in your PATH should be sufficient. Alternatively, you can explicitly pass -DPYTHON_EXECUTABLE=/path/to/python27.

Cheers,
Jonas

On Tue, Jul 23, 2019 at 7:38 AM Romaric Jodin via lldb-dev <lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>> wrote:
Hi everyone,

I'm trying to run the test suite on lldb and I'm having some issues with Python. I'm on branch 7.0.

When I build lldb, I've got a folder "python3.5/site-packages" generated. So I believe that the build system found python3 in my environment.
But when I run the testsuite (using "ninja check-lldb"), I've got this issue:

Traceback (most recent call last):
  File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/decorators.py", line 113, in wrapper
    func(*args, **kwargs)
  File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/decorators.py", line 341, in wrapper
    return func(self, *args, **kwargs)
  File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py", line 39, in test_command_regex
    child.expect_exact(prompt)
  File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1386, in expect_exact
    if type(pattern_list) in types.StringTypes or pattern_list in (
AttributeError: module 'types' has no attribute 'StringTypes'

It seems that it's because the code in "pexpect.py" is not compatible with python3.5.
If I force the system to use python2.7, I've got another issue because of the way "_lldb.so" is built (with python3.5):

Traceback (most recent call last):
  File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/test/dotest.py", line 7, in <module>
    lldbsuite.test.run_suite()
  File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/dotest.py", line 1180, in run_suite
    import lldb
  File "/home/rjodin/package-sdk-2019.3.0/upmem-internal/usr/share/upmem/lib/python3.5/site-packages/lldb/__init__.py", line 39, in <module>
    import _lldb
ImportError: dynamic module does not define init function (init_lldb)

What do I do wrong?
Thanks,
--
Romaric JODIN
UPMEM
Software Engineer

[Logo-original-source]
_______________________________________________
lldb-dev mailing list
lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flldb-dev&data=02%7C01%7Cjotrem%40microsoft.com%7C185e4cab94d444c53b3508d70f7d610d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636994903482780787&sdata=gTsUfgqvEz7Y38k04LzLD5bcjtfFvzvh34fobmOArYA%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20190816/9834a620/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1939 bytes
Desc: image001.png
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20190816/9834a620/attachment-0001.png>


More information about the lldb-dev mailing list