[Lldb-commits] [PATCH] D14896: Local path implementation of swig-bot.py

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 20 16:48:58 PST 2015


zturner created this revision.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.

    This version supports local generation only.  It's intentionally
    stupid, and does not support any kind of dependency checking.
    If you run the script, it's going to call SWIG.  Period.  While this is
    a slow process, we are going to combine the use of the swig bot
    with checked in static bindings, meaning that it won't be terribly
    important to only regenerate the bindings when the input files
    have actually changed.  I'm open to the possibility of adding
    dep checking, but I want to make sure there's a clear use case
    for it first.

    A side benefit of this is that the implementation is drastically
    simpler.

    Since depending on how you call the script, swig can be run on
    either the client or the server, it means both the client and server
    need to be able to reuse the code that physically exec's swig.  This
    logic is therefore contained in the file `local.py`, which is used by
    by both `client.py` and (later) `server.py`.

    This is all experimental at the moment, but it duplicates a lot
    of the logic currently found in prepare_bindings.py.  There was
    not a good way to reuse some of the logic without invasive changes
    on that script, and since this script is still experimental, it
    makes sense to just copy them over, and if / when this becomes
    more mature, we can get rid of the other ones.

    One thing that differs fundamentally from previous implementations
    is that there is no need for a custom `_python.py` version of the script.
    AFAICT you can generate multiple languages with a single swig invocation
    so there is no reason to invoke swig multiple times, which is what the old
    system would do.  So this new method just contains logic to build up a
    single command line which can generate everything at once.

    The modify step is not included here, because again the idea here is that
    this will be run on a remote server.  So you will eventually do the modify
    locally after receiving the result from the server.

http://reviews.llvm.org/D14896

Files:
  scripts/swig_bot.py
  scripts/swig_bot_lib/__init__.py
  scripts/swig_bot_lib/client.py
  scripts/swig_bot_lib/local.py
  scripts/swig_bot_lib/server.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14896.40849.patch
Type: text/x-patch
Size: 5956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151121/e3cefcd6/attachment-0001.bin>


More information about the lldb-commits mailing list