<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I pushed an attempted fix in r286254.<div class=""><br class=""></div><div class="">I wonder if this is a difference between python 2.7 and 3. The comprehension should capture everything, as should the eval call. I wonder if one of those captures less in python 3 compared to python 2.7.</div><div class=""><br class=""></div><div class="">Hopefully my patch will resolve the issue for you.</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 8, 2016, at 7:37 AM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Oct 30, 2016 at 9:57 PM Chris Bieneman via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=285542&r1=285541&r2=285542&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=285542&r1=285541&r2=285542&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)<br class="gmail_msg">
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Sun Oct 30 23:48:19 2016<br class="gmail_msg">
@@ -1848,6 +1848,33 @@ class TestBase(Base):<br class="gmail_msg">
folder = os.path.dirname(folder)<br class="gmail_msg">
continue<br class="gmail_msg">
<br class="gmail_msg">
+ def generateSource(self, source):<br class="gmail_msg">
+ template = source + '.template'<br class="gmail_msg">
+ temp = os.path.join(os.getcwd(), template)<br class="gmail_msg">
+ with open(temp, 'r') as f:<br class="gmail_msg">
+ content = f.read()<br class="gmail_msg">
+<br class="gmail_msg">
+ public_api_dir = os.path.join(<br class="gmail_msg">
+ os.environ["LLDB_SRC"], "include", "lldb", "API")<br class="gmail_msg">
+<br class="gmail_msg">
+ # Look under the include/lldb/API directory and add #include statements<br class="gmail_msg">
+ # for all the SB API headers.<br class="gmail_msg">
+ public_headers = os.listdir(public_api_dir)<br class="gmail_msg">
+ # For different platforms, the include statement can vary.<br class="gmail_msg">
+ if self.hasDarwinFramework():<br class="gmail_msg">
+ include_stmt = "'#include <%s>' % os.path.join('LLDB', header)"<br class="gmail_msg">
+ else:<br class="gmail_msg">
+ include_stmt = "'#include <%s>' % os.path.join(public_api_dir, header)"<br class="gmail_msg">
+ list = [eval(include_stmt) for header in public_headers if (<br class="gmail_msg">
+ header.startswith("SB") and header.endswith(".h"))]<br class="gmail_msg">
+ includes = '\n'.join(list)<br class="gmail_msg">
+ new_content = content.replace('%include_SB_APIs%', includes)<br class="gmail_msg">
+ src = os.path.join(os.getcwd(), source)<br class="gmail_msg">
+ with open(src, 'w') as f:<br class="gmail_msg">
+ f.write(new_content)<br class="gmail_msg">
+<br class="gmail_msg">
+ self.addTearDownHook(lambda: os.remove(src))<br class="gmail_msg">
+<br class="gmail_msg"></blockquote><div class=""><br class=""></div><div class="">The non hasDarwinFramework codepath is broken here, and I don't believe it to be a Windows specific issue. I'm getting the following error in multiple tests.</div><div class=""><br class=""></div><div class="">Traceback (most recent call last):</div><div class=""> File "C:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\plugins\commands\TestPluginCommands.py", line 23, in setUp</div><div class=""> self.generateSource('plugin.cpp')</div><div class=""> File "C:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 1868, in generateSource</div><div class=""> list = [eval(include_stmt) for header in public_headers if (</div><div class=""> File "C:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 1869, in <listcomp></div><div class=""> header.startswith("SB") and header.endswith(".h"))]</div><div class=""> File "<string>", line 1, in <module></div><div class=""><b class="">NameError: name 'public_api_dir' is not defined</b></div><div class="">Config=i686-C:\src\llvmbuild\ninja_release\bin\clang.exe </div><div class=""><br class=""></div><div class="">I'm hypothesizing that the problem is that from inside of a list comprehension, your set of locals is not the same as outside of the list comprehension, and so the eval statement does not see the variable `public_api_dir`. Is there any way you could provide a fix for this?</div></div></div>
</div></blockquote></div><br class=""></div></body></html>