Repository navigation
Closed
Description
When building libraries in pre-netstandard-2.0 configurations for example netstandard1.3
./build.sh --build -subsetCategory libraries -framework netstandard1.3 -os Windows_NT
the build fails with following build error (it still builds 2.0 configuration)
System.IO.FileSystem.AccessControl -> /runtime-checkout/artifacts/bin/System.IO.FileSystem.AccessControl/ref/netstandard2.0-Debug/System.IO.FileSystem.AccessControl.dll
System.Reflection.Emit -> /runtime-checkout/artifacts/bin/System.Reflection.Emit/ref/netstandard2.0-Debug/System.Reflection.Emit.dll
System.DirectoryServices -> /runtime-checkout/artifacts/bin/System.DirectoryServices/ref/netstandard2.0-Debug/System.DirectoryServices.dll
System.ServiceProcess.ServiceController -> /runtime-checkout/artifacts/bin/System.ServiceProcess.ServiceController/ref/netstandard2.0-Debug/System.ServiceProcess.ServiceController.dll
System.Data.OleDb -> /runtime-checkout/artifacts/bin/System.Data.OleDb/ref/netstandard2.0-Debug/System.Data.OleDb.dll
Restore completed in 27.97 ms for /runtime-checkout/src/libraries/restore/winrt/winrt.depproj.
/Users/marek/.nuget/packages/microsoft.targetingpack.private.winrt/1.0.5/lib/netstandard1.0/Windows.winmd (Microsoft.TargetingPack.Private.WinRT.1.0.5) -> /runtime-checkout/artifacts/bin/winrt/netstandard1.0-Debug/Windows.winmd
System.Runtime.WindowsRuntime -> /runtime-checkout/artifacts/bin/System.Runtime.WindowsRuntime/ref/netstandard2.0-Debug/System.Runtime.WindowsRuntime.dll
System.Runtime.WindowsRuntime.UI.Xaml -> /runtime-checkout/artifacts/bin/System.Runtime.WindowsRuntime.UI.Xaml/ref/netstandard2.0-Debug/System.Runtime.WindowsRuntime.UI.Xaml.dll
/runtime-checkout/.dotnet/sdk/5.0.100-alpha1-015772/Microsoft.Common.CurrentVersion.targets(2081,5): error MSB3245: Could not resolve this reference. Could not locate the assembly "System.Runtime". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/runtime-checkout/src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj]
/runtime-checkout/.dotnet/sdk/5.0.100-alpha1-015772/Microsoft.Common.CurrentVersion.targets(2081,5): error MSB3245: Could not resolve this reference. Could not locate the assembly "System.Runtime". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/runtime-checkout/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj]
Note: this builds successfully but still builds some 2.1 artefacts
./build.sh --build -subsetCategory libraries -framework netstandard2.0 -os Windows_NT
Activity
ViktorHofer commentedon Feb 12, 2020
cc @Anipik @ericstj
Anipik commentedon Feb 12, 2020
That is expected becuase we always build our ref libraries for
netstandard2.0 and netstandard2.1you can disable that by setting
AdditionalBuildTargetFrameworksto empty.i think there is no harm in building it, but we can add some conditions to additionalbuildTargetFrameworks to not build if vertical build version is higher. @ViktorHofer ur thoughts ?
ViktorHofer commentedon Feb 13, 2020
@marek-safar did you try add --restore to the arguments? It could be the case that you just haven't had restored for the older netstandard configurations, hence the references can't be resolved and RAR complains.
ViktorHofer commentedon Feb 13, 2020
Ideally we would always build all configurations during the build. I would hesitate stepping into the opposite direction.
marek-safar commentedon Feb 13, 2020
I think I run --restore but would have to try again to be sure. I'd expect when we have the
--frameworkoption which says "Build framework X" that it builds only that framework not that it builds also some unnecessary stuff because we could not figure out correct dependency chain.ViktorHofer commentedon Feb 13, 2020
That's right, if the framework is passed in that only that one should be build except for netstandard2.0 and netstandard2.1 as we depend on refs for those on netcoreapp builds.
My statement was about the default build which should build all frameworks/configuration if no option is specified. We aren't there yet as that would slow down the default build too much but we wanna get there.
marek-safar commentedon Feb 13, 2020
I don't think that should be the goal and will be very painful with expanding matrix of platforms and I'd argue for exact opposite. Which is by default build only the single configuration if no extra options are used.
ViktorHofer commentedon Apr 17, 2020
@Anipik can you please take a look and decide if we work needs to be done here? Thanks
Anipik commentedon Apr 17, 2020
i will take a look
ViktorHofer commentedon Jul 8, 2020
Submitted #38936 which fixes the building to much issue and #35606 will fix the top issue.