microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.99k stars 6.35k forks source link

[llvm] build failure #32963

Closed perrog closed 1 year ago

perrog commented 1 year ago

Operating system

Linux CentOS7 container

Compiler

GCC, clang

Steps to reproduce the behavior

`vcpkg install llvm[clang,libcxx] --triplet=x64-linux`

Failure logs

Console output:

Computing installation plan...
The following packages will be rebuilt:
    llvm[clang,core,default-options,default-targets,disable-assertions,disable-clang-static-analyzer,enable-bindings,enable-terminfo,enable-threads,enable-zlib,enable-zstd,libcxx,libcxxabi,lld,target-spirv,target-x86,tools]:x64-linux -> 15.0.7#3
Removing 1/2 llvm:x64-linux
Elapsed time to handle llvm:x64-linux: 45.8 ms
Installing 2/2 llvm:x64-linux...
Building llvm[clang,core,default-options,default-targets,disable-assertions,disable-clang-static-analyzer,enable-bindings,enable-terminfo,enable-threads,enable-zlib,enable-zstd,libcxx,libcxxabi,lld,target-spirv,target-x86,tools]:x64-linux...
-- Using cached llvm-llvm-project-llvmorg-15.0.7.tar.gz.
-- Using source at <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce
-- Getting CMake variables for x64-linux
-- Configuring x64-linux
CMake Warning at installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:318 (message):
  The following variables are not used in CMakeLists.txt:

      BOLT_TOOLS_INSTALL_DIR
      LIBOMP_INSTALL_ALIASES

  Please recheck them and remove the unnecessary options from the
  `vcpkg_cmake_configure` call.

  If these options should still be passed for whatever reason, please use the
  `MAYBE_UNUSED_VARIABLES` argument.
Call Stack (most recent call first):
  ports/llvm/portfile.cmake:238 (vcpkg_cmake_configure)
  scripts/ports.cmake:147 (include)

-- Building x64-linux-dbg
CMake Warning at scripts/cmake/vcpkg_execute_build_process.cmake:65 (message):
  Please ensure your system has sufficient memory.
Call Stack (most recent call first):
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/llvm/portfile.cmake:271 (vcpkg_cmake_install)
  scripts/ports.cmake:147 (include)

-- Restarting build without parallelism
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: <vcpkg_root>/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j25
    Working Directory: <vcpkg_root>/buildtrees/llvm/x64-linux-dbg
    See logs for more information:
      <vcpkg_root>/buildtrees/llvm/install-x64-linux-dbg-out.log
      <vcpkg_root>/buildtrees/llvm/install-x64-linux-dbg-out-1.log
      <vcpkg_root>/buildtrees/llvm/install-x64-linux-dbg-err-1.log

Call Stack (most recent call first):
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/llvm/portfile.cmake:271 (vcpkg_cmake_install)
  scripts/ports.cmake:147 (include)

error: building llvm:x64-linux failed with: BUILD_FAILED
Elapsed time to handle llvm:x64-linux: 1.7 h
internal error: /mnt/vss/_work/1/s/src/vcpkg/commands.build.cpp(1510): Value was null
Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.
$ tail <vcpkg_root>/buildtrees/llvm/install-x64-linux-dbg-out.log

[2145/3468] /opt/rh/devtoolset-11/root/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/tools/clang/lib/StaticAnalyzer/Frontend -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/clang/lib/StaticAnalyzer/Frontend -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/clang/include -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/tools/clang/include -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/llvm/include -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/tools/clang/lib/StaticAnalyzer/Frontend/../Checkers -I<vcpkg_root>/installed/x64-linux/include -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -fno-common -Woverloaded-virtual -fno-strict-aliasing -g -std=c++14  -fno-exceptions -fno-rtti -MD -MT tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/obj.clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.o -MF tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/obj.clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.o.d -o tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/obj.clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.o -c <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
[2146/3468] /opt/rh/devtoolset-11/root/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/tools/clang/lib/Serialization -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/clang/lib/Serialization -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/clang/include -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/tools/clang/include -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/llvm/include -I<vcpkg_root>/installed/x64-linux/include -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -fno-common -Woverloaded-virtual -fno-strict-aliasing -g -std=c++14  -fno-exceptions -fno-rtti -MD -MT tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ASTReader.cpp.o -MF tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ASTReader.cpp.o.d -o tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ASTReader.cpp.o -c <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/clang/lib/Serialization/ASTReader.cpp
ninja: build stopped: subcommand failed.
$ tail <vcpkg_root>/buildtrees/llvm/install-x64-linux-dbg-out-1.log
In file included from /usr/include/string.h:32:
<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/c++/v1/stddef.h:17:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/runtimes/runtimes-stamps/runtimes-build
cd <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/runtimes/runtimes-bins && <vcpkg_root>/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake --build .
ninja: build stopped: subcommand failed.
$ tail <vcpkg_root>/buildtrees/llvm/install-x64-linux-dbg-err-1.log
CMake Warning:
  Manually-specified variables were not used by the project:

    COMPILER_RT_BUILD_BUILTINS
    HAVE_LLVM_LIT
    LLVM_BUILD_TOOLS
    LLVM_CONFIG_PATH
    LLVM_ENABLE_PROJECTS_USED

