This is an archive of the discontinued LLVM Phabricator instance.

[dexter] Require python >= 3.6
ClosedPublic

Authored by djtodoro on Apr 22 2020, 3:02 AM.

Details

Summary

I see the doc says we need python >= 3.6. Running it with an older version, I get verbose output from python interpreter, so I think that should simple be handled.

For example:

python2 dexter.py list-debuggers
You need python 3.6 or later to run DExTer

Diff Detail

Event Timeline

djtodoro created this revision.Apr 22 2020, 3:02 AM
djtodoro updated this revision to Diff 259222.Apr 22 2020, 3:13 AM

-using the same indentation

Orlando accepted this revision.Apr 22 2020, 3:27 AM

LGTM pending no other comments, thanks for the patch!

debuginfo-tests/dexter/dexter.py
14

Could use sys.exit(ReturnCode._ERROR) here for consistency.

This revision is now accepted and ready to land.Apr 22 2020, 3:27 AM
djtodoro marked an inline comment as done.Apr 22 2020, 3:56 AM

@Orlando Thanks!

debuginfo-tests/dexter/dexter.py
14

I can add a comment here. If we import something from dex.* that will cause calling of some __init__ constructors where the newer python syntax was used, so we would end up with the interpreter failing again.

djtodoro updated this revision to Diff 259227.Apr 22 2020, 3:56 AM

-adding a comment

jmorse accepted this revision.Apr 22 2020, 4:28 AM

LGTM, and thanks for the patch; ideally a similar test would also go into debuginfo-tests/CMakeLists.txt to avoid people adding debuginfo-tests to their configuration with a version of python that will definitely fail.

LGTM, and thanks for the patch; ideally a similar test would also go into debuginfo-tests/CMakeLists.txt to avoid people adding debuginfo-tests to their configuration with a version of python that will definitely fail.

Oh, yes, that is good idea. We should do that.

Out of this topic, have you thought about adding a (CMAKE) build target for the dexter, so we have it with in the final $build/bin? Something similar we did for llvm-locstatsutil (written in python as well).

Orlando added inline comments.Apr 22 2020, 4:56 AM
debuginfo-tests/dexter/dexter.py
14

Makes sense, SGTM.

TWeaver accepted this revision.Apr 22 2020, 5:31 AM

thanks for this, LGTM.

@jmorse I believe there's already a test in the cmake/config that checks the python version when generating the build.

if you don't provide a -DPYTHON_EXECUTABLE options on the cmake command line that points at a version 3.6 or higher, the build gen fails.

TWeaver added a comment.EditedApr 22 2020, 5:51 AM

in ./debuginfo-tests/CMakeLists.txt we have the following on line 27:

if (NOT DEFINED PYTHON_EXECUTABLE)
  message(FATAL_ERROR "Cannot run debuginfo-tests without python")
elseif(PYTHON_VERSION_MAJOR LESS 3)
  message(FATAL_ERROR "Cannot run debuginfo-tests without python 3")

Perhaps we should add a minor check too.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2020, 3:13 AM