fslaborg / RProvider

Access R packages from F#
http://fslab.org/RProvider/
Other
235 stars 69 forks source link

Fix nuget package #229

Closed AndrewIOM closed 2 years ago

AndrewIOM commented 2 years ago

Proposed Changes

The nuget package currently created during the FAKE build does not actually work. This is mainly due to assembly references and location changes between .net framework when using paket and the current situation.

Types of changes

What types of changes does your code introduce to RProvider? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

To fix the nuget package, so far I have done the following:

  1. Downgraded FSharp.Core to the lowest supported version by dependencies (which is 4.6.2)
  2. Set RProvider.* dlls to pack into the RProvider nuget package, as we don't want to distribute the three assemblies as three nuget packages.
  3. Updated metadata / logo to latest nuget metadata tag standards.
  4. Removed PipeMethodCalls manual project reference for a nuget package. The bug stopping us using the nuget has been kindly fixed by the owner in a new 3.0.4 release (see: https://github.com/RandomEngy/PipeMethodCalls/issues/10).

I have this working on macOS! Would like to now test on Windows. See screenshot:

Screenshot 2021-09-27 at 12 38 35

AndrewIOM commented 2 years ago

It all works, but sometimes I get an error, for example when calling Stan or R.x11() as follows:

Binding session to '/Users/andrewmartin/.nuget/packages/r.net/1.9.0/lib/netstandard2.0/RDotNet.dll'...
Binding session to '/Users/andrewmartin/.nuget/packages/system.componentmodel.composition/5.0.0/lib/netcoreapp2.0/System.ComponentModel.Composition.dll'...
Binding session to '/Users/andrewmartin/.nuget/packages/dynamicinterop/0.9.1/lib/netstandard2.0/DynamicInterop.dll'...
Binding session to '/Users/andrewmartin/.nuget/packages/r.net.fsharp/1.9.0/lib/netstandard2.0/RDotNet.FSharp.dll'...
Binding session to '/Users/andrewmartin/.nuget/packages/system.configuration.configurationmanager/5.0.0/lib/netstandard2.0/System.Configuration.ConfigurationManager.dll'...
Binding session to '/Users/andrewmartin/.nuget/packages/system.security.permissions/5.0.0/lib/net5.0/System.Security.Permissions.dll'...

error FS0193: Could not load file or assembly 'System.Security.Permissions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

Binding session to '/Users/andrewmartin/.nuget/packages/system.security.cryptography.protecteddata/5.0.0/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll'...
Stopped due to error

Edit: on further inspection, it only happens once. If you ignore it and run again, everything seems to work OK.

AndrewIOM commented 2 years ago

Works on Windows - tested Windows 10