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

[wasm][build] Don't use GetTempFileName; emit webcil to subdir of obj #86972

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented May 31, 2023

Instead of using GetTempFileName (which can run out of temp file names on Windows after 64K files, see #73793), emit the temporary webcil files to a directory in IntermediateOutputPath before copying them to the final location, if they changed (which is elsewhere in IntermediateOutputPath).

An example of the failure with the old implementation:

Error MSB4018     The "ConvertDllsToWebCil" task failed unexpectedly.
System.IO.IOException: The file exists.
 
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
   at Microsoft.NET.Sdk.WebAssembly.ConvertDllsToWebCil.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() Wasm.Prerendered.Client C:\Users\jacalvar\.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-preview.5.23276.2\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets      221   

See dotnet#73793

Instead of using GetTempFileName (which can run out of temp file names
on Windows after 64K files), emit the temporary webcil files to a
directory in IntermediateOutputPath before copying them to the final
location, if they changed (which is elsewhere in
IntermediateOutputPath).
@ghost ghost assigned lambdageek May 31, 2023
@lambdageek lambdageek added the arch-wasm WebAssembly architecture label May 31, 2023
@lambdageek lambdageek marked this pull request as ready for review May 31, 2023 20:08
@lambdageek lambdageek requested review from lewing and radical as code owners May 31, 2023 20:08
@ghost
Copy link

ghost commented May 31, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Instead of using GetTempFileName (which can run out of temp file names on Windows after 64K files, see #73793), emit the temporary webcil files to a directory in IntermediateOutputPath before copying them to the final location, if they changed (which is elsewhere in IntermediateOutputPath).

Author: lambdageek
Assignees: lambdageek
Labels:

arch-wasm, area-Build-mono

Milestone: -

@lambdageek lambdageek requested a review from maraf May 31, 2023 20:08
@lambdageek
Copy link
Member Author

/cc @javiercn

@danmoseley
Copy link
Member

which can run out of temp file names on Windows after 64K files, see #73793

The above issue was fixed. It can't run out any more.

@lewing
Copy link
Member

lewing commented May 31, 2023

which can run out of temp file names on Windows after 64K files, see #73793

The above issue was fixed. It can't run out any more.

This runs in application publish and msbuild tasks use framework when run from VS. It worked fine from the cli

@lewing
Copy link
Member

lewing commented Jun 1, 2023

wbt failures are known. not sure why they aren't getting tagged by build analysis

@lewing lewing merged commit a4dd36d into dotnet:main Jun 1, 2023
lambdageek pushed a commit that referenced this pull request Jun 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants