This is an archive of the discontinued LLVM Phabricator instance.

Build procedure for lldb project with cmake/ninja
AbandonedPublic

Authored by chying on Feb 9 2015, 3:53 PM.

Details

Summary

Added new build procedure for lldb project.

Command sequence:
svn to get source
clean build folder
cmake
ninja
ninja check-lldb

Diff Detail

Event Timeline

chying updated this revision to Diff 19622.Feb 9 2015, 3:53 PM
chying retitled this revision from to Build procedure for lldb project with cmake/ninja.
chying updated this object.
chying edited the test plan for this revision. (Show Details)
chying added a subscriber: Restricted Project.
chying edited subscribers, added: Unknown Object (MLST); removed: Restricted Project.Feb 9 2015, 4:11 PM
sivachandra edited edge metadata.Feb 10 2015, 10:21 PM

There are a bunch of style nits that I pointed out. They are optional, but I think definitely good to have. Even if the existing code is haphazardly formatted, it is good to set a precedent for future changes.

zorg/buildbot/builders/LLDBBuilder.py
254

I am not sure if this is relevant for CMake builds.

298

nit: line 287-297 can be better formatted according to PEP8.

313

I do not think that the linux builders (debian, freebsd and ubuntu) are doing it right wrt getting the source. I think the windows builders are dong it right. Look at the function getLLDBSource above. The function getLLDBxcodebuildFactory below is also doing the same as getLLDBSource.

321

nit: Fix indentation of above lines to follow PEP8 rules.

324

As I mentioned above, I do not think this is relevant for CMake builds.

332

nit: Fix indentation of above 4 lines.

338

nit: Fix indentation of above 3 lines.

Sorry for revisiting. Just a couple of things which are probably good to be fixed, but not required/important.

zorg/buildbot/builders/LLDBBuilder.py
258

Default args to Python functions should not be empty lists or empty dicts. It does not matter in this case as this function is called only once. So, its up to you if you want to fix.

See: http://stackoverflow.com/questions/9887180/the-value-of-an-empty-list-in-function-parameter-example-here

320

This should probably be in extra_configure_args.

sivachandra added inline comments.Feb 11 2015, 8:08 PM
zorg/buildbot/builders/LLDBBuilder.py
320

Ying had asked a question about this off-thread. I am answering it here.

If you actually want to get it absolutely right, you should remove the arg extra_configure_args completely. That name suggests the use of "configure" and not cmake. If you do want to go this route, then you should have the following args instead of "extra_configure_args":

  1. build_compiler - This can take args like "gcc", "clang", "icc" etc. You should have logic like this:

    cmake_args = [] if build_compiler == 'gcc': cmake_args += ["-DCMAKE_C_COMPILER=gcc", "-DCMAKE_CXX_COMPILER=g++"] elif build_compiler == 'clang': ... so on
  1. test_compiler - This can take args like "gcc", "clang", "icc", etc. You should have logic like this:

    if test_compiler == 'gcc': cmake_args.append("-DLLDB_TEST_COMPILER=gcc") elif test_compiler == 'clang': ... so on
  1. build_type - This can be 'Debug' or 'Release'. You should have code like this:

    cmake_args.append("-DCMAKE_BUILD_TYPE=%s" % build_type)
chying abandoned this revision.Feb 24 2015, 5:58 PM

Create new revision based on code review feedback
http://reviews.llvm.org/D7599