-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Restore CI validation that blazor.server/webview.js are up-to-date #43715
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
Comments
The CI builds the js binary and uses the one it built for shipping. I think the main reason is that a build version is burnt into the file, which will change for every build so the CI will always have a different version than what is checked in. e.g. current file has 0.0.0-DEV_BUILD, but because the CI builds projects in parallel, it's possible for it to grab the SignalR files before they're modified, or after they've been modified with the version of 8.0.0-CI Other reasons: it's a pain when making changes for the SignalR TS client, and also it causes merge conflicts when forward porting or backporting. |
@BrennanConroy Interesting. Could you clarify a bit further to make sure we're all in sync?
Main reason for what - that it should be checked for consistency, or that it should not be checked for consistency, or that this should or should not be regarded as a bug? Or main reason that "the CI builds the js binary and uses the one it built for shipping"? Things I still don't understand:
|
The main reason it's being skipped for consistency.
Right, that's why it's checked in. This whole thing is a hack to workaround source-build not having the ability to build the js file (at least not at the time, idk if things have changed).
Yeah, that is a downside. I assume source-build runs tests? So it would find a problem if the js file wasn't updated?
No idea what that file is. If it isn't using the SignalR files then it probably doesn't have the same issue. |
No, source-build doesn't even build test projects. A bit more is coming back to me: Source build placed restrictions on what / how we can build the repo and TS ➡️ JS was disallowed. @crummel @MichaelSimons is it possible these days to use the |
OK, thanks. It sounds like we just don't have a good solution here, in that:
It seems like a better solution is needed. This could be:
|
I think longer term sourcebuild needs to handle node/js. Right now, we are cheating by checking in the build outputs and that is precluding us from having consistent results. Maybe we could divide and conquer here, although I believe it goes against the direction we plan to take build wise, it might be possible to have the regular build produce the artifacts on the flight, and when using source build, pick the artifacts from a separate repository that has the prebuilt artifacts checked-in. That way, when a change happens, we do not have to check-in anything, and a CI process/bot can ensure that the assets get updated later on for source build. |
The source-build requirement is basically to avoid external "pre-builts". Checking the binary file in is cheating but, worse, it means the source-built files have the wrong version in them. Keeping the file updated somehow is fine but the current system already does that. Would automating the process do more than address the merge conflicts❔ And, how would you handle embedded versions❔ In our own builds, we could update the JS files in one build job and use that artifact in the source-build job. But that wouldn't help an actual source build and therefore doesn't really solve the problem. |
Specifically the source-build problem is that the way npm/yarn packaging works in the open-source world is that every single different npm/yarn dependency has to be packaged and shipped as a separate Fedora/RHEL/Ubuntu/etc package. The true-to-the-vision way of fixing this would be for each of these that we are dependent on to go through that process. If it would be interesting I can run the build with the available packages and see how many we're missing now - when we last checked it was on the order of ~30 missing dependencies including transitives. cc @dotnet/distro-maintainers |
Are we shipping this with source-built .NET? Or does it come with the |
@tmds this comes from source built .net. blazor.server.js is embedded in the Components.Server assembly. @dougbu my understanding at the time was that we did not want to have to deal with JavaScript/NPM dependencies as part of source built. If that is no longer a constraint, then we should strive to make source build also build the JS dependencies and avoid having anything checked in. @crummel does source build already handle JS/TS builds? |
ok, then we're shipping it. For source-built .NET, these libraries need to be built from source. We're not building any JS/TS libraries so far. |
Like @crummel says, this was motivated by the fact that ASP.NET Core has a hard (and impossible to remove) dependency on typescript, and we wanted to ship .NET in offline environments as well as where node/npm/yarn and typescript were simply not available. The options, as I saw them were:
Option 1 would be nicest from a distro-packager point of view. I understand it's a huge ask for the ASP.NET Core folks. Option 2 is the "correct" approach but not quite doable in certain environments. For example, it was a no-go on RHEL 7 where we didn't have node, and packaging/maintaining it was simply too much overhead for adding .NET. The situation may be different now. Or, perhaps, we can enable building this from source on platforms where the necessary compilers and other npm packages might be available? Option 3 seemed like the least of all evils, specially because we still have the sources (both typescript and the compiled javascript "source") and can patch them by hand if needed. |
Another option could be to not have Blazor Server support on platforms that can't build this blob from source. I'm not very familiar with the node ecosystem. If we do |
I'd like to explore option 2 on Alpine Linux. Is there a list of npm dependencies somewhere that I can crosscheck against already packaged libraries? |
It seems like some Linux distributions are becoming more flexible with option 2 as well. I am re-reading https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/ which calls out that the current policy for Fedora is that "you should bundle all the nodejs libraries that are needed [into your package]". |
@javiercn wouldn't this be covered as part of the work that you're doing already? |
This will be solved once #11592 is addressed. |
Thanks for contacting us. We're moving this issue to the |
Thanks for contacting us. We're moving this issue to the |
Closing as a dupe of #11592 |
In the past we definitely used to have CI-time checking that blazor.server.js and blazor.webview.js are up-to-date in source control, i.e., that the committed versions of these files are byte-for-byte identical to what the CI gets if it builds
src/Components/Web.JS
. This checking is important because:I might be missing something, but it looks as if our up-to-dateness verification is no longer being enforced. A recent PR made a TypeScript change that definitely impacts the .js files, but didn't include updated .js files in the PR, and yet the build didn't fail with any error about that.
The text was updated successfully, but these errors were encountered: