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

NativeAOT-LLVM: Question: Platform and arch #260

Closed
yowl opened this issue Oct 22, 2020 · 40 comments
Closed

NativeAOT-LLVM: Question: Platform and arch #260

yowl opened this issue Oct 22, 2020 · 40 comments
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) question Further information is requested

Comments

@yowl
Copy link
Contributor

yowl commented Oct 22, 2020

In the project files, llvm specific files are included switching on the Platform:

    <Compile Include="$(BclSourcesRoot)\System\Diagnostics\StackTrace.CoreCLR.LLVM.cs" Condition="'$(Platform)'=='llvm'"/>

I note there is an --arch defined for Wasm. When building for LLVM what would you expect the arguments to be to build ? Should there be something that sets the build property of Platform to llvm for an arch of wasm, so it would be something like build -a wasm or as there are going to various sub targets for LLVM, .e.g a win-x86 target, how should this be setup ?

@yowl
Copy link
Contributor Author

yowl commented Oct 22, 2020

Adding that I can try with build nativeaot+libs+installer -rc Debug -lc Release -platform llvm -a wasm

but it looks for a RID of win-wasm

C:\Program Files\dotnet\sdk\5.0.100-rc.2.20480.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1083: The specified RuntimeIdentifier 'win-wasm' is not recognized. [E:\GitHub\runtimelab\Build.proj]

if this is the right way to go then I can investigate where this RID is coming from. I know there is a browser-wasm RID which might work although it may be wired for mono and it might be easier to start with the win packages which I think is what CoreRT did (at least it did for System.Console).

@jkotas
Copy link
Member

jkotas commented Oct 22, 2020

StackTrace.CoreCLR.LLVM.cs

Is the logic in this file LLVM-specific or Wasm-specific?

I think that LLVM backend on e.g. Linux arm64 should (eventually) generate the code in the same shape as RyuJIT.

@jkotas
Copy link
Member

jkotas commented Oct 22, 2020

-platform llvm

I think platform for wasm should stay as wasm.

@yowl
Copy link
Contributor Author

yowl commented Oct 22, 2020

StackTrace.CoreCLR.LLVM.cs

Is the logic in this file LLVM-specific or Wasm-specific?

This one is wasm (emscripten specific),
Exception.CoreCLR.LLVM.cs is LLVM-specific

We also had

ExceptionHandling.wasm.cs - LLVM specific
StackFrameIterator.wasm.cs - LLVM specific ( although assumes little endian and 32 bit)

Of these 4 they are in NativeAOT as:
Exception.CoreCLR.LLVM.cs
StackTrace.CoreRT.Wasm.cs
StackFrameIterator.wasm.cs
ExceptionHandling.wasm.cs

So I guess we are going to want some files that are general LLVM and work across architectures, and some that only work for a specific architecture.

@yowl
Copy link
Contributor Author

yowl commented Oct 22, 2020

Edited as StackTrace.CoreCLR.LLVM.cs was copied over, but renamed and the csproj condition changed from wasm to llvm.

@jkotas
Copy link
Member

jkotas commented Oct 22, 2020

We have dealt with the low-level codegen differences by selecting the right support methods for them at app compile time or runtime. For example SupportsRelativePointers: https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/src/coreclr/src/nativeaot/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs#L1155 and https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/src/coreclr/src/tools/Common/TypeSystem/IL/CoreRTILProvider.cs#L95

This allowed us to build one corelib per platform. The number of potential combinations of codegen variants and platforms would grow really fast otherwise.

@yowl
Copy link
Contributor Author

yowl commented Oct 24, 2020

Thanks, moving on a bit.

<ClrDefaultRuntimeBuildSubsets>ClrRuntimeSubset=true;ClrJitSubset=true</ClrDefaultRuntimeBuildSubsets>

This property group is not conditional and appears to include the jit and hence the code under coreclr/src/jit. Should I be setting that to false for LLVM?

@jkotas
Copy link
Member

jkotas commented Oct 24, 2020

Yes, that should be fine. How to you plan to specify LLVM? Is it going to be hardcoded in the branch, or is it going to be a setting somewhere?

For the nativeaot branch, we took several shortcuts that regress build of regular .NET runtime when setting up how the build works. We just made sure to add comments around them. These shortcuts would need to be cleaned up before the changes are upstreamed to master.

@jkotas jkotas added area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) question Further information is requested labels Oct 25, 2020
@yowl
Copy link
Contributor Author

yowl commented Oct 26, 2020

How to you plan to specify LLVM?

I think it will be a setting ultimately. Not really sure how this will all pan out, happy to change things around, as it might be easier if I have some concrete changes to talk around.

As an update, I've checked in where I am #247, its not tidied up, and just reflects my attempts to understand where changes are needed. I'm running the build from here with

build nativeaot -rc Debug -lc Release -a wasm -os browser -platform llvm

I have it to the point where things compile but dont run as I'm not understanding how RhRegisterOSModule was defined in CoreRT. I presume it came from UnixNativeCodeManager.cpp but that doesn't make sense as that file was only included for the CMake variable FULL_RUNTIME_SOURCES which I don't think was included for Wasm:

https://github.com/dotnet/corert/blob/0d45438de099e08f140ff4a487d1daeced683873/src/Native/Runtime/CMakeLists.txt#L284-L286

@jkotas
Copy link
Member

jkotas commented Oct 26, 2020

RhRegisterOSModule

You may need to revert a bit of 7ef548e#diff-25943ca2038c811a65a8e53d31c55123b061438c0694e31f2b4d6b970df991fa for wasm. wasm may be depending on cppcodegen paths here and there.

@yowl
Copy link
Contributor Author

yowl commented Oct 31, 2020

Ok, thanks, I've got something for RhRegisterOSModule.

Next:

In Microsoft.NET.Sdk.IL.targets there is

  <PropertyGroup>
    <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('windows'))">win</_OSPlatform>
    <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux'))">linux</_OSPlatform>

I've got $([MSBuild]::IsOSPlatform('linux')) == true. So this target is causing me a problem as it looks for the wrong ildasm. IsOSPlatform is meant to be the running OS, not the target I believe. I guess somehow I made msbuild bring in the wrong System.Runtime.InteropServices?

Build log at failure point is:

   307>UpdateRefToNonSupportedAssembly:
       Skipping target "UpdateRefToNonSupportedAssembly" because it has no outputs.
       _BatchGenerateResxSource:
       Skipping target "_BatchGenerateResxSource" because it has no outputs.
       _WriteNonStringAssemblyInfoAttributes:
       Skipping target "_WriteNonStringAssemblyInfoAttributes" because it has no outputs.
       _WriteNonStringAssemblyInfoAttributes:
       Skipping target "_WriteNonStringAssemblyInfoAttributes" because it has no outputs.
   298>Done Building Project "E:\GitHub\runtimelab\src\libraries\System.Dynamic.Runtime\src\System.Dynamic.Runtime.csproj" (default targets).
   307>DisassembleIlasmResourceFile:
         C:\Users\ScottWaye\.nuget\packages\\runtime.linux-x64.microsoft.netcore.ildasm\5.0.0-preview.8.20359.4\runtimes\linux-x64\native/ildasm "E:\GitHub\runtimelab\artifacts\bin\System.Runtime.CompilerServices.Unsafe\ref\netstandard2.0-Debug\System.Runtime.CompilerServices.Unsafe.dll" /OUT="E:\GitHub\runtimelab\artifacts\obj\System.Runtime.CompilerServices.Unsafe\netstandard2.0-Debug\/System.Runtime.CompilerServices.Unsafe.ref.il"
DEBUG:   94+     while ( >>>> -not $process.WaitForExit(100)) {
   289>Done Building Project "E:\GitHub\runtimelab\src\libraries\System.Diagnostics.FileVersionInfo\src\System.Diagnostics.FileVersionInfo.csproj" (default targets).
   307>DisassembleIlasmResourceFile:
         'C:\Users\ScottWaye\.nuget\packages\\runtime.linux-x64.microsoft.netcore.ildasm\5.0.0-preview.8.20359.4\runtimes\linux-x64\native/ildasm' is not recognized as an internal or external command,
         operable program or batch file.

@jkotas
Copy link
Member

jkotas commented Oct 31, 2020

IsOSPlatform is meant to be the running OS

Yes, that's correct. I suspect that the problem is with MicrosoftNetCoreIlasmPackageRuntimeId. It may be set earlier to a wrong value here: https://github.com/dotnet/runtime/blob/838fde64bea10010f7d6f52bdb16933d7f6a127c/src/libraries/Directory.Build.props#L134

(Also, I have pushed updated feature/Native into feature/NativeAOT-LLVM to make it easier to look at the diff in github UI.)

@yowl
Copy link
Contributor Author

yowl commented Nov 2, 2020

Thanks, yes that looks like it was the problem. As usual I've got a bit further and have another question. I have this error

   459>E:\GitHub\runtimelab\src\libraries\shims\manual\System.forwards.cs(8,88): error CS0234: The type or namespace name 'ZLibException' does not exist in the namespace 'System.IO.Compression' (are you missing an assembly reference?) [E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj]

   459>E:\GitHub\runtimelab\src\libraries\shims\manual\System.forwards.cs(9,77): error CS0234: The type or namespace name 'CookieVariant' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj]

   459>E:\GitHub\runtimelab\src\libraries\shims\manual\System.forwards.cs(10,77): error CS0234: The type or namespace name 'PathList' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj]

   459>Done Building Project "E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj" (Build target(s)) -- FAILED.

Taking the first one for System.IO.Compression I think this is because this dll is not getting built nor referenced and I think that is because it is a little different to the majority of libraries in that it has:

  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>

Whereas others, e.g. System.IO.csproj are

  <PropertyGroup>
    <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
    <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>

I think therefore that the TargetFramework is not getting set, so I tried with specifying it on the command line -framework net6.0-Browser . I've put a capital B to match the csproj, but that looks futile because it is lower cased:

"framework" { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
. If I remove the ToLowerInvariant() then it does look different, in that I get a System.IO.Compression.dll built, however maybe not in the right place. The failure above is when building System.dll and the references are, to a couple picked at random

/reference:E:\GitHub\runtimelab\artifacts\bin\runtime\net6.0-browser-Debug-wasm\System.ComponentModel.EventBasedAsync.dll /reference:E:\GitHub\runtimelab\artifacts\bin\runtime\net6.0-browser-Debug-wasm\System.ComponentModel.Primitives.dll

However System.IO.Compression.dll is in runtimelab\artifacts\bin\System.IO.Compression\net6.0-Browser-Debug, not in the runtime folder. Am I going in the wrong direction with this?

@jkotas
Copy link
Member

jkotas commented Nov 2, 2020

I do not see anything obvious why this may be going wrong. Looks like another unexpected iteraction of msbuild properties.

@yowl
Copy link
Contributor Author

yowl commented Nov 2, 2020

Is this a typo: (ie. missing a "P")
image

@jkotas
Copy link
Member

jkotas commented Nov 2, 2020

Yes: dotnet/arcade#6506

@yowl
Copy link
Contributor Author

yowl commented Nov 14, 2020

I feel like I'm making heavy weather of this, but anyway. I'm currently trying to build with

build nativeaot+libs -rc Debug -lc Debug -a wasm -os browser -framework net6.0-Browser -runtimeFlavor CoreCLR

And I'm getting a problem with netstandard.dll

   458>DEBUG:   94+     while ( >>>> -not $process.WaitForExit(100)) {

C:\Users\ScottWaye\.nuget\packages\microsoft.dotnet.genfacades\5.0.0-beta.20506.7\build\Microsoft.DotNet.GenPartialFacadeSource.targets(30,5): error : Could not find file 'E:\GitHub\runtimelab\artifacts\bin\runtime\net6.0-browser-Debug-wasm\netstandard.dll'. [E:\GitHub\runtimelab\src\libraries\shims\manual\mscorlib.csproj]

   458>Done Building Project "E:\GitHub\runtimelab\src\libraries\shims\manual\mscorlib.csproj" (Build target(s)) -- FAILED.

   458>Done Building Project "E:\GitHub\runtimelab\src\libraries\shims\manual\mscorlib.csproj" (Build target(s)) -- FAILED.

and

   459>C:\Users\ScottWaye\.nuget\packages\microsoft.dotnet.genfacades\5.0.0-beta.20506.7\build\Microsoft.DotNet.GenPartialFacadeSource.targets(30,5): error : Could not find file 'E:\GitHub\runtimelab\artifacts\bin\runtime\net6.0-browser-Debug-wasm\netstandard.dll'. [E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj]

   459>Done Building Project "E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj" (Build target(s)) -- FAILED.

   459>Done Building Project "E:\GitHub\runtimelab\src\libraries\shims\manual\System.csproj" (Build target(s)) -- FAILED.

Should I even be attempting to build these shims? If so I'll need to see why the netstandard.dll has not been built.

{Edit). Maybe I just need to set the forwarding rules up somewhere so that this browser target works like CoreCLR for netstandard.dll, but shouldn't the runtimeFlavor command line option do that?

@jkotas
Copy link
Member

jkotas commented Nov 14, 2020

Yes, these shims should be building in the wasm build. They are needed for .NET Standard compatibility. Not strictly required for hello world. They are needed to run more interesting apps. You can try disable building them, but I think you will likely hit the underlying problem causing the build break in other places too.

Yes, runtimeFlavor command line option is meant for that. The logic of this command line option may have a bug somewhere.

Does this error reproduce with the current state of #247 ?

@yowl
Copy link
Contributor Author

yowl commented Nov 14, 2020

Yes, the current state should repro this. I did fix a few other things today that were failing, but they haven't fixed this issue.

@jkotas
Copy link
Member

jkotas commented Nov 15, 2020

Try omitting -framework net6.0-Browser on the build command line.

The Mono wasm build instructions don't have it and it is what's causing the netstandard.dll to be missing.

@yowl
Copy link
Contributor Author

yowl commented Nov 15, 2020

@jkotas Thanks!
Getting closer:

E:\GitHub\runtimelab>e:\github\emsdk\node\12.18.1_64bit\bin\node "E:\GitHub\runtimelab\artifacts\bin\repro\x64\Debug\repro.js"
Calling stub instead of signal()
Hello world

Need to:

  • Get the tooling to do the wasm compilation and linking as I'm doing that manually
  • Tidy up and remove what stuff I've put in stumbling around that isn't necessary
  • Investigate what is special about System.IO.Compression.dll and System.Net.Primitives.dll

@yowl
Copy link
Contributor Author

yowl commented Nov 15, 2020

I'm trying to get

dotnet publish --packages pkg -r browser-wasm -c Debug /p:Platform=wasm

to work for samples\HelloWorld, but it fails with

C:\Program Files\dotnet\sdk\5.0.100\MSBuild.dll -bl -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\5.0.100\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\5.0.100\dotnet.dll -maxcpucount -property:RestorePackagesPath=E:\GitHub\runtimelab\samples\HelloWorld\pkg -property:RuntimeIdentifier=browser-wasm -property:Configuration=Debug /p:Platform=wasm -restore -target:Publish -verbosity:m .\HelloWorld.csproj
  Determining projects to restore...
  All projects are up-to-date for restore.
  HelloWorld -> E:\GitHub\runtimelab\samples\HelloWorld\bin\wasm\Debug\net5.0\browser-wasm\HelloWorld.dll
E:\GitHub\runtimelab\samples\HelloWorld\pkg\microsoft.dotnet.ilcompiler\6.0.0-dev\build\Microsoft.NETCore.Native.Publish.targets(61,5): error : The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative [E:\GitHub\runtimelab\samples\HelloWorld\HelloWorld.csproj]

As though it hasn't brought in Microsoft.NETCore.Native.targets . That should happen with

<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="6.0.0-*" />

I suppose? I never got this bit working in CoreRT either, I used to set IlcPath on the command line.

@jkotas
Copy link
Member

jkotas commented Nov 15, 2020

I think that it is a general problem with missing cross-compilation support in Microsoft.NETCore.Native.targets .

@yowl
Copy link
Contributor Author

yowl commented Nov 16, 2020

I think part of the problem is

<RuntimePackage Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)' == '$(RuntimeIlcPackageName)'" />

If I add some debug here

    <Message Text="%(RuntimePackage.ResolvedPath) PackageDefinitions @(PackageDefinitions) PackageDefinitions.Name %(PackageDefinitions.Name) RuntimeIlcPackageName $(RuntimeIlcPackageName)"/>

I get

Message:  PackageDefinitions runtime.browser-wasm.Microsoft.DotNet.ILCompiler/6.0.0-dev PackageDefinitions.Name runtime.browser-wasm.Microsoft.DotNet.ILCompiler RuntimeIlcPackageName runtime.browser-wasm-AnyCPU.Microsoft.DotNet.ILCompiler

So the condition fails as AnyCPU is inserted into the RuntimeIlcPackageName and then does not equal PackageDefinitions.Name For Wasm I suppose that could be used to differentiate between wasm32 and wasm64, if it was appropriate here. We don't have any wasm64 support right now though.

Should I just drop from

<PortableRuntimeIdentifier>$(PortableRuntimeIdentifier)-$(PlatformTarget)</PortableRuntimeIdentifier>
the -$(PlatformTarget) for wasm or is that going to create different problems?

@yowl
Copy link
Contributor Author

yowl commented Nov 16, 2020

I think that it is a general problem with missing cross-compilation support in Microsoft.NETCore.Native.targets .

To move forward with cross-compilation, at least for wasm, do you see files like Microsoft.NETCore.Native.Unix.props with the part Unix as referring to the host or the target? Or in other words, this switch

<Import Project="$(MSBuildThisFileDirectory)Microsoft.NETCore.Native.Windows.props" Condition="'$(TargetOS)' == 'Windows_NT'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NETCore.Native.Unix.props" Condition="'$(TargetOS)' != 'Windows_NT'" />
, would it be better on $(OS) ?

@jkotas
Copy link
Member

jkotas commented Nov 16, 2020

Do you see any host-specific logic inside Microsoft.NETCore.Native.Unix.props ?

I think most (if not all) logic inside Microsoft.NETCore.Native.Unix.props is target-specific. I think this condition is right.

@yowl
Copy link
Contributor Author

yowl commented Nov 16, 2020

<Exec Command="command -v $(CppLinker)" IgnoreExitCode="true">

is the one that made me ask. command is a Unix command that does not exist on Windows.

@jkotas
Copy link
Member

jkotas commented Nov 16, 2020

Good catch - this specific piece of logic should be under host OS condition

@yowl
Copy link
Contributor Author

yowl commented Nov 16, 2020

Current state will dotnet publish successfully for the repro project. There is one problem with a straight through flow and that is https://github.com/yowl/runtimelab/blob/llvm-rename/wasm-copy.cmd for some reason these 2 dlls don't get copied so I'll check that next.

@yowl
Copy link
Contributor Author

yowl commented Nov 18, 2020

Is there an effort to drop nmake and use ninja in its place?

@jkotas
Copy link
Member

jkotas commented Nov 18, 2020

We have an effort to replace msbuild with ninja on Windows: dotnet/runtime#44761 . You can ask about any plans for Unix in that issue.

@yowl
Copy link
Contributor Author

yowl commented Nov 20, 2020

thanks, Do you know if there were some changes to how _SuppressSdkImports works? Im getting

    3>C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error : Expected "!$(_SuppressSdkImports)" to evaluate to a boolean instead of "!", in condition "!$(_SuppressSdkImports) and !$(_SuppressAllTargets)".  C:\Users\ScottWaye\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.20552.5\Sdk\Sdk.targets [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1,T2,T3](Boolean condition, String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1, T3 arg2) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.AndExpressionNode.BoolEvaluate(IConditionEvaluationState state) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.GenericExpressionNode.Evaluate(IConditionEvaluationState state) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.ConditionEvaluator.EvaluateConditionCollectingConditionedProperties[P,I](String condition, ParserOptions options, Expander`2 expander, ExpanderOptions expanderOptions, Dictionary`2 conditionedPropertiesTable, String evaluationDirectory, ElementLocation elementLocation, ILoggingService loggingServices, BuildEventContext buildEventContext, IFileSystem fileSystem, ProjectRootElementCacheBase projectRootElementCache) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateConditionCollectingConditionedProperties(ProjectElement element, String condition, ExpanderOptions expanderOptions, ParserOptions parserOptions, ProjectRootElementCacheBase projectRootElementCache) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) [E:\GitHub\runtimelab\Build.proj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) [E:\GitHub\runtimelab\Build.proj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) [E:\GitHub\runtimelab\Build.proj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) [E:\GitHub\runtimelab\Build.proj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) [E:\GitHub\runtimelab\Build.proj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Evaluation.Project.FromFile(String file, ProjectOptions options) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Build.Tasks.Console.MSBuildStaticGraphRestore.<>c__DisplayClass37_1.<LoadProjects>b__0(String path, Dictionary`2 properties, ProjectCollection collection) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.GraphBuilder.ParseProject(ConfigurationMetadata configurationMetadata) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.GraphBuilder.<>c__DisplayClass35_0.<SubmitProjectForParsing>b__0() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) [E:\GitHub\runtimelab\Build.proj]

C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at System.Lazy`1.CreateValue() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at System.Lazy`1.get_Value() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.ParallelWorkSet`2.ExecuteWorkItem() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.ParallelWorkSet`2.WaitForAllWorkAndComplete() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.GraphBuilder.FindGraphNodes() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.GraphBuilder.BuildGraph() [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.ProjectGraph..ctor(IEnumerable`1 entryPoints, ProjectCollection projectCollection, ProjectInstanceFactoryFunc projectInstanceFactory, Int32 degreeOfParallelism, CancellationToken cancellationToken) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at Microsoft.Build.Graph.ProjectGraph..ctor(IEnumerable`1 entryPoints, ProjectCollection projectCollection, ProjectInstanceFactoryFunc projectInstanceFactory) [E:\GitHub\runtimelab\Build.proj]
C:\Program Files\dotnet\sdk\5.0.100\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Build.Tasks.Console.MSBuildStaticGraphRestore.LoadProjects(IEnumerable`1 entryProjects) [E:\GitHub\runtimelab\Build.proj]
     3>Done Building Project "E:\GitHub\runtimelab\Build.proj" (Restore target(s)) -- FAILED.
     1>Done Building Project "C:\Users\ScottWaye\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.20552.5\tools\Build.proj" (default targets) -- FAILED.

Deferred Messages

even though in the properties it looks like it is set:

image

@jkotas
Copy link
Member

jkotas commented Nov 20, 2020

I am not aware of any changes for _SuppressSdkImports specifically.

I believe that this stack trace is from the new optimized package restore feature in msbuild/NuGet. I know that msbuild projects needed adjustments here and there to work well with it.

@yowl
Copy link
Contributor Author

yowl commented Nov 21, 2020

I'm just cleaning things up now. https://github.com/dotnet/runtimelab/pull/247/files is currently showing 1631 files changes, probably because I've merged locally from bb9fe2f (16/11/2020 ). Shall I just do another PR into dotnet:feature/NativeAOT-LLVM from NativeAOT to get it up to date?

@jkotas
Copy link
Member

jkotas commented Nov 21, 2020

I have just pushed feature/NativeAOT into feature/NativeAOT-LLVM for you since the branches have not diverged yet.

Could you please undo the .wasm.cs files deletions from #331 in your PR?

@yowl
Copy link
Contributor Author

yowl commented Nov 21, 2020

Thanks, that's much better. Down to 67 files, which I'm checking.

@yowl
Copy link
Contributor Author

yowl commented Nov 24, 2020

How does nativeaot build the gc (libclrgc) when

<DefaultNativeAotSubsets>clr.jit+nativeaot.tools+nativeaot.libs</DefaultNativeAotSubsets>
does not include clr.runtime ?

In

<_CoreClrBuildArg Condition="'$(ClrRuntimeSubset)' != 'true'" Include="-skipruntime" />
it seems to exclude the gc unless this is set.

@jkotas
Copy link
Member

jkotas commented Nov 24, 2020

@yowl
Copy link
Contributor Author

yowl commented Nov 24, 2020

I see, part of the runtime library itself, not separate. Thanks

@yowl
Copy link
Contributor Author

yowl commented Dec 15, 2020

closing, as this turned into help to getting the build working just for wasm. For building LLVM to target other platforms a new issue would be better as less noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants