-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Correctly configuring .NET SDK(s) in a Linux environment #45029
Comments
Hey @pinkfloydx33 -- Can you share your package sources? I'd like to understand if you have any Microsoft ones. |
A question maybe related: is there effort/plan to get dotnet into Debian source? Would this benefit the downstreams of Debian, or if the deb package for Debian is enough? |
Great question. Yes, Debian providing .NET packages would be great. If that happened, we'd stop publishing Debian packages, per our policy. We have separately talked to Debian maintainers at Microsoft and Canonical and also to one other Debian-affiliated person. In all cases, the projects started and didn't finish. I don't recall the details. My understanding is that our bootstrapping requirements are a significant friction for Debian. They are significant friction everywhere, but more so w/rt Debian policies. I believe that there may have been some licensing issues, but I assume those are easier to resolve (since we have moved everything to MIT for Linux). A quick bootstrapping definition ... When someone wants to sourcebuild .NET 10 Preview 1, then need to acquire the .NET 10 Preview 1 SDK from Microsoft and then do a two-phase build. "One does not simply" using the .NET 9 SDK to build .NET 10. As soon as .NET 10 starts, we start using new features everywhere. That's the reason. We talked about not doing that, but we really like using new features right away as a validation and performance-benefiting tool. We do not plan to take this project on. We're best suited to being a broad enabler of many things and to do the best job we can providing the downstream Microsoft builds. |
I've heard similar concern from Gentoo user. There are difficulty/failure when trying to build 2xx/3xx SDK brands. I also plan to do a non-cross compile build for LoongArch, for which I designed some hacks but haven't verified.
For my expectation, one should be able to build .NET 10 Preview 1 with "any distribution" of .NET 9 SDK, then use any 10 Preview 1 to build 10 Preview 2, etc. This gives a self-bootstrap experience with still allowing us to adopt new features in monthly pace.
I believe we are aware of the more benefit, for example enabling dotnet-based applications to be adopted into their source tree. For smallish platforms that Microsoft build doesn't cover, improving source-build without cross compilation can improve their experience. There is also a non-solid concept about "trust to Microsoft programming platform". Anyway, I understand the challenges with our current practices and more. Hopefully we can improve step-by-step in the future, and finally achieve all of these. |
I agree that a focus on both the long-term goals and the path of small steps to get there is a winning combination. You can also look to the past to validate these ideas, like for example if latest .NET 8 SDK can build .NET 9 Preview 1 and determine what the problems are. The 2xx/3xx/4xx bands are quite a challenge. There are really there for Visual Studio but complicate many things. Windows users using Linux are frequently unhappy when the latest features bands are not available in Ubuntu. For clarity, we have not (AFAIK) provided anything but .1xx sources via the source build path. This will change with .NET 10 and Unified Build / VMR. All feature bands will be equally supported. It's possible that will help. |
This hasn't been a goal and I am not aware that it is one. It isn't until the later previews that the builds are capable of being built with the previous preview. This gives the flexibility of breaking changes between early previews which would otherwise be expected to maintain this backwards compatibility. The (acceptable) drawback is that maintainers require a current SDK to build those early previews (provided by Microsoft or cross-compiled).
Yes, you can build the main
Back in the old days, there was a script (dotnet/source-build#2930 (comment)) but that approach has been abandoned in favor of cross compilation with the vmr. That is what we're doing for bootstrapping s390x and ppc64le builds.
In .NET distribution packaging we outlined how .NET should be split across distribution packages to enable a common UX across Linux distributions. The described packaging intends to enable side-by-side installation of several .NET versions. |
Hey @richlander I figured it out. Another stage in the packer run was adding the Microsoft repository as it's needed for other things (like the azure cli and powershell). I don't know how I missed this. I was able to resolve this by deprioritizing the Microsoft repository (wrapping the installation of dotnet only) with a negative priority. I've successfully got all three SDKS installed now. I was clued in by your example yesterday. The packer builds install one sdk at a time. I changed it to install all three at once and got errors about conflicting requirements. The conflict was coming from For reference we use a heavily modified/slimmed down fork of https://github.com/actions/runner-images/tree/main/images/ubuntu. I'm pretty sure they are going to hit a similar issue on the dotnet installs since they register the same repos... unless they skip the apt package and only install from archive. When we added net8 it was literally a one line change, adding it to the list of apt packages to install, and it just worked. That was my expectation this time around, and I admit that it was a bit naive of me! I guess the only unfortunate side effect of using the Canonical repo is that they use the This all still does not explain how I was able to install dotnet-sdk-9.0 from the Microsoft repo on 11/13! Could that have just been some fluke around the GA of 9? I've got scheduled work to get our agent images upgraded to a more recent version of Ubuntu, but it's on the backburner as there's 10 billion other things I need to do and there's just one of me. 😄 I appreciate all of your help and again, I really do apologize for not doing a better investigation before posting. Edit: another thing I noticed is that the 8 runtime/sdk from this feed is behind a version. I'm not sure how long it takes to get 8.0.11 in there. I had to pin some dotnet global tools to older versions because they were expecting 8.0.11 but only found 8.0.10. For example I hit this with sql package. Any idea how long it typically takes for these to be updated in the Canonical feed? |
I'm going to look at the runners next. They will be an excellent central spot to correctly configure an environment. I think the best idea from the runners is to install the .NET tar balls. This is the same thing Actions does. |
We need to get clear instructions and some testing in place for correctly installing one or more .NET SDK versions on Linux, with a bias to Ubuntu. We had some reports of this not going well. We're going to use this issue as the official tracking issue.
We need the following:
We had discussed this recently. The reports now provide "accelerated motivation".
Instructions (growing list over time):
Relevant announcements:
The text was updated successfully, but these errors were encountered: