-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix System.Data.SqlClient rolling tests on Alpine #31850
Conversation
System.Data.SqlClient package reference in tests is restoring wrong flavor of System.Data.SqlClient in some cases (Alpine, Mono). Switch back to copying System.Data.SqlClient to testhost.
This is fixing rolling build tests on Linux_musl_arm64 (Alpine): #2275 (comment) |
Can you provide more info why it chooses the wrong asset? Were you able to find out what was chosen instead? |
From #2275 (comment): The problem is that the build for musl picks up lib\netcoreapp2.1\System.Data.SqlClient.dll from the https://www.nuget.org/packages/System.Data.SqlClient/ . This .dll is a stub implementation that throws PlatformNotSupportedExceptions in most methods. Instead, it needs to pick up runtimes\unix\lib\netcoreapp2.1\System.Data.SqlClient.dll . I have verified that a simple console app published for must gets the right one. So this has to do with some customization of package restore that we got in the build. Do you happen to know where that may happen? |
@ViktorHofer @ericstj could it be because the tests didn't set any RID when restoring? |
I'm trying to repro and fetch a binlog locally right now. |
So here's what's supposed to happen. Tests restore without a RID and should see runtimetargets in the deps file for each available runtime that the package provides. Deps file gets passed to the host when running the app. Host looks at the shared framework deps files to understand the set of RIDs that are compatible with the current runtime. Host chooses from the app's deps file which runtime-specific lib is best. The things to check here are:
|
Essentially reverts #31850 and fixes the underlying issue, which was that alpine-arm64 was missing from the RID graph. This allows us to switch to PackageReference for SqlClient as the old approach doesn't work for mobile targets where we do self-contained publishing since we don't have the SqlClient dll in the in-tree runtime pack (and we don't want to put it there). While working on this I also removed some unnecessary duplication between Mono and CoreCLR in runtime.depproj. Also bumps Microsoft.DotNet.ProjectModel version in Microsoft.Extensions.DependencyModel.Tests.csproj The older version references a non-existing assembly "System.Runtime.InteropServices.Pinvoke".
System.Data.SqlClient package reference in tests is restoring wrong flavor of System.Data.SqlClient in some cases (Alpine, Mono). Switch back to copying System.Data.SqlClient to testhost.