Additional context

I dumped include directory paths

$ cd <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/runtimes/runtimes-bins
$ <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBCXX_BUILDING_LIBCXXABI -D_LIBCPP_BUILDING_LIBRARY -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_LINK_PTHREAD_LIB -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/libcxxabi/../libcxx/src -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/c++/v1 -I<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/x86_64-unknown-linux-gnu/c++/v1 -I<vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/libcxxabi/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color  -g -std=c++20 -fPIC -nostdinc++ -Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags -Wmissing-braces -Wnewline-eof -Wunused-function -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef -Wno-suggest-override -Wno-error -pedantic -fstrict-aliasing -funwind-tables -D_DEBUG -MD -MT libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_demangle.cpp.o -MF libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_demangle.cpp.o.d -E -x c++ - -v < /dev/null
clang version 15.0.7
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/./bin
Found candidate GCC installation: /opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11
Selected GCC installation: /opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 (in-process)
 "<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/bin/clang-15" -cc1 -triple x86_64-unknown-linux-gnu -E -disable-free -clear-ast-before-backend -main-file-name - -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -v -fcoverage-compilation-dir=<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/runtimes/runtimes-bins -nostdinc++ -resource-dir <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/bin/lib/clang/15.0.7 -dependency-file libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_demangle.cpp.o.d -MT libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_demangle.cpp.o -sys-header-deps -D LIBCXX_BUILDING_LIBCXXABI -D _LIBCPP_BUILDING_LIBRARY -D _LIBCXXABI_BUILDING_LIBRARY -D _LIBCXXABI_LINK_PTHREAD_LIB -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/libcxxabi/../libcxx/src -I <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/c++/v1 -I <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/x86_64-unknown-linux-gnu/c++/v1 -I <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/libcxxabi/include -D _DEBUG -internal-isystem <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/bin/lib/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags -Wmissing-braces -Wnewline-eof -Wunused-function -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef -Wno-suggest-override -Wno-error -pedantic -std=c++20 -fdeprecated-macro -fdebug-compilation-dir=<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/runtimes/runtimes-bins -ferror-limit 19 -fvisibility-inlines-hidden -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o - -x c++ -
clang -cc1 version 15.0.7 based upon LLVM 15.0.7 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/bin/lib/clang/15.0.7/include"
ignoring nonexistent directory "/opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11/../../../../x86_64-redhat-linux/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/libcxxabi/../libcxx/src
 <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/c++/v1
 <vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/x86_64-unknown-linux-gnu/c++/v1
 <vcpkg_root>/buildtrees/llvm/src/org-15.0.7-26832cabce/libcxxabi/include
 /usr/local/include
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 442 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

$ find <vcpkg_root>/buildtrees/llvm/x64-linux-dbg -name stddef.h
<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/lib/clang/15.0.7/include/stddef.h
<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/include/c++/v1/stddef.h

I suspect -internal-isystem and -resource-dir points to wrong directory.

<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/bin/lib  # does not exists
<vcpkg_root>/buildtrees/llvm/x64-linux-dbg/lib      # exists

Can it be the reason? Any hints where I change this?

Adela0814 commented 1 year ago

Duplicate of https://github.com/microsoft/vcpkg/issues/31038.