This is an archive of the discontinued LLVM Phabricator instance.

LLDBStandalone: Report nice errors on missing vars
ClosedPublic

Authored by artagnon on Oct 16 2015, 11:15 AM.

Diff Detail

Event Timeline

artagnon updated this revision to Diff 37616.Oct 16 2015, 11:15 AM
artagnon retitled this revision from to LLDBStandalone: Report nice errors on missing vars.
artagnon updated this object.
artagnon added reviewers: chaoren, brucem.
artagnon added a subscriber: lldb-commits.
chaoren resigned from this revision.Oct 28 2015, 5:42 PM
chaoren removed a reviewer: chaoren.

Seems legit. But I've never built standalone, so I probably shouldn't be a reviewer for this.

clayborg resigned from this revision.Nov 3 2015, 2:07 PM
clayborg edited reviewers, added: tfiala; removed: clayborg.

I don't build cmake either, I am probably not a great person to ask. Todd Fiala might be a good person.

brucem edited edge metadata.Nov 3 2015, 3:23 PM

This looks reasonable to me as well, but I also have never built standalone.

tfiala edited edge metadata.Nov 4 2015, 9:29 AM

I'll have a look. How do I test it, @artagnon?

Okay, so run this on the current HEAD:

$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ../lldb
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/modules/LLDBStandalone.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


CMake Error at cmake/modules/LLDBStandalone.cmake:40 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


CMake Error at cmake/modules/LLDBStandalone.cmake:48 (include):
  include could not find load file:

    AddLLVM
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


CMake Error at cmake/modules/LLDBStandalone.cmake:49 (include):
  include could not find load file:

    HandleLLVMOptions
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


-- Found PythonInterp:
CMake Error at cmake/modules/LLDBStandalone.cmake:63 (include):
  include could not find load file:

    /share/llvm/cmake/LLVMConfig.cmake
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10")
CMake Error at cmake/modules/LLDBConfig.cmake:205 (check_cxx_compiler_flag):
  Unknown CMake command "check_cxx_compiler_flag".
Call Stack (most recent call first):
  CMakeLists.txt:4 (include)


-- Configuring incomplete, errors occurred!
See also "/home/rramacha/src/lldb-build2/CMakeFiles/CMakeOutput.log".

Cryptic syntax errors right? Now apply the patch and run:

$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ../lldb
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/modules/LLDBStandalone.cmake:43 (message):
  Please set LLDB_PATH_TO_LLVM_BUILD to the root directory of LLVM build or
  install site.
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


-- Configuring incomplete, errors occurred!
See also "/home/rramacha/src/lldb-build2/CMakeFiles/CMakeOutput.log".

Great. To fix that, run:

$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLDB_PATH_TO_LLVM_BUILD=~/src/llvm-build ../lldb
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/modules/LLDBStandalone.cmake:51 (message):
  Please set LLDB_PATH_TO_CLANG_BUILD to the root directory of Clang build or
  install site.
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)


-- Configuring incomplete, errors occurred!
See also "/home/rramacha/src/lldb-build2/CMakeFiles/CMakeOutput.log".

To build successfully, you need to (with or without the patch):

$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLDB_PATH_TO_LLVM_SOURCE=~/src/llvm -DLLDB_PATH_TO_LLVM_BUILD=~/src/llvm-build -DLLDB_PATH_TO_CLANG_SOURCE=~/src/clang -DLLDB_PATH_TO_CLANG_BUILD=~/src/clang-build ../lldb

The patch doesn't solve all issues: for instance, what happens when LLDB_PATH_TO_{LLVM,CLANG}_SOURCE isn't suitable? Why can't I query llvm-config and get all these paths? (and hopefully link against the installed version).

But I think it's a step forward. I think we should encourage people to build lldb standalone, so they can iterate faster.

tfiala accepted this revision.Nov 6 2015, 10:30 AM
tfiala edited edge metadata.

Okay, this seems reasonable.

This revision is now accepted and ready to land.Nov 6 2015, 10:30 AM
This revision was automatically updated to reflect the committed changes.