<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.gmailmsg
        {mso-style-name:gmail_msg;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>LLDB_DEFAULT_PYTHONHOME is an internal thing; I haven’t upstreamed it – for a while, it conflicted with Zach’s implementation, but I redid it, and everything is happy now. If you think it would be useful, I could upstream it. It’s fairly small, and plays nice with Zach’s Python stuff.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>The problem it solves is “where is my python?” on Windows. If you know you’ll be running on a system with the same python installation as the build system, then you don’t need it. Or if you can tell your users to install the same python you built with, in the same location, you’re OK. I can’t do that, so instead I ship python, and tell lldb where to find it at build time.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>We copy over the full site-packages directory that is created by the lldb build, and end up with this directory structure:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>bin/lldb.exe<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>bin/liblldb.dll<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>bin/python35.dll<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>lib/python35<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>lib/site-packages<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Qualcomm Innovation Center, Inc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Zachary Turner [mailto:zturner@google.com] <br><b>Sent:</b> Monday, November 28, 2016 12:17 PM<br><b>To:</b> Vadim Chugunov <vadimcn@gmail.com>; Hans Wennborg <hans@chromium.org><br><b>Cc:</b> Ted Woodward <ted.woodward@codeaurora.org>; Reid Kleckner <rnk@google.com>; LLDB <lldb-dev@lists.llvm.org><br><b>Subject:</b> Re: [lldb-dev] lldb-3.8.1 prebuilt binary for windows7<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>I overlooked that part of it, but yes that is another separate issue.  (BTW, _lldb.pyd is simply a symlink to liblldb.dll).  <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>In any case, yea I think the entire lib/site-packages folder needs to be included.<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Mon, Nov 28, 2016 at 10:15 AM Vadim Chugunov <<a href="mailto:vadimcn@gmail.com">vadimcn@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Please correct me if I'm wrong, but isn't the issue here that LLDB's Python support files don't get packaged into the Windows installer?   Does packaging them somehow depend on knowing what the Python installation path is?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Mon, Nov 28, 2016 at 10:09 AM, Hans Wennborg <span class=gmailmsg><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>The snapshots are built with the script in<br>utils/release/build_llvm_package.bat. It's currently passing<br>-DLLDB_RELOCATABLE_PYTHON=1 and  -DPYTHON_HOME=<path>.<br><br>I was planning on trying to build a new snapshot today and can add<br>-DLLDB_DEFAULT_PYTHON_HOME if you think that will help.<br><br>On Mon, Nov 28, 2016 at 9:51 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>> So it sounds like you're saying that in order for Python support to work as<br>> part of an LLDB shipped in the installer, we need to do set 3 variables at<br>> CMake time.<br>><br>> 1) -DLLDB_RELOCATABLE_PYTHON=TRUE<br>> 2) -DPYTHON_HOME = <path-to-python-3-5-on-build-machine><br>> 3) -DLLDB_DEFAULT_PYTHON_HOME=TRUE<br>><br>> Now because of #3, the lldb shipped in the installer will use the PYTHONHOME<br>> system environment variable to locate python, which must point to a valid<br>> Python 3.5 installation.  Is this correct?<br>><br>> On Mon, Nov 28, 2016 at 9:35 AM Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>><br>> wrote:<br>>><br>>> Windows has no concept of a default python installation, and I can’t be<br>>> sure what version of python my users have, if any, so I need to solve 2<br>>> problems:<br>>><br>>> 1)      Where is python when I’m building?<br>>><br>>> 2)      Where is python when I’m running?<br>>><br>>><br>>><br>>> To solve #1, I set LLDB_RELOCATABLE_PYTHON to TRUE, and PYTHON_HOME to my<br>>> python installation (on our buildbots, c:/python351).<br>>><br>>><br>>><br>>> #2 only needs to be solved if the machine you’re running on doesn’t have<br>>> the same python installation, in PYTHON_HOME above. To do that, I’ve added<br>>> code to set a cmake path LLDB_DEFAULT_PYTHONHOME, which I pass as a macro<br>>> down to InitializePythonHome in<br>>> source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp, and<br>>> call Py_SetPythonHome with it. My installations have the python dll and<br>>> python library directory. We put the library in <install>/lib/python35 and<br>>> the dll in <install>/bin.<br>>><br>>> --<br>>><br>>> Qualcomm Innovation Center, Inc.<br>>><br>>> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a<br>>> Linux Foundation Collaborative Project<br>>><br>>><br>>><br>>> From: Zachary Turner [mailto:<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>]<br>>> Sent: Wednesday, November 23, 2016 12:40 PM<br>>> To: Vadim Chugunov <<a href="mailto:vadimcn@gmail.com" target="_blank">vadimcn@gmail.com</a>><br>>> Cc: Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>>; Hans Wennborg <<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>>;<br>>> LLDB <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>>; Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>><br>>> Subject: Re: [lldb-dev] lldb-3.8.1 prebuilt binary for windows7<br>>><br>>><br>>><br>>> I believe the way to fix this is going to be building LLDB for the<br>>> installer with LLDB_RELOCATABLE_PYTHON=1 at CMake time<br>>><br>>><br>>><br>>> +Ted, since I believe he is one of the few people currently using this<br>>> flag.<br>>><br>>> On Wed, Nov 23, 2016 at 10:36 AM Vadim Chugunov <<a href="mailto:vadimcn@gmail.com" target="_blank">vadimcn@gmail.com</a>> wrote:<br>>><br>>> This is still broken in the October snapshot.   Do you know which script<br>>> is used to build the Windows installer?<br>>><br>>><br>>><br>>> On Tue, Oct 11, 2016 at 6:24 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>><br>>> wrote:<br>>><br>>> I think it is a problem with the way we built lldb.  I will look into what<br>>> additional steps we need to take when making the prebuilt binary so that it<br>>> works next time.<br>>><br>>><br>>><br>>> On Tue, Oct 11, 2016 at 6:20 PM Vadim Chugunov <<a href="mailto:vadimcn@gmail.com" target="_blank">vadimcn@gmail.com</a>> wrote:<br>>><br>>> Nope, that didn't help.<br>>><br>>><br>>><br>>> On Tue, Oct 11, 2016 at 5:16 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>><br>>> wrote:<br>>><br>>> I may know what this is.  Can you try setting PYTHONPATH though to point<br>>> to your Python 3.5 installation though and see if it fixes it?  (I don't<br>>> think it will, but let's try anyway)<br>>><br>>><br>>><br>>> On Tue, Oct 11, 2016 at 4:59 PM Vadim Chugunov <<a href="mailto:vadimcn@gmail.com" target="_blank">vadimcn@gmail.com</a>> wrote:<br>>><br>>> It outputs 'c:\Program Files (x86)\LLVM\lib\site-packages', however the<br>>> 'site-packages' directory does not exist.  Nor do I see '_lldb.pyd' anywhere<br>>> else.<br>>><br>>> 'script import lldb' also fails, of course.<br>>><br>>><br>>><br>>> On Tue, Oct 11, 2016 at 4:01 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>><br>>> wrote:<br>>><br>>> He said he did, so I don't know.  Vadim, can you elaborate?  When you run<br>>> `lldb -P` from the command line, what do you see?<br>>><br>>><br>>><br>>> On Tue, Oct 11, 2016 at 4:00 PM Reid Kleckner via lldb-dev<br>>> <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>>><br>>> I imagine that Hans doesn't have Python 3 installed on his system, so LLDB<br>>> didn't autoconfigure with Python support.<br>>><br>>><br>>><br>>> On Sun, Oct 9, 2016 at 1:07 PM, Vadim Chugunov via lldb-dev<br>>> <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>>><br>>> > Does the 4.0 binary not work for you? It is the first release that<br>>> > contains prebuilt lldb binary.<br>>><br>>><br>>><br>>> Looks like the Python API is not included though.   Do you know why it was<br>>> left out?<br>>><br>>><br>>><br>>><br>>> _______________________________________________<br>>> lldb-dev mailing list<br>>> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>>><br>>><br>>><br>>> _______________________________________________<br>>> lldb-dev mailing list<br>>> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>>><br>>><br>>><br>>><br>>><br>>><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></blockquote></div></div></div></body></html>