-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Fix source build when using --no-build-js
#59118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need --no-build-nodejs
for source build, isn't that the case?
Can we not instead update the check so that in that situation just disable the check that triggers the error when we are running inside source build?
Source build doesn't run any code, it just builds it, and the JS assets are not needed for the build step.
Yeah, that sounds good. I'll update this PR to disable the check if not building with NodeJS. Eventually I think we'll want to change |
1a85202
to
96ec852
Compare
blazor.webview.js
check when not building NodeJS
96ec852
to
bb889c5
Compare
bb889c5
to
0ea2f25
Compare
blazor.webview.js
check when not building NodeJS--no-build-js
@MackinnonBuck do you think instead we could do something like #59135 to avoid checking-in the |
I disagree, it's also useful for local builds. By default, if node isn't installed, the build will function as if |
If we want this to work more than just the build passing when
|
We can make the build not fail, but if you don't have nodejs installed it's impossible to produce a correct set of outputs if they aren't somehow pre-generated. The only reason why that worked in the past is because the JS files were checked-in, which we aren't going to go back to. We can choose to skip building the webview project if that's what we have to do here. |
If it's possible to avoid the node dependency in the product build, that would definitely be preferred from a product construction POV. AspNetCore is the only repository that needs the node dependency when building the .NET SDK product. |
With the changes that we recently made, nodejs is not required anymore to build the SDK. The However, I want to be very clear that our E2E require JavaScript and that there's no way the product can be successfully built without it. This is the exact same situation as it is for The only reason this worked in the past was because we manually checked-in the JS asset outputs from the compilation on every release, which is something we are explicitly trying to avoid as it has security implications and causes immense problems for any dev working on the codebase. |
Repo boundaries don't matter when we think about the VMR which builds aspnetcore as one of 30 different repositories. If one repository needs node to build all the expected outputs (including OOB nuget packages) then it's a required dependency. Sounds like node continues to be a design time component in the aspnetcore repo and therefore we need to provide it. |
One thing that's different for wasm in dotnet/runtime is that we use our own NodeJS build as a nuget package, this works because we can depend on that for the Microsoft build and wasm isn't built in sourcebuild. |
@akoeplinger the parts that we are discussing here aren't either. They used to be, and that's the bit that we are changing. The discussion is about avoiding a build failure in this case even when no NodeJS version is installed on the machine. We could certainly switch to bringing in a nodejs version here too, but I don't think we need it. |
@MackinnonBuck I discussed this with @akoeplinger offline. We will still need |
I'm also adding a step in the local validation check to ensure that the build succeeds with |
Co-authored-by: Javier Calvarro Nelson <[email protected]>
blazor.webview.js
Microsoft.AspNetCore.App.Internal.Assets
to build successfully when using--no-build-js
, even when the framework JS assets are not on diskFixes #59114