[Lldb-commits] [PATCH] D69589: [lldb] Refactor all POST_BUILD commands into targets

António Afonso via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 3 15:30:55 PST 2019


aadsm requested changes to this revision.
aadsm added a comment.
This revision now requires changes to proceed.

I'm sorry to reject but this diff breaks `install-distribution` on Darwin. Here's how to repro:

  $ mkdir -p ~/Projects/llvm-build/Release && cd ~/Projects/llvm-build/Release
  $ cmake -G Ninja \
   -DLLVM_ENABLE_PROJECTS="clang;lldb" \
   -DCMAKE_BUILD_TYPE=Release \
   -DLLVM_ENABLE_ASSERTIONS=OFF \
   -DLLDB_INCLUDE_TESTS=OFF \
   -DLLVM_DISTRIBUTION_COMPONENTS="lldb;liblldb" \
   -C ../../llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake \
   -S../../llvm-project/llvm
  $ DESTDIR=$PWD/install/usr install-distribution
  ninja: error: 'bin/LLDB.framework/LLDB', needed by 'bin/LLDB.framework/Resources/Python/lldb/_lldb.so', missing and no known rule to make it

The reason I found this is because I was having an issue where `_lldb.so` was being generated on the build but it was not being copied to the install directory.
After some mucking around I realized that the `install-liblldb` target installs the python scripts but it's `lldb` that generates the symlink as a `POST_BUILD` command (before this diff). I think in some situations the `install-liblldb` runs before that `POST_BUILD` command has run. At least I'm able to repro this quite consistently and once `ninja install-distribution` is finished `_lldb.so` exists on the build directory but not on the install one (and I can see all files in the python module being copied except that one in the ninja log when running the install step).

I fixed this locally by doing this (this fix doesn't really feel good but not sure what's the best way to do it):

  if(LLDB_BUILD_FRAMEWORK)
    # When building as framework liblldb is responsible to install the python
    # scripts. However, we need to make sure that all swig components have been
    # properly finished.
    add_dependencies(install-liblldb finish_swig)
    add_dependencies(install-liblldb-stripped finish_swig)
  else()
    # Install the LLDB python module
    ...
  endif()

Then I found this diff that hasn't landed yet and tried it (I think there's a race condition caused by the POST_BUILD command but not sure) out and stumbled upon this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69589/new/

https://reviews.llvm.org/D69589





More information about the lldb-commits mailing list