dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.66k stars 1.06k forks source link

[NETSDKE2E]Publishing blazorwasm project failed with AOT compilation = true after upgrading to .NET 6.0.318(Oct update) #35645

Open vdanche opened 12 months ago

vdanche commented 12 months ago

Repro steps:

1.On a clean OS: Install SDK 6.0.317 on windows from offical website dotnet new console -o myconsole dotnet build and dotnet run

  1. Install SDK 6.0.318 Pipelines - Run 20230919.1-6.0.415-servicing.23469.11,6.0.318-servicing.23469.12,6.0.123-servicing.23469.13-193342,193357,193358 artifacts

  2. dotnet build and dotnet run the project created in step1

  3. Install wasm-tools dotnet workload install wasm-tools --skip-manifest-update

  4. New blazorWasm dotnet new blazorwasm -o myblazorwasm add below code to csproj file to use AOT compilation <RunAOTCompilation>true</RunAOTCompilation>

  5. dotnet publish

Expected Result: publish successfully

Actual Result: Publish failed

image

EXEC : error : UNKNOWN: unknown error, open 'C:\Users\v-danche\AppData\Local\Temp\tmpeaju9ghr.js' [C:\Users\v-danche\my wasm\mywasm.csproj] at Object.openSync (fs.js:476:3) at Object.readFileSync (fs.js:377:35) at read (C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.win-x64\6.0.4\tools\emscripten \tools\acorn-optimizer.js:16:13) at Object. (C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.win-x64\6.0.4\to ols\emscripten\tools\acorn-optimizer.js:1818:13) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { errno: -4094, syscall: 'open', code: 'UNKNOWN', path: 'C:\Users\v-danche\AppData\Local\Temp\tmpeaju9ghr.js' } emcc : error : '"C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64\6.0.4\tools\bin\nod e.exe" "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.win-x64\6.0.4\tools\emscripten\tools\ acorn-optimizer.js" C:\Users\v-danche\AppData\Local\Temp\tmpeaju9ghr.js applyImportAndExportNameChanges minifyWhitespac e' failed (returned 1) [C:\Users\v-danche\mywasm\mywasm.csproj] C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.4\Sdk\WasmApp.Native.targets(379,5): error MSB3 073: The command "emcc "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\6.0.4\runtimes\b rowser-wasm\native\src\emcc-default.rsp" "@C:\Users\v-danche\mywasm\obj\Debug\net6.0\wasm\for-publish\emcc-link.rsp"" e xited with code 1. [C:\Users\v-danche\mywasm\mywasm.csproj]

Note: the file C:\Users\v-danche\AppData\Local\Temp\tmpeaju9ghr.js can not be found.

dotnet --info: .NET SDK (reflecting any global.json): Version: 6.0.318 Commit: 3b8fbbea7f

Runtime Environment: OS Name: Windows OS Version: 10.0.25398 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.318\

global.json file: Not found

Host: Version: 6.0.23 Architecture: x64 Commit: ca8b53290a

.NET SDKs installed: 6.0.318 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Download .NET: https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info

dotnet-issue-labeler[bot] commented 12 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

vdanche commented 12 months ago

Not repro on Fresh install(6.0.318) image

marcpopMSFT commented 12 months ago

@lewing @steveisok

lewing commented 12 months ago

So a fresh install of 6.0.318 works, but it did not work when 6.0.317 was previously installed without workloads, then 6.0.18 was installed and the workload was installed?

lewing commented 12 months ago

Are you able recreate the problem from scratch using specific steps?

joeloff commented 12 months ago

I tried this on a sandbox with the 6.0.317-->6.0.318 upgrade and it worked fine for me

vdanche commented 12 months ago

@lewing @joeloff today we tried again with upgrade stall(6.0.317 to 6.0.318) in a clean OS, a threat found prompt display after publish failed, is it expected? after allowing it and dotnet publish again, it will succeed. image

image

Note: publish successfully in fresh install without threat found prompt displaying

FYI @richaverma1

vdanche commented 11 months ago

today we also meet it on 6.0.416 SDK

lewing commented 11 months ago

if you keep passing --skip-manifest-update and the 6.0.3xx and 6.0.4xx sdk does not update the baselines yes it will still be there. If you drop --skip-manifest-update it should install the correct runtime and there should be no problem cc @marcpopMSFT

marcpopMSFT commented 11 months ago

Per offline conversation, we're going to update the baseline manifest for 3xx and 4xx in a future servicing release: https://github.com/dotnet/installer/pull/17601 https://github.com/dotnet/installer/pull/17600

vdanche commented 6 months ago

This issue still repro on 6.0.420 SDK