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

Fix System.Data.SqlClient rolling tests on Alpine #31850

Merged
merged 1 commit into from
Feb 6, 2020
Merged

Fix System.Data.SqlClient rolling tests on Alpine #31850

merged 1 commit into from
Feb 6, 2020

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Feb 6, 2020

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.

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

jkotas commented Feb 6, 2020

This is fixing rolling build tests on Linux_musl_arm64 (Alpine): #2275 (comment)

@jkotas jkotas changed the title Fix System.Data.SqlClient tests on Alpine Fix System.Data.SqlClient rolling tests on Alpine Feb 6, 2020
@ViktorHofer
Copy link
Member

Can you provide more info why it chooses the wrong asset? Were you able to find out what was chosen instead?

@jkotas
Copy link
Member Author

jkotas commented Feb 6, 2020

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?

@safern
Copy link
Member

safern commented Feb 6, 2020

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?

@ViktorHofer
Copy link
Member

I'm trying to repro and fetch a binlog locally right now.

@ericstj
Copy link
Member

ericstj commented Feb 26, 2020

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:

  1. Test's deps file has correct runtimeTargets for sql client package.
  2. Test shared-framework deps file lists the RID fallbacks correctly.
  3. Host is getting the test's deps file

akoeplinger added a commit that referenced this pull request Jun 17, 2020
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".
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants