Add Netcoreapp ridless config to System.Private.Uri And System.Private.Xml#38142
Add Netcoreapp ridless config to System.Private.Uri And System.Private.Xml#38142Anipik merged 6 commits intodotnet:masterfrom Anipik:privateUri
Conversation
|
I couldn't figure out the best area label to add to this PR. Please help me learn by adding exactly one area label. |
ViktorHofer
left a comment
There was a problem hiding this comment.
Your PR title is slightly misleading. The configurations were already (hard-coded) version less before.
src/libraries/System.Diagnostics.StackTrace/src/System.Diagnostics.StackTrace.csproj
Show resolved
Hide resolved
| <WasmPInvokeModules Include="libSystem.Native"/> | ||
| <WasmPInvokeAssemblies Include="$(MonoArtifactsPath)\System.Private.CoreLib.dll"/> | ||
| <WasmPInvokeAssemblies Include="$(ArtifactsBinDir)\System.Runtime\$(NetCoreAppCurrent)-Unix-$(Configuration)\System.Runtime.dll"/> | ||
| <WasmPInvokeAssemblies Include="$(ArtifactsBinDir)\System.Runtime\$(NetCoreAppCurrent)-$(Configuration)\System.Runtime.dll"/> |
There was a problem hiding this comment.
This list seems very error-prone. Maybe we can add P2Ps and get the output assemblies?
cc: @ViktorHofer
There was a problem hiding this comment.
I can create an issue to track this.
|
@ericstj @ViktorHofer @safern can you review this one ? |
Instead we could annotate the P2Ps that target cc @ericstj |
What do you propose the pattern is? <ProjectReference Include="...\System.Private.Uri.csproj" TargetFramework="$(NetCoreAppCurrent)-$(TargetOS)" /><ProjectReference Include="...\System.Private.Uri.csproj" UseTargetOS="true" />Whatever we do we'd need to be careful to implement at the caller and not through global properties. Here: https://github.com/dotnet/arcade/blob/4e0dc26a70f3f9bb9bc7ae65937f85c88332abdd/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.targets#L74-L78 |
Isn't the |
|
We don't want projects setting TargetFramework of another project. That results in targeting information from one project being leaked into the referencing project. It can then get out of sync and cause major issues. Playing around with global properties in authoring is a recipe for disaster (race conditions, invalid build configurations, etc). We need a well defined behavior here that is controlled by the config system. TargetFramework metadata would specify to the configuration system: resolve this Project Reference as if the calling project targeted a different TargetFramework than actual. In this case, net5.0-Windows_NT instead of net5.0. The config system would still be responsible for selecting the TF from the set of supported ones in the referenced project and it would be the only one setting the global property. The second suggestion just further constrains this. Rather than letting a project use any TargetFramework you could only allow a project that doesn't include a |
ericstj
left a comment
There was a problem hiding this comment.
I like it! Thanks for coming up with this solution!
src/libraries/System.Net.WebSockets.Client/src/System.Net.WebSockets.Client.csproj
Outdated
Show resolved
Hide resolved
| <Compile Include="System\Uri.Windows.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="'$(TargetsUnix)' == 'true'"> | ||
| <ItemGroup Condition="'$(TargetsAnyOS)' == 'true'"> |
There was a problem hiding this comment.
Nit: I’m not a huge fan of this property name, but the behavior is correct.
There was a problem hiding this comment.
Yeah that property name is definitely misleading...
There was a problem hiding this comment.
It has been present since the old config system, So we need to be careful if we decide to change this one name.
...s/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj
Outdated
Show resolved
Hide resolved
|
@Anipik can you please add a comment to the projects where you are treating the non RID target framework as Unix and WASM? #38142 (comment) |
I missed it, i will add it |
This is related to effort on removing the cross compilation. A lot of projects are being cross compiled because of having a project dependency on these 2 projects.
We are adding a ridless tfm so that other projects can use this tfm for compiling. This would never be shipped.
I am currently using the windows implementation for the ridless one.