-
Notifications
You must be signed in to change notification settings - Fork 353
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
Multi framework #2343
Multi framework #2343
Conversation
Will take a look. |
Looks like this will acquire shared frameworks only on CI. It seems to me that folks would at least like to "ensure" shared frameworks even for a local build (even when running on a machine-wide CLI): did you consider this functionality? Taking that a step further, one could imagine that the presence of shared frameworks would go into the selection of a dotnet CLI to use, but I can see how this is hard with your current approach of placing these in MSBuild. |
Ideally, to me, the shared framework acquisition wouldn't happen in MSBuild, it would happen in the tools scripts. There was some previous discussion that went back and forth on this and everyone agreed that using MSBuild was fine for now because otherwise you have to synchronize your global.json and a props files and it's a pain to keep things correct.
You can ensure shared frameworks by running with |
We should install the shared frameworks in every build (local or CI) in Restore phase. The installation should be no-op if the frameworks are already present. That can be easily done by checking for existence of the SDK directories, so it shouldn't cause any delay. I don't think we should have |
Do you mean selection of dotnet CLI to run the build by? Why would that one need any shared frameworks, other than the default one? My understanding is that we only need the extra shared frameworks for testing purposes. |
Your build may depend on .NETCore based tools that run on different shared frameworks out of process. Imagine MSBuild is running on 2.1 and CSC needs to run on 3.0 (or vice-versa) and runs out of proc. This is a bit contrived, but I believe @ViktorHofer came across some scenarios like this. |
@ericstj I'd rather have our build depend only on a single version of .NET Core. |
Sure, I'd also prefer that, but I don't think that's a pre-existing requirement for everyone outside of source build. I believe there are a non-zero number of repos running on multiple shared-frameworks today. We have some standalone tools that build out of arcade: do those need to cross-compile for netcoreapp2.x and netcoreapp3.x so that they can be consumed by repos who wish to run on only one shared framework or the other? What about community tools that some of the repos use? Imagine a case where we're on a leading edge of transition to a new side-by-side non-rollforward shared framework (eg: 2.1 > 3.0) we create an all-or-nothing hurdle by not permitting side-by-side frameworks in the build. That said, maybe we're OK with repos forcing the local toolset in these cases. |
Yes, source build would be the major concern, followed by a general complexity concern.
Why would we not enable roll-forward for these tools? |
Either they don't work on the newer shared framework or you can't change their runtimeconfig or control how they are launched. @ViktorHofer has some data I think. You may want to look at what other repos hit when they try to move from a 2.x SDK to a 3.0 SDK. Anyhow, as I previously mentioned I think we're fine with the first step of acquiring the shared Fx to the local folder. @chcosta have you looked into providing scripts or establishing patterns for folks who want to use the locally acquired bits for VS development or were you thinking to address that in a separate PR? |
My intent was to address the issues brought up in issue #1441 and get something supported in place that wasn't throw away work and could unblock the various teams encountering issues in this space by providing a unified way to handle them. We should file an issue to address locally acquired bits for VS development (I hear there are some dragons in that work) and address that separately. |
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.
Overall looks good, just some details to sort out.
We should not depend on global installations of anything for product builds. WPF already consumes the shared framework during builds without making any assumptions about global availability. Can you explain what you are trying to do and what’s not working for you? (Should this be moved to an issue on dotnet/wpf?) WPF has a very few deliberate exceptions related to VS supplied tooling and libraries related to C++, but Json libraries shouldn’t be one. |
Correct. If
Not sure what you mean. The build scripts use .NET Core msbuild unless
You can only rely on common MSBuild targets and .NET Core SDK targets to be present. These will be of the version specified under |
Re System.Text.Json: my understanding is that this is available as a built-in reference for projects targeting netcoreapp3.0. It is also available as a source package for netstandard2.0. In repos that require .NET Core SDK 3.0 for build (they specify |
Well yes, I don't want to do that. But from reading through this PR it seems that it would be prefered that repos take a dependency on a version of dotnet, and not depend on whether it's installed globally or in the
Cool, didn't know this! Yeah we are dependent on VS, so that would be why we are using the .NET Framework instance of MSBuild
The T4 targets are part of the Visual Studio installation, so that is how they are available to us. We don't need a nuget reference or anything.
Yes, but the T4 engine runs in the .NET Framework instance of MSBuild, and how the assemblies are consumed doesn't work with how |
I guess I'm missing key information about how T4 is distributed. Is there not a standalone nuget package with T4 msbuild targets and tasks that can be used without Visual Studio? |
BTW, we should probably discuss T4 in another thread or in person. It's not directly related to this PR. |
@stevenbrix, please include myself and @rladuca in the T4 conversation. I'd love to learn about this in depth. |
I'll follow up with you guys offline about T4 |
380b011
to
00e7a9a
Compare
Looks great. Just a few minor points. |
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.
Looks very clean now! Thanks for iterating on this. |
Hooray!!! @chcosta - could you send mail to the working group please alerting folks that this about to be available please? |
Fixes #1441
This change ensures the "dotnet-install" script is always downloaded to
[repo root]\.dotnet
so that it is available during toolset restore and then it downloads additional runtimes by default only if you are a CI build.Validated in Roslyn builds with https://github.com/dotnet/roslyn/pull/34298/files
Additional validation is in progress as I've modified this PR slightly since my last validation build