<div dir="ltr">Maybe make it a dependency of the `check-lldb` target instead of the `lldb` target?</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 27, 2017 at 1:26 PM Davide Italiano <<a href="mailto:dccitaliano@gmail.com">dccitaliano@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm testing with the following change.<br>
Should I shove the dependency instead in test/CmakeLists.txt ?<br>
<br>
$ git diff HEAD<br>
diff --git a/CMakeLists.txt b/CMakeLists.txt<br>
index c6b082e..b6d24f8 100644<br>
--- a/CMakeLists.txt<br>
+++ b/CMakeLists.txt<br>
@@ -65,6 +65,7 @@ if(LLDB_INCLUDE_TESTS)<br>
if (TARGET clang)<br>
set(LLDB_DEFAULT_TEST_C_COMPILER<br>
"${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")<br>
set(LLDB_DEFAULT_TEST_CXX_COMPILER<br>
"${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")<br>
+ add_dependencies(lldb clang)<br>
else()<br>
set(LLDB_DEFAULT_TEST_C_COMPILER "")<br>
set(LLDB_DEFAULT_TEST_CXX_COMPILER "")<br>
<br>
Thanks!<br>
<br>
--<br>
Davide<br>
<br>
On Fri, Oct 27, 2017 at 1:16 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> Agree we should just build clang as a dependency. We're already building<br>
> most of it anyway since we require it for the expression parser, so spitting<br>
> out the executabatle as well should not be too controversial.<br>
><br>
> On Fri, Oct 27, 2017 at 12:58 PM Davide Italiano via lldb-dev<br>
> <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Mind if I try to write a patch for this one or you want to do it?<br>
>><br>
>> On Fri, Oct 27, 2017 at 12:56 PM, Pavel Labath <<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>> wrote:<br>
>> > Yes, listing clang as a dependency sounds like a good idea.<br>
>> ><br>
>> > On 27 October 2017 at 12:45, Davide Italiano <<a href="mailto:dccitaliano@gmail.com" target="_blank">dccitaliano@gmail.com</a>><br>
>> > wrote:<br>
>> >> So, I wiped out my directory for the build and then I created it again<br>
>> >> using<br>
>> >> cmake -GNinja ../<br>
>> >><br>
>> >> I found out what the bug/problem is, BTW (was going to reply to this<br>
>> >> e-mail but you've beaten me to the punch).<br>
>> >> You switched LLDB to build with an in-tree clang, but ninja check-lldb<br>
>> >> doesn't really require clang to be built.<br>
>> >> As such, once I cleaned up my checkout, I ended up typing just `ninja<br>
>> >> check-lldb` and that failed because clang wasn't built.<br>
>> >> I claim that `ninja check-lldb` should list clang as dependency when<br>
>> >> we're running the tests with the in-tree clang.<br>
>> >> WDYT?<br>
>> >><br>
>> >> Thanks!<br>
>> >><br>
>> >> --<br>
>> >> Davide<br>
>> >><br>
>> >><br>
>> >><br>
>> >> On Fri, Oct 27, 2017 at 12:41 PM, Pavel Labath <<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>><br>
>> >> wrote:<br>
>> >>> Did you clean your cmake cache before runinng this? Does<br>
>> >>> '/home/davide/work/build-lldb/bin/clang' correctly refer to a clang<br>
>> >>> binary you just built?<br>
>> >>><br>
>> >>> On 27 October 2017 at 12:39, Davide Italiano <<a href="mailto:dccitaliano@gmail.com" target="_blank">dccitaliano@gmail.com</a>><br>
>> >>> wrote:<br>
>> >>>> Yes, it seems `configuration.compiler` is None, so this explodes:<br>
>> >>>><br>
>> >>>> [...]<br>
>> >>>> if not is_exe(configuration.compiler):<br>
>> >>>><br>
>> >>>> [...]<br>
>> >>>><br>
>> >>>> On Fri, Oct 27, 2017 at 12:37 PM, Davide Italiano<br>
>> >>>> <<a href="mailto:dccitaliano@gmail.com" target="_blank">dccitaliano@gmail.com</a>> wrote:<br>
>> >>>>> I think that this change (or some change nearby) broke `check-lldb`<br>
>> >>>>> on Fedora.<br>
>> >>>>><br>
>> >>>>> I'm investigating, but in the meanwhile, here's the log.<br>
>> >>>>><br>
>> >>>>> $ ninja check-lldb<br>
>> >>>>> [2/2] Testing LLDB (parallel execution, with a separate subprocess<br>
>> >>>>> per test)<br>
>> >>>>> Traceback (most recent call last):<br>
>> >>>>> File "/home/davide/work/llvm-lldb/tools/lldb/test/dotest.py", line<br>
>> >>>>> 7, in <module><br>
>> >>>>> lldbsuite.test.run_suite()<br>
>> >>>>> File<br>
>> >>>>> "/home/davide/work/llvm-lldb/tools/lldb/packages/Python/lldbsuite/test/dotest.py",<br>
>> >>>>> line 1099, in run_suite<br>
>> >>>>> parseOptionsAndInitTestdirs()<br>
>> >>>>> File<br>
>> >>>>> "/home/davide/work/llvm-lldb/tools/lldb/packages/Python/lldbsuite/test/dotest.py",<br>
>> >>>>> line 282, in parseOptionsAndInitTestdirs<br>
>> >>>>> if not is_exe(configuration.compiler):<br>
>> >>>>> File<br>
>> >>>>> "/home/davide/work/llvm-lldb/tools/lldb/packages/Python/lldbsuite/test/dotest.py",<br>
>> >>>>> line 54, in is_exe<br>
>> >>>>> return os.path.isfile(fpath) and os.access(fpath, os.X_OK)<br>
>> >>>>> File "/usr/lib64/python2.7/genericpath.py", line 37, in isfile<br>
>> >>>>> st = os.stat(path)<br>
>> >>>>> TypeError: coercing to Unicode: need string or buffer, NoneType<br>
>> >>>>> found<br>
>> >>>>> FAILED: cd /home/davide/work/build-lldb/tools/lldb/test &&<br>
>> >>>>> /usr/bin/python2.7<br>
>> >>>>> /home/davide/work/llvm-lldb/tools/lldb/test/dotest.py -q<br>
>> >>>>> --arch=x86_64<br>
>> >>>>> --executable /home/davide/work/build-lldb/bin/lldb -s<br>
>> >>>>> /home/davide/work/build-lldb/lldb-test-traces -S nm -u CXXFLAGS -u<br>
>> >>>>> CFLAGS -C /home/davide/work/build-lldb/bin/clang --env<br>
>> >>>>> ARCHIVER=/usr/bin/ar --env OBJCOPY=/usr/bin/objcopy<br>
>> >>>>> ninja: build stopped: subcommand failed.<br>
>> >>>>><br>
>> >>>>> On Thu, Oct 26, 2017 at 7:18 PM, Pavel Labath via lldb-dev<br>
>> >>>>> <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
>> >>>>>> I am going to check in a change (D39215) which causes the<br>
>> >>>>>> check-lldb<br>
>> >>>>>> target to use the just-built clang for compiling the test inferiors<br>
>> >>>>>> (instead of the system compiler, which was the old default). The<br>
>> >>>>>> main<br>
>> >>>>>> reason for this is to provide better reproducibility of test<br>
>> >>>>>> results<br>
>> >>>>>> between different machines/developers, by removing one of the main<br>
>> >>>>>> sources of nondeterminism. This behavior can be overridden by<br>
>> >>>>>> setting<br>
>> >>>>>> the LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER cmake<br>
>> >>>>>> variables.<br>
>> >>>>>><br>
>> >>>>>> For the change to take effect you will need to clean your build<br>
>> >>>>>> folder<br>
>> >>>>>> (or at least, remove the affected variables from your<br>
>> >>>>>> CMakeCache.txt).<br>
>> >>>>>> After this you may observe a change in the test results from the<br>
>> >>>>>> check-lldb run.<br>
>> >>>>>><br>
>> >>>>>> Note that this change only affect cmake code -- if you run your<br>
>> >>>>>> tests<br>
>> >>>>>> by running dotest.py directly, nothing will change for you.<br>
>> >>>>>><br>
>> >>>>>> regards,<br>
>> >>>>>> pavel<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" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><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" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>