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

ILC doesn't return an error -- docker build keeps on running #89332

Closed
richlander opened this issue Jul 21, 2023 · 4 comments
Closed

ILC doesn't return an error -- docker build keeps on running #89332

richlander opened this issue Jul 21, 2023 · 4 comments

Comments

@richlander
Copy link
Member

I'm experimenting with native aot. I am doing that poorly such that my configuration is returning errors. However, docker build is happy to keep on building since no error is presented. That seems wrong.

root@869059bb2a82:/source# dotnet publish -a arm64 -o /app releasesapi.csproj -p:ObjCopyName=aarch64-linux-gnu-objcopy
MSBuild version 17.7.0+5785ed5c2 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/share/dotnet/sdk/8.0.100-preview.6.23330.14/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/source/releasesapi.csproj]
  releasesapi -> /source/bin/Release/net8.0/linux-arm64/releasesapi.dll
  Generating native code
  ILC: Method '[releasesapi]Program.<Main>$(string[])' will always throw because: Failed to load assembly 'Microsoft.AspNetCore'
  releasesapi -> /app/
root@869059bb2a82:/source# echo $?
0
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 21, 2023
@ghost
Copy link

ghost commented Jul 21, 2023

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

I'm experimenting with native aot. I am doing that poorly such that my configuration is returning errors. However, docker build is happy to keep on building since no error is presented. That seems wrong.

root@869059bb2a82:/source# dotnet publish -a arm64 -o /app releasesapi.csproj -p:ObjCopyName=aarch64-linux-gnu-objcopy
MSBuild version 17.7.0+5785ed5c2 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/share/dotnet/sdk/8.0.100-preview.6.23330.14/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/source/releasesapi.csproj]
  releasesapi -> /source/bin/Release/net8.0/linux-arm64/releasesapi.dll
  Generating native code
  ILC: Method '[releasesapi]Program.<Main>$(string[])' will always throw because: Failed to load assembly 'Microsoft.AspNetCore'
  releasesapi -> /app/
root@869059bb2a82:/source# echo $?
0
Author: richlander
Assignees: -
Labels:

area-Meta

Milestone: -

@ghost
Copy link

ghost commented Jul 21, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

I'm experimenting with native aot. I am doing that poorly such that my configuration is returning errors. However, docker build is happy to keep on building since no error is presented. That seems wrong.

root@869059bb2a82:/source# dotnet publish -a arm64 -o /app releasesapi.csproj -p:ObjCopyName=aarch64-linux-gnu-objcopy
MSBuild version 17.7.0+5785ed5c2 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/share/dotnet/sdk/8.0.100-preview.6.23330.14/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/source/releasesapi.csproj]
  releasesapi -> /source/bin/Release/net8.0/linux-arm64/releasesapi.dll
  Generating native code
  ILC: Method '[releasesapi]Program.<Main>$(string[])' will always throw because: Failed to load assembly 'Microsoft.AspNetCore'
  releasesapi -> /app/
root@869059bb2a82:/source# echo $?
0
Author: richlander
Assignees: -
Labels:

area-Meta, untriaged, area-NativeAOT-coreclr

Milestone: -

@jkotas jkotas removed the area-Meta label Jul 21, 2023
@jkotas
Copy link
Member

jkotas commented Jul 21, 2023

Failed to load assembly 'Microsoft.AspNetCore'

Missing dependencies are only a warning, they are not a hard error.

Assemblies with (intentionally) missing dependencies are very common in .NET ecosystem. We make best effort to treat missing dependencies as non-fatal errors and make the AOT binary throw the same exception as the JIT-based runtime would throws.

The actual problem is that the ASP.NET framework is not getting referenced by the AOT compilation for some reason.

@richlander
Copy link
Member Author

I figured out what going wrong. It is due to this: dotnet/sdk#34026.

OK. That's a design choice. This particular issue was fatal (the app crashes, obviously). I can see the category is more general, however.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants