sec / dotnet-core-freebsd-source-build

Collection of script to build .NET Core under FreeBSD OS (with binary releases)
MIT License
53 stars 4 forks source link

Stops at "make install", FreeBSD 13, no jail #9

Closed LTRData closed 2 years ago

LTRData commented 2 years ago

Build fails at ./build_runtime.sh step. This is end of output where it seems to break.

  Invoking "/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/eng/native/gen-buildsys.sh" "/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr" "/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/artifacts/obj/coreclr/FreeBSD.x64.Release" x64 clang "" "" Release ""  -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH= -DCLR_CMAKE_PGO_OPTIMIZE=1 -DFEATURE_DISTRO_AGNOSTIC_SSL=1
  WARN: Specific version of clang not found, falling back to use the one in PATH.
  /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/artifacts/obj/coreclr/FreeBSD.x64.Release /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr
  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 11.0.1
  -- The CXX compiler identification is Clang 11.0.1
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring incomplete, errors occurred!
  See also "/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/artifacts/obj/coreclr/FreeBSD.x64.Release/CMakeFiles/CMakeOutput.log".
  CMake Error at /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/eng/native/configuretools.cmake:37 (message):
    Unable to find toolchain executable.  Name: link, Prefix: llvm-.
  Call Stack (most recent call first):
    /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/eng/native/configuretools.cmake:47 (locate_toolchain_exec)
    /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/eng/native/configurecompiler.cmake:1 (include)
    CMakeLists.txt:19 (include)

  /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr
  /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/artifacts/obj/coreclr/FreeBSD.x64.Release /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr
  Executing make install -j 33
  make: make: don't know how to make install. Stop

  make: stopped in /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/artifacts/obj/coreclr/FreeBSD.x64.Release
  /var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr
  ##vso[task.logissue type=error]Failed to build "CoreCLR component".
/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr/runtime.proj(46,5): error MSB3073: The command ""/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr/build-runtime.sh" -x64 -release -ci -os FreeBSD /p:OfficialBuildId=20220601.99" exited with code 2.
##vso[task.logissue type=error;sourcepath=/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr/runtime.proj;linenumber=46;columnnumber=5;code=MSB3073;](NETCORE_ENGINEERING_TELEMETRY=Build) The command ""/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr/build-runtime.sh" -x64 -release -ci -os FreeBSD /p:OfficialBuildId=20220601.99" exited with code 2.

Build FAILED.

/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr/runtime.proj(46,5): error MSB3073: The command ""/var/tmp/build/dotnet/dotnet-core-freebsd-source-build/runtime/src/coreclr/build-runtime.sh" -x64 -release -ci -os FreeBSD /p:OfficialBuildId=20220601.99" exited with code 2.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:39:42.64
Build failed with exit code 1. Check errors above.
##vso[task.complete result=Failed;]msbuild execution failed.

The mentioned log file CMakeOutput.log does not exist. The directory in question does not have a Makefile, so that is why make fails but I cannot figure out how it ends up in that situation.

# ls -l
total 56
-rw-------  1 root  wheel  14636 Jun  1 11:24 CMakeCache.txt
drwx------  4 root  wheel    512 Jun  1 11:24 CMakeFiles
-rw-------  1 root  wheel    137 Jun  1 11:24 cmake_cmd_line.txt
-rw-------  1 root  wheel      0 Jun  1 11:24 optdatapath.txt
-rw-------  1 root  wheel    124 Jun  1 11:24 version.c

Could it have something to do with the message about clang?

# clang++ --version
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin

OS version etc:

# uname -a
FreeBSD vpcfbsd10.olofdom.se 13.0-RELEASE-p11 FreeBSD 13.0-RELEASE-p11 #0: Tue Apr  5 18:54:35 UTC 2022     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
sec commented 2 years ago

I see it's trying to use clang 11 - did you run install_tools.sh as root? In general, clang from base shouldn't not be used to build anything except system itself - so it should pick up llvm from /usr/local - is this fresh 13.0-R install ?

edit: also which branch are you trying to build?

LTRData commented 2 years ago

It has been upgraded from 12.x so there could be things left from older versions. Yes, I ran install_tools.sh as root. It does not install anything when I run it, so I suppose it finds all it needs installed already?

LTRData commented 2 years ago

I just did a git clone of this repo and did not select anything to build so it should be default branch.

sec commented 2 years ago

Yeah I see something's wrong here... I'm quite sure I did build of 6.0.4 (main points to that) - but right now it fail almost at the start with Failed to get PGO data package path - it does not even get to right build point... Anyway, please try with 6.0.201 branch - launched that and can see it's doing proper build. There is also v7 branch, but tha's rough edges even more :) There are also prebuild SDK under releases, if you trust enough :)

edit: also trying with 6.0.5 now and looks like it's rolling fine... maybe try to pkg delete llvm10 and pkg install llvm10 - also I'm on FreeBSD 13.0-RELEASE-p11

sec commented 2 years ago

Hi. I was able to fully build runtime, aspnet, sdk (can be skipped) and installer under FreeBSD 13.0-RELEASE-p11 using 6.0.5 (sdk 6.0.300) tags (updated main to reflect needed changed). Please try with clean / rebuild and let me know :)

LTRData commented 2 years ago

I uninstalled and reinstalled llvm10 and cleaned everything and rebuilt. Got loads of errors about using deprecated functions but just ran build_runtime.sh again and then it worked. Not sure really what happened there.

Thanks for the release!