sdk-container-builds icon indicating copy to clipboard operation
sdk-container-builds copied to clipboard

Multi-RID publishing of an app that references a blazorwasm client app has exposes race conditions in client app build

Open baronfel opened this issue 9 months ago • 2 comments

Context: https://github.com/Webreaper/SolisAgileManager/pull/135#discussion_r1986383638

A blazorwebassembly client project referenced from a project that participates in multi-RID publishing will be called multiple times in parallel. This results in a lot of rebuilding on the client project's side because it's passed the RuntimeIdentifier property when it is built because of the parent project.

This rebuilding wouldn't ordinarily be a problem, except that blazorwasm projects don't make use of the RID to namespace their file outputs. This means that the blazorwasm targets may manipulate the same logical files concurrently, which presents as file access problems to users.

Users can partially workaround this by adding GlobalPropertiesToRemove on the ProjectReference to the blazorwasm project, but most users won't know how to do this. The blazorwasm targets themselves should throwaway the RID in some way.

Separately, many webassembly/blazorwasm targets do not track inputs/outputs well, which would also address parts of the race conditions here (by not re-running targets whose inputs and outputs are up to date). Both of these fixes should be implemented to improve perf for end users and to reduce flaky builds.

baronfel avatar Mar 10 '25 15:03 baronfel