dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

ObjectWriter on Arch Linux #4904

Open Scellow opened 6 years ago

Scellow commented 6 years ago

OS:

Linux ryuk 4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux

I ran the following command:

./build.sh clean Debug >> output.log

Here is the output:

https://gist.github.com/Scellow/8ab508cf2122099332110abb71f4647d

Errors sumary:

L:380 -> /home/scellow/dev/tmp/corert/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/home/scellow/dev/tmp/corert/src/ILCompiler/ObjectWriter/ObjectWriter.depproj]
L:711 -> /home/scellow/dev/tmp/corert/dir.traversal.targets(24,5): error : (No message specified) [/home/scellow/dev/tmp/corert/src/dirs.proj]
L:712 -> /home/scellow/dev/tmp/corert/dir.traversal.targets(24,5): error : (No message specified) [/home/scellow/dev/tmp/corert/build.proj]

output.log

jkotas commented 6 years ago

This is the error:

/home/scellow/dev/tmp/corert/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/home/scellow/dev/tmp/corert/src/ILCompiler/ObjectWriter/ObjectWriter.depproj]

The problem is that we only have ObjectWriter packages built for Ubuntu.

Scellow commented 6 years ago

Oh ok! thanks for the info, do i have to compile it myself ?

jkotas commented 6 years ago

Either that (https://github.com/dotnet/corert/blob/master/Documentation/how-to-build-ObjectWriter.md), or try to tweak the condition here: https://github.com/dotnet/corert/blob/master/src/ILCompiler/ObjectWriter/ObjectWriter.depproj#L11 to <RuntimeIdentifiers Condition="'$(TargetsLinux)'=='true'">>ubuntu.14.04-x64</RuntimeIdentifiers>. There is a good chance that the Ubuntu package will work on all Linux flavors.

Scellow commented 6 years ago

I tried with 2nd method but still same issue:

./build.sh clean Debug >> output.log | grep error >> errors.log
/home/scellow/dev/tmp/corert/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/home/scellow/dev/tmp/corert/src/ILCompiler/ObjectWriter/ObjectWriter.depproj]
/home/scellow/dev/tmp/corert/dir.traversal.targets(24,5): error : (No message specified) [/home/scellow/dev/tmp/corert/src/dirs.proj]
/home/scellow/dev/tmp/corert/dir.traversal.targets(24,5): error : (No message specified) [/home/scellow/dev/tmp/corert/build.proj]

https://gist.github.com/Scellow/8da0f72ca7984081943fc33e49fd8ad1

output.log errors.log

I'll now try by compiling it myself

jkotas commented 6 years ago

The 2nd should fail much later if it does not work. Maybe the condition does not kick in as expected. Could you please try to change it to be unconditional to see whether it makes a difference?

<RuntimeIdentifiers>ubuntu.14.04-x64</RuntimeIdentifier>

Scellow commented 6 years ago

Seems to solve the previous issue, but it then failed

output.log

I had clang 5 installed, i tried with clang3.9 but it refuse to compile:

https://gist.github.com/Scellow/94c06354e0a35771b7486663bba3a9fb

I think i'll end up just installing ubuntu :p

jkotas commented 6 years ago

The scripts default to clang-3.9 today. You can overwrite the default by doing export CppCompilerAndLinker=clang-5.0 or CppCompilerAndLinker=clang.

It is weird that you are not able to compile with clang-3.9. It is what we use by default in CI and everywhere else.

janvorli commented 6 years ago

@Scellow the issue is that the build picks GCC for C++ compilation instead of clang, see this line in the build log:

The CXX compiler identification is GNU 7.2.0

I've seen this issue on some Linux distros with coreclr already. The problem is caused by the fact that in those cases, the C compiler is named as clang-3.9 (and also exposed via a symlink as clang), but the C++ compiler is exposed only as clang++ (without the version number). I have no idea why the distros have this discrepancy. A quick fix is to create a symlink named clang++-3.9 in the directory where the clang++ is located. The CppCompilerAndLinker=clang that @jkotas has suggested would likely work too.

aleksmelnikov commented 6 years ago

I have got same building errors with clang-5.0.1 on ArchLinux after I did

ln -s /usr/bin/clang /usr/local/bin/clang-3.9
ln -s /usr/bin/clang++ /usr/local/bin/clang++-3.9

I have in my log:

-- The C compiler identification is Clang 5.0.1
-- The CXX compiler identification is Clang 5.0.1
-- Check for working C compiler: /usr/local/bin/clang-3.9
-- Check for working C compiler: /usr/local/bin/clang-3.9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/bin/clang++-3.9
-- Check for working CXX compiler: /usr/local/bin/clang++-3.9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is Clang
-- Found assembler: /usr/local/bin/clang-3.9

output.log

/xyz/corert/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/xyz/corert/src/ILCompiler/ObjectWriter/ObjectWriter.depproj]
/xyz/corert/dir.traversal.targets(24,5): error : (No message specified) [/xyz/corert/src/dirs.proj]
/xyz/corert/dir.traversal.targets(24,5): error : (No message specified) [/xyz/corert/build.proj]

After + <RuntimeIdentifiers Condition="'$(TargetsLinux)'=='true'">ubuntu.14.04-x64</RuntimeIdentifiers>

output.log

janvorli commented 6 years ago

@superriva can you please share the errors? I don't see how they could be the same as when it was trying to use gcc, since many of them were gcc specific.

Scellow commented 6 years ago

@superriva check this: https://github.com/dotnet/corert/issues/5224 he seems to have it working fine

I personally gave up with linux, it is a way too annoying OS to setup, i'm using windows/macOS(hackintosh) only now

aleksmelnikov commented 6 years ago

@Scellow , thanks a lot.