Minimum required swig version?

http://lldb.llvm.org/resources/build.html Says we need swig 2 or later:

If you want to run the test suite, you’ll need to build LLDB with Python scripting support.

· Python

· SWIG 2 or later.

I don’t think this is correct anymore.

test/API/python_api/sbenvironment/TestSBEnvironment.py has this line:

env.Set(“FOO”, “bar”, overwrite=True)

lldb built with swig 2.0.11 fails this test with the error:

env.Set(“FOO”, “bar”, overwrite=True)

TypeError: Set() got an unexpected keyword argument ‘overwrite’

It works when lldb is built with swig 3.0.8.

inspect.getsource(lldb.SBEnvironment) gives the following:

swig 2.0.11:

“”“Set(SBEnvironment self, char const * name, char const * value, bool overwrite) → bool”""\n return _lldb.SBEnvironment_Set(self, *args)\n\n

swig 3.0.8:

“”“Set(SBEnvironment self, char const * name, char const * value, bool overwrite) → bool”""\n return _lldb.SBEnvironment_Set(self, name, value, overwrite)\n\n\n

Is swig 3 required? Do we need to update the build page?

Yes, we bumped the swig requirements.
Swig-2, among others, don’t support python 3 correctly.

Feel free to submit a patch.

http://lldb.llvm.org/resources/build.html Says we need swig 2 or later:

If you want to run the test suite, you’ll need to build LLDB with Python scripting support.

· Python
· SWIG 2 or later.

I don’t think this is correct anymore.

test/API/python_api/sbenvironment/TestSBEnvironment.py has this line:
env.Set(“FOO”, “bar”, overwrite=True)

lldb built with swig 2.0.11 fails this test with the error:
env.Set(“FOO”, “bar”, overwrite=True)
TypeError: Set() got an unexpected keyword argument ‘overwrite’

It works when lldb is built with swig 3.0.8.

Yes, we bumped the swig requirements.
Swig-2, among others, don’t support python 3 correctly.

I think you’re confusing SWIG 1.x and SWIG 2.x. We bumped the requirements to 2, because that’s the first version that correctly supported Python 3. Personally I don’t mind bumping the version again, but this seems more like a bug that we should be able to fix with SWIG 2.

While swig 2 has support for python 3, it doesn’t work in all cases (there are bugs). Hence the choice of the word “correctly”, rather than “at all”.
If you go past this, you’ll probably find other problems, as I did when I originally made the transition. Some of them are trivial, some of them cause the python code generate to be incorrect and tests to fail.
If you want to fix them, be my guest. But realistically everybody I’ve seen builds using swig-3 [or swig-4]. Pick your poison.