Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Sort out SQLite redistribution #237

Closed
bricelam opened this issue Mar 9, 2016 · 7 comments
Closed

Sort out SQLite redistribution #237

bricelam opened this issue Mar 9, 2016 · 7 comments

Comments

@bricelam
Copy link
Contributor

bricelam commented Mar 9, 2016

We currently redistribute SQLite, but only for UWP and Windows. On OSX and Linux, we assume it is already installed globally.

Ideally, we'd like to get out of the business of redistributing SQLite, and either (1) do nothing (not the best experience on Windows), or (2) depend on an official, SQLite-owned NuGet package.

We tried, with the SQLite team, to produce a NuGet 3 package--sqlite--for redistributing it, but there was no way do differentiate between a native library that can only run inside of an App container (the WinRT/UWP ones) and the other ones (Win32). (See this conversation.) NuGet 3 also fails to handle Full .NET, AnyCPU apps. (See NuGet/Home#904.) We currently do some fancy MSBuild magic in our package to workaround these. We should work with the NuGet and .NET Core teams to figure out a best practice to use in this situation. Then try again with the SQLite team to produce a package that works with Full .NET, UWP, and .NET Core.

cc @mistachkin, @ericsink, @timheuer

@bricelam
Copy link
Contributor Author

bricelam commented Mar 9, 2016

@ericstj, do you know of any new (since our last conversation) packaging techniques that might help in this situation?

@ericsink
Copy link

ericsink commented Mar 9, 2016

I am a little surprised NuGet 3.x doesn't have the needed ability to differentiate. But I haven't dived deep into NuGet 3 issues just yet. (I am currently doing some major changes to SQLitePCL.raw, but I am staying with NuGet 2.x for this round.)

I agree that a SQLite native code NuGet package which is (1) maintained by the SQLite team, and (2) doesn't need fancy MSBuild magic would be Most Excellent.

@natemcmaster
Copy link
Contributor

natemcmaster commented Apr 18, 2016

Would be nice to distribute native sqlite3 via nuget for linux. This would alleviate errors such as dotnet/efcore#5100
dotnet/efcore#5450

@divega
Copy link

divega commented May 4, 2016

For now assigning to @natemcmaster who has been doing some investigation on this area.

@natemcmaster
Copy link
Contributor

natemcmaster commented May 12, 2016

I have opened a request for CoreFX to add a WinRT rid into the runtime graph. If they put in this feature, we may be able to avoid using MSBuild to solve the WinRT/Win32 issue for sqlite3.dll and rely on NuGet to handle this correctly.

https://github.com/dotnet/corefx/issues/8478 discussion resulted in NuGet/Home#2782

@natemcmaster
Copy link
Contributor

As of #250, Microsoft.Data.Sqlite now takes a dependency on the "sqlite" package, version 3.12.2. https://www.nuget.org/packages/sqlite. The package includes native libraries for all platforms where .NET Core 1.0 RC2 is supported. This includes:

  • Linux x64 (CentOS 7.1, RHEL7, Debian 8.2, and Ubuntu 14.04 tested, others may work too.)
  • Windows x86 and x64, minimum v7
  • Universal Windows Platform apps
  • OS X >= 10.10

Microsoft.Data.Sqlite takes a dependency on this directly, however other packages and apps can install this package and use SQLite via the C API and P/Invoke.

Example:

public class NativeMethod
{
     [DllImport("sqlite3", CallingConvention = CallingConvention.Cdecl)]
     public static extern IntPtr sqlite3_libversion();
}

Special thanks to @mistachkin for collaborating with us to create the package.

cc @ericsink @timheuer @divega @bricelam @Eilon

@Eilon
Copy link
Member

Eilon commented May 27, 2016

Niiiiiiiiiiice!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants