Closed dougbu closed 3 years ago
As a side note
will never match real files on Linux systems because "Release" is always capitalized. That <ItemGroup>
may however just be redundant given
Bug causing the current low-level error (which should at least mention building with node
when in our repo) is unconditional nature of setting at https://github.com/dotnet/aspnetcore/blob/70a880f30cd1537ff3777f51efe18469c8da68db/src/Components/Directory.Build.targets#L3
That line is fine in most local builds (whether building w/ node
or not) because those default to Debug
builds. Problem is visible in local builds with -configuration Release
and --no-build-nodejs
(or -noBuildNodeJS
on Windows) after cleaning the repo e.g.
git clean -dfx -e .vs/ -e .vscode/ -e .dotnet/ -e .tools/
.\build.cmd -configuration Release -noBuildNodeJS
On machines lacking node
, -noBuildNodeJS
or --no-build-nodejs
isn't needed to see the problem.
The warning without node
installed or with its use disabled mentions "Building NodeJS is disabled so the managed projects will fallback to using the output from previous builds." but that's irrelevant when there is no "previous build" done with node
. This should probably be fixed as well.
In the Directory.Build.targets
above, can we do something like:
<BlazorWebAssemblyJSPath>$(RepoRoot)src\Components\Web.JS\dist\$(Configuration)\blazor.webassembly.js</BlazorWebAssemblyJSPath>
<BlazorWebAssemblyJSPath Condition="!Exists(BlazorWebAssemblyJSPath)">$(RepoRoot)src\Components\Web.JS\dist\Debug\blazor.webassembly.js</BlazorWebAssemblyJSPath>
to fallback to the Debug
version in the event the Release version is not available?
fallback to the
Debug
version
Yeah, that's my second option in the original description. I can handle the fix if that's the direction you want to go. Should the build emit warnings when it does this❔
And, what about the redundant bit mentioned in https://github.com/dotnet/aspnetcore/issues/29944#issuecomment-774340127❔
After some offline discussion, we're going with the "fail fast" option because there is no checked-in blazor.webassembly.js file anymore. Specifically, I'll add an <Error>
if Microsoft.AspNetCore.Components.WebAssembly.csproj is packed and a <Warning>
if any $(UsingMicrosoftNETSdkBlazorWebAssembly)
(test) project is built when the file doesn't exist.
I'll also change the Microsoft.AspNetCore.Web.JS.npmproj project to use $(Configuration)
instead of release
because that's what dependant projects consume.
@mkArtakMSFT assigned dougbu 1 hour ago
😀
5923818afcb8
I accidentally hit this in #21487. See https://dev.azure.com/dnceng/public/_build/results?buildId=974989 for example. The following errors occur in that build
The problem is the test assets projects attempt to use the Release version of blazor.webassembly.js which (because of
-no-build-nodejs
) doesn't exist. Options includeThoughts @dotnet/aspnet-blazor-eng❔