dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.15k stars 4.71k forks source link

Cannot build Browser WASM on Windows #36180

Closed kant2002 closed 3 years ago

kant2002 commented 4 years ago

I attempt to take a look at what's happens in browser-wasm world using

build.cmd -os browser -arch wasm

But build failed with following errors

  1 of 2 projects are up-to-date for restore.
  Determining projects to restore...
  Restored D:\d\kant\GitHub\dotnet\runtime\src\installer\pkg\projects\netcoreapp\pkg\Microsoft.NETCore.App.Host.pkgproj (in 45 ms).
  Determining projects to restore...
  Restored D:\d\kant\GitHub\dotnet\runtime\src\installer\pkg\projects\netcoreapp\pkg\Microsoft.NETCore.App.Ref.pkgproj (in 116 ms).
  1 of 2 projects are up-to-date for restore.
  Determining projects to restore...
  Restored D:\d\kant\GitHub\dotnet\runtime\src\installer\pkg\projects\netcoreapp\pkg\Microsoft.NETCore.App.Runtime.pkgproj (in 80 ms).
  1 of 2 projects are up-to-date for restore.
  Determining projects to restore...
  Restored D:\d\kant\GitHub\dotnet\runtime\src\installer\pkg\projects\netcoreapp\pkg\workaround\Microsoft.NETCore.App.pkgproj (in 283 ms).
  Determining projects to restore...
  Restored D:\d\kant\GitHub\dotnet\runtime\src\libraries\restore\runtime\runtime.depproj (in 431 ms).
  461 of 462 projects are up-to-date for restore.
  llvm-init ->
  --- Building Mono ---
  Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.

  MSBUILD : error MSB1008: Only one project can be specified.
  Switch: D:\d\kant\GitHub\dotnet\runtime\src\mono\msvc\mono.sln

  For switch syntax, type "MSBuild -help"
D:\d\kant\GitHub\dotnet\runtime\src\mono\mono.proj(785,5): error MSB3073: The command "msvc\run-msbuild.bat build  Debug sgen "/p:MONO_BUILD_DIR_PREFIX=""D:\d\kant\GitHub\dotnet\runtime\artifacts\obj\mono/browser.wasm.Debug/"" /p:MONO_ENABLE_NETCORE=true /p:MONO_USE_STATIC_C_RUNTIME=true /p:CL_MPCount=8 /v:minimal" msvc\mono-netcore.sln" exited with code 1.
  System.Private.CoreLib -> D:\d\kant\GitHub\dotnet\runtime\artifacts\bin\mono\browser.wasm.Debug\IL\System.Private.CoreLib.dll
  D:\d\kant\GitHub\dotnet\runtime\src\libraries\Native/build-native.sh wasm Debug outconfig net5.0-browser-Debug-wasm -os browser
D:\d\kant\GitHub\dotnet\runtime\src\libraries\Native\build-native.proj(36,5): error MSB3073: The command ""D:\d\kant\GitHub\dotnet\runtime\src\libraries\Native/build-native.sh" wasm Debug outconfig net5.0-browser-Debug-wasm -os browser " exited with code 1.
  Microsoft.Extensions.Primitives -> D:\d\kant\GitHub\dotnet\runtime\artifacts\bin\Microsoft.Extensions.Primitives\ref\netstandard2.0-Debug\Microsoft.Extensions.Primitives.dll
  Microsoft.Extensions.Configuration.Abstractions -> D:\d\kant\GitHub\dotnet\runtime\artifacts\bin\Microsoft.Extensions.Configuration.Abstractions\ref\netstandard2.0-Debug\Microsoft.Extensions.Configuration.Abstractions.dll
  Microsoft.Extensions.Caching.Abstractions -> D:\d\kant\GitHub\dotnet\runtime\artifacts\bin\Microsoft.Extensions.Caching.Abstractions\ref\netstandard2.0-Debug\Microsoft.Extensions.Caching.Abstractions.dll
  Microsoft.Extensions.DependencyInjection.Abstractions -> D:\d\kant\GitHub\dotnet\runtime\artifacts\bin\Microsoft.Extensions.DependencyInjection.Abstractions\ref\netstandard2.0-Debug\Microsoft.Extensions.DependencyInjection.Abstractions.dll

Anything important that I can miss ?

ghost commented 4 years ago

Tagging subscribers to this area: @safern, @viktorhofer Notify danmosemsft if you want to be subscribed.

safern commented 4 years ago

@vargaz can you help here?

ghost commented 4 years ago

Tagging subscribers to this area: @directhex Notify danmosemsft if you want to be subscribed.

marek-safar commented 4 years ago

/cc @akoeplinger @lewing

akoeplinger commented 4 years ago

You can only build this on Linux/Mac at the moment.

kant2002 commented 4 years ago

@akoeplinger

  1. Does there any plans to make it work on Window? If it is work in progress, I can just wait it out, or live on bleeding edge.
  2. Where discussions about this subject happens? Does it everything under arch-wasm label, or there other places?

I just trying to understand how far I'm stretching tooling with that request.

kant2002 commented 4 years ago

Oops, looks like I post request in wrong repo. I was asked by @jkotas to post in SDK repo, and create it here and there - https://github.com/dotnet/sdk/issues/11608

akoeplinger commented 4 years ago

@kant2002 note that browser-wasm means using Mono, not CoreRT.

If you want to build the current state I'd recommend either using a Linux VM or using WSL2 on Windows.

marek-safar commented 4 years ago

Does there any plans to make it work on Window?

Yes but no immediate plans. Any contributions to make wasm building natively on Windows are welcomed.

Where discussions about this subject happens

It depends on what kind of discussion you have in mind. Most of the project or issues related problems are discussed in this repo. Any broader design discussion happen at https://github.com/dotnet/designs

kant2002 commented 4 years ago

My plans approximately following.

  1. Explore current state of browser-wasm to get idea how it is applicable to CoreRT.
  2. As such I will try to build on WSL since this is looks like supported scenario. If issues arise I can try to fix them.
  3. If CoreRT + Browser-WASM will work as I expected I can
  4. Try to make it work on Windows only then I have at least some understanding of current limitations.

I would like to better understand what's current limitations on the browser-wasm platform in terms of where it is intend to run, how build of application happens etc. Otherwise I likely will ask questions which can be not asked in the first place.

I read https://github.com/dotnet/runtime/issues/33328 and https://github.com/dotnet/runtime/issues/33327 but I did not found answers, how for example browser-wasm will be packaged. I maybe miss something, but that's also point of asking this question.

Good to know that building WASM on Windows is at least planned, so I will try to make it work for me eventually.

marek-safar commented 4 years ago

I would like to better understand what's current limitations on the browser-wasm platform in terms of where it is intend to run

The limitation are only the constraints of the wasm environment sandbox. The intention for this target is to run inside the browser.

how for example browser-wasm will be packaged

It's already packaged out of this repo and it's available as runtime pack Microsoft.NETCore.App.Runtime.browser-wasm on net5 nuget feed: https://dnceng.visualstudio.com/public/_packaging?_a=package&feed=dotnet5&package=Microsoft.NETCore.App.Runtime.browser-wasm&protocolType=NuGet&version=5.0.0-preview.6.20262.14

lambdageek commented 3 years ago

I believe this works now, right @pavelsavara ?

lewing commented 3 years ago

yes, if there still failures please reopen