Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
WardenGnaw opened this issue Jan 24, 2020 · 4 comments
Closed
Labels
cmake Build system in general and CMake in particular lldb

Comments

@WardenGnaw
Copy link

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()
@ncbidoug
Copy link

Having the same problem. Using OS X 10.14.6. Any luck?

@WardenGnaw
Copy link
Author

I have a workaround for now:

ninja install # <--- Fails

rm -rf $(Build.StagingDirectory)/buildspace/llvm-inst/Library/Frameworks/LLDB.framework

# Build lldb/sources/API first
cmake -P $(Build.StagingDirectory)/buildspace/llvm-build/tools/lldb/source/API/cmake_install.cmake

ninja install # <--- Succeeded

@ncbidoug
Copy link

Thank you!

It worked, but needed cd $(Build.StagingDirectory)/buildspace/llvm-inst before the cmake -P command.

@EugeneZelenko EugeneZelenko added cmake Build system in general and CMake in particular lldb labels Jan 15, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 15, 2022

@llvm/issue-subscribers-lldb

mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
Try to fix llvm/llvm-project#108

Install python scripts into canonical resource path

Differential revision: https://reviews.llvm.org/D116853
searlmc1 referenced this issue in ROCm/llvm-project Aug 23, 2023
…DEV-409068

SWDEV-409068 - Fix paths with spaces in it
skatrak added a commit to skatrak/llvm-project that referenced this issue Jul 5, 2024
The code removed by this patch was added with the intention of preventing the
use of regions belonging to loop wrapper operations as a point to insert
allocations. However, this issue is only present for `omp.parallel` wrappers,
which are handled right before this piece of code.

The result is that any operations that are currently captured by this piece of
code would be handled correctly by letting execution of the `getAllocaBlock()`
method continue and return the entry block of the parent `func.func` operation.
RevySR pushed a commit to revyos/llvm-project that referenced this issue Jul 27, 2024
* [LLVM][XTHeadVector] Implement intrinsics for 14.11.

* [LLVM][XTHeadVector] Add test cases for 14.11.

* [LLVM][XTHeadVector] Implement intrinsics for 14.12.

* [LLVM][XTHeadVector] Add test cases for 14.12.

* [LLVM][XTHeadVector] Implement intrinsics for 14.14.

* [LLVM][XTHeadVector] Add test cases for 14.14.

* [LLVM][XTHeadVector] Implement intrinsics for 14.15 and 14.16.

* [LLVM][XTHeadVector] Add test cases for 14.15 and 14.16.

* [LLVM][XTHeadVector] Implement intrinsics for 14.13.

* [LLVM][XTHeadVector] Add test cases for 14.13.
vitalybuka added a commit that referenced this issue Sep 16, 2024
alexanderguy pushed a commit to alexanderguy/llvm-project that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular lldb
Projects
None yet
Development

No branches or pull requests

4 participants