ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
512 stars 106 forks source link

Add support for linux-s390x target #426

Closed uweigand closed 2 years ago

uweigand commented 2 years ago

We are in the progress of adding support for Linux on the IBM Z architecture (s390x-linux-gnu) to .NET, with a goal of having support available with .NET 6. During testing of aspnetcore, we ran into the problem that the SQLitePCL.raw nuget package does not provide a native library for the linux-s390x target.

Would it be possible to add that target? I have patches against cb and SQListPCL.raw that seem to work for me, which I'll submit as PRs shortly. Generally speaking, the linux-s390x version of sqlite can be built just the same as the other targets you're already building, using the standard cross-compilers available on Ubuntu. (The only not completely trivial difference is that s390x is a big-endian architecture, so we cannot define the LITTLE_ENDIAN predefine like on other Linux targets.)

ericsink commented 2 years ago

I will take a look at this as quickly as I can. I don't plan to object, as long as it doesn't seem to break OTHER things, but I should state the obvious: I won't be able to provide much help to maintain this in the future.

uweigand commented 2 years ago

I will take a look at this as quickly as I can. I don't plan to object, as long as it doesn't seem to break OTHER things, but I should state the obvious: I won't be able to provide much help to maintain this in the future.

Thanks! Of course, if there are any platform-specific issues in the future, I'll be available to help.

uweigand commented 2 years ago

Thanks for merging the patches, @ericsink !

I'm not sure about the release schedule here - what is the timeline when a first version of the package including s390x support could be available on nuget.org?

ericsink commented 2 years ago

A pre-release: maybe today or tomorrow. #434

2.0.5 final: hopefully end of August.

uweigand commented 2 years ago

Perfect, thanks!

ericsink commented 2 years ago

2.0.5-pre20210817120427 should contain the s390x stuff. Let me know whether it looks okay?

uweigand commented 2 years ago

2.0.5-pre20210817120427 should contain the s390x stuff. Let me know whether it looks okay?

Just looking at the package, it seems OK to me. I wanted to actually execute the code by rebuilding efcore against the new package and running its test suites, but I ran into issues with that: first of all, the efcore build doesn't find the package on nuget.org because of its NuGet.config ... and if I force it to use the package from nuget.org, it still fails with errors like:

/home/uweigand/efcore/src/EFCore.Sqlite/EFCore.Sqlite.csproj : error NU1701: Package 'SQLitePCLRaw.lib.e_sqlite3 2.0.5-pre20210817120427' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project. [/home/uweigand/efcore/All.sln]

Do you know what's going on here? Is Microsoft using different versions of those packages somehow for efcore?

Failing that, is there some other use case you would recommend for running a verification test?

ericsink commented 2 years ago

That problem is #436 -- the fix should be in the next -prerelease.

uweigand commented 2 years ago

Ah OK, thanks! I'll try again once this is out.

uweigand commented 2 years ago

I've now tested efcore against 2.0.5-pre20210824155535 on s390x, and everything is looking OK. Thanks!

ericsink commented 2 years ago

Included in 2.0.5