Skip to content

'ninja install' fails projects="clang;lldb" built with LLDB_BUILD_FRAMEWORK #108

Closed
@WardenGnaw

Description

@WardenGnaw

I am having issues running ninja install on a framework build of lldb.

I think its because target lldb-python-scripts installs before https://github.com/llvm/llvm-project/blob/master/lldb/source/API/CMakeLists.txt can install.

Steps:

cd ~
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout release/10.x
mkdir -p ~/buildspace
mkdir -p ~/buildspace/llvm-build
mkdir -p ~/buildspace/llvm-inst

cd ~/buildspace/llvm-build

cmake -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/buildspace/llvm-inst/ -DCMAKE_OSX_ARCHITECTURES=x86_64 -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_INCLUDE_TESTS=OFF -DLLDB_BUILD_FRAMEWORK=1 -GNinja ~/llvm-project/llvm

ninja

ninja install

ninja install fails with: CMake Error: failed to create symbolic link '~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources': file already exists

Any ideas on how to fix this?

Below are the logs and the relevant generated cmake_install.cmake files for reference:

ninja install failure logs
...
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/embedded_interpreter.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/__init__.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/synth.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/metrics.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/cache.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/__init__.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/Logger.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/cpp
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/cpp/libcxx.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/cpp/__init__.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/cpp/gnu_libstdcpp.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/formatters/attrib_fromdict.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/utils
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/utils/__init__.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/utils/symbolication.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/utils/in_call_stack.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/diagnose
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/diagnose/diagnose_unwind.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/diagnose/__init__.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/diagnose/diagnose_nsstring.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx/heap.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx/__init__.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx/heap
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx/heap/heap_find.cpp
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx/heap/Makefile
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/macosx/crashlog.py
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/lldb/_lldb.so
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources/Python/six.py
-- Up-to-date: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/LLDB
-- Installing: ~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources
CMake Error: failed to create symbolic link '~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources': file already exists
CMake Error at tools/lldb/source/API/cmake_install.cmake:36 (file):
  file INSTALL cannot duplicate symlink
  "~/buildspace/llvm-build/bin/LLDB.framework/Resources" at
  "~/buildspace/llvm-inst/Library/Frameworks/LLDB.framework/Resources":
  File exists.
Call Stack (most recent call first):
  tools/lldb/source/cmake_install.cmake:49 (include)
  tools/lldb/cmake_install.cmake:51 (include)
  tools/cmake_install.cmake:44 (include)
  cmake_install.cmake:63 (include)


FAILED: CMakeFiles/install.util
cd ~/buildspace/llvm-build && /usr/local/Cellar/cmake/3.16.2/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
llvm-build/tools/lldb/cmake_install.cmake
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xlldb-python-scriptsx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/Library/Frameworks/LLDB.framework/Resources/Python" TYPE DIRECTORY FILES "~buildspace/llvm-build/bin/LLDB.framework/Resources/Python/lldb/../")
endif()

if(NOT CMAKE_INSTALL_LOCAL_ONLY)
  # Include the install script for each subdirectory.
  include("~/buildspace/llvm-build/tools/lldb/bindings/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/utils/TableGen/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/cmake_install.cmake")    <------- 
  include("~/buildspace/llvm-build/tools/lldb/tools/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/docs/cmake_install.cmake")

endif()
llvm-build/tools/lldb/source/cmake_install.cmake
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
  # Include the install script for each subdirectory.
  include("~/buildspace/llvm-build/tools/lldb/source/Breakpoint/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Commands/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Core/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/DataFormatters/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Expression/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Host/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Initialization/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Interpreter/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Plugins/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Symbol/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Target/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/Utility/cmake_install.cmake")
  include("~/buildspace/llvm-build/tools/lldb/source/API/cmake_install.cmake")  <------- Failing

endif()
llvm-project/lldb/source/API/cmake_install.cmake
# Install script for directory: ~/llvm-project/lldb/source/API

# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "~/buildspace/llvm-inst")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
  if(BUILD_TYPE)
    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
  else()
    set(CMAKE_INSTALL_CONFIG_NAME "Release")
  endif()
  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()

# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
  if(COMPONENT)
    message(STATUS "Install component: \"${COMPONENT}\"")
    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
  else()
    set(CMAKE_INSTALL_COMPONENT)
  endif()
endif()

# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
  set(CMAKE_CROSSCOMPILING "FALSE")
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xliblldbx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/Library/Frameworks" TYPE DIRECTORY FILES "~/buildspace/llvm-build/bin/LLDB.framework" USE_SOURCE_PERMISSIONS)   <---- Failing Line
  if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/Library/Frameworks/LLDB.framework/Versions/A/LLDB" AND
     NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/Library/Frameworks/LLDB.framework/Versions/A/LLDB")
    if(CMAKE_INSTALL_DO_STRIP)
      execute_process(COMMAND "/Library/Developer/CommandLineTools/usr/bin/strip" -x "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/Library/Frameworks/LLDB.framework/Versions/A/LLDB")
    endif()
  endif()
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xliblldbx" OR NOT CMAKE_INSTALL_COMPONENT)
  message(STATUS "Externalize debuginfo: $ENV{DESTDIR}~/buildspace/llvm-build/./bin/LLDB.framework.dSYM")
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xliblldbx" OR NOT CMAKE_INSTALL_COMPONENT)
  execute_process(COMMAND xcrun dsymutil -o=$ENV{DESTDIR}~buildspace/llvm-build/./bin/LLDB.framework.dSYM ~/buildspace/llvm-build/bin/LLDB.framework/Versions/A/LLDB)
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xliblldbx" OR NOT CMAKE_INSTALL_COMPONENT)
  message(STATUS "Stripping: $ENV{DESTDIR}Library/Frameworks/LLDB.framework/Versions/A/LLDB")
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xliblldbx" OR NOT CMAKE_INSTALL_COMPONENT)
  execute_process(COMMAND xcrun strip -ST $ENV{DESTDIR}Library/Frameworks/LLDB.framework/Versions/A/LLDB)
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularlldb

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions