ericsink / SQLitePCL.raw

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

Mac compile error when compiling for a library #258

Closed glennawatson closed 2 years ago

glennawatson commented 5 years ago

when trying to compile akavache on mac we're seeing this exception

/Users/vsts/hostedtoolcache/dncs/2.2.104/x64/sdk/2.2.104/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(202,5): error : The file '/Users/vsts/agent/2.147.1/work/1/s/src/Akavache/bin/Release/xamarin.mac20/Native.Akavache.manifest' to be packed was not found on disk. [/Users/vsts/agent/2.147.1/work/1/s/src/Akavache/Akavache.csproj]
An error occurred when executing task 'Build'.

We narrowed it down to this generated block code.

<?xml version="1.0" encoding="utf-8"?>
<!--Automatically generated-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="InjectReference_8be150b3-9f2b-4d1c-a181-f5ae0b15b1f3" BeforeTargets="ResolveAssemblyReferences">
    <ItemGroup Condition=" '$(OS)' == 'Unix' AND Exists('/Library/Frameworks') ">
      <NativeReference Include="$(MSBuildThisFileDirectory)..\..\runtimes\osx-x64\native\libe_sqlite3.dylib">
        <Kind>Dynamic</Kind>
        <SmartLink>False</SmartLink>
      </NativeReference>
    </ItemGroup>
  </Target>
  <PropertyGroup>
    <ResolveAssemblyReferencesDependsOn>$(ResolveAssemblyReferencesDependsOn);InjectReference_8be150b3-9f2b-4d1c-a181-f5ae0b15b1f3</ResolveAssemblyReferencesDependsOn>
  </PropertyGroup>
</Project>

the NativeReference is the issue, since that’ll cause a manifest to be included

not sure if the solution is something to lodge a ticket on the sqlite side or the xamarin side or msbuild on the windows side it doesn’t try to include that file

glennawatson commented 5 years ago

This also involves @pureween

ericsink commented 5 years ago

What framework are you targeting? There are (off the top of my head) three ways to compile for a Mac, and for SQLitePCL.raw, they're all different:

  1. .NET Core
  2. Mono
  3. Xamarin.Mac

The NativeReference code came in at changeset ea67a9d8, roughly a year ago, as a fix for #207 -- it is supposed to be involved only for the Xamarin.Mac target.

glennawatson commented 5 years ago

IT's for Xamarin.Mac -- but we are running this in terms of Akavache (a ReactiveUI framework library) so when we do our test compile on Mac it fails.

ericsink commented 2 years ago

Closing old/stale issue.