Skip to content
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

Building libraries in pre netstandard-2.0 configurations #1919

Closed
marek-safar opened this issue Jan 19, 2020 · 10 comments · Fixed by #35606
Closed

Building libraries in pre netstandard-2.0 configurations #1919

marek-safar opened this issue Jan 19, 2020 · 10 comments · Fixed by #35606

Comments

@marek-safar
Copy link
Contributor

marek-safar commented Jan 19, 2020

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
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Jan 19, 2020
@ViktorHofer
Copy link
Member

cc @Anipik @ericstj

@Anipik
Copy link
Contributor

Anipik commented Feb 12, 2020

this builds successfully but still builds some 2.1 artefacts

That is expected becuase we always build our ref libraries for netstandard2.0 and netstandard2.1
you can disable that by setting AdditionalBuildTargetFrameworks to 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
Copy link
Member

@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
Copy link
Member

Ideally we would always build all configurations during the build. I would hesitate stepping into the opposite direction.

@marek-safar
Copy link
Contributor Author

I think I run --restore but would have to try again to be sure. I'd expect when we have the --framework option 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
Copy link
Member

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
Copy link
Contributor Author

We aren't there yet as that would slow down the default build too much but we wanna get there.

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
Copy link
Member

@Anipik can you please take a look and decide if we work needs to be done here? Thanks

@Anipik Anipik self-assigned this Apr 17, 2020
@Anipik
Copy link
Contributor

Anipik commented Apr 17, 2020

i will take a look

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2020
@ViktorHofer ViktorHofer assigned ViktorHofer and unassigned Anipik Jul 8, 2020
@ViktorHofer
Copy link
Member

Submitted #38936 which fixes the building to much issue and #35606 will fix the top issue.

@Anipik Anipik added this to the 5.0.0 milestone Jul 8, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants