fslaborg / RProvider

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

RProvider 1.0.15 is DOA #122

Closed damageboy closed 9 years ago

damageboy commented 9 years ago

Hi, I'm trying to make RProvider work for me in the most basic setup, I have VS 2013 installed (Nothing else, i.e. no VS2012/2010), and F# 3.1.2. I installed RProvider 1.0.15 which pulled in the required R.NET Community packages.

When I try to issue the following from F# Interactive (Running as 64 bit, with R 64 bit installed as well):

#I "../packages/RProvider.1.0.15"
#load "RProvider.fsx"

I get the following output in the FSI output windows:

[Loading x:\temp\RPT\packages\RProvider.1.0.15\RProvider.fsx]
RProvider.fsx(17,1): error FS3053: The type provider 'RProvider.RProvider' reported an error: The type provider constructor has thrown an exception: The system cannot find the file specified
> 

Any ideas about what I'm doing wrong to get such a cold shower? Should I be using 32 bit? Is the problem with F# 3.1.2?

damageboy commented 9 years ago

OK, I've found the culprit, It seems that when/if the shadow-copy mode of FSI is turned on, RProvider borks on startup. It would be nice if there was a way to make this work with shadow-copying enabled, but I've simply disabled that feature for now, and everything looks ok.

Is this behavior documented? Should I close the issue?

tpetricek commented 9 years ago

Oh no, another assembly resolution issue :-(

I suspect this is a problem with how the shadow-copy works, but please leave the issue open. We'll have to look into this and see what we can do.

tpetricek commented 9 years ago

I opened Visual F# discussion for this: https://visualfsharp.codeplex.com/workitem/129

Also, thanks for looking into this! It is super useful to know what is causing the issue!

damageboy commented 9 years ago

I read the discussion and gave it some more thought... Perhaps the right way to deal with this is to package the RServer.exe inside the type provider as a resource, and then extract it when the type provider is executed? This could deal with a few other potential issue surrounding the way this provider is implemented...

tpetricek commented 9 years ago

As mentioned in the comments on CodePlex, it sounds like we should be able to fix this by using CodeBase rather than Location.

@damageboy I can have a look at that, but if you want to get this fixed soon, feel free to have a look and send a pull request - it might be quite small change!

tpetricek commented 9 years ago

Oh, I see we have a pull request from @jack-pappas to fix this: https://github.com/BlueMountainCapital/FSharpRProvider/pull/123

@damageboy Could you try building that from source and checking if that solves the issue for you?

damageboy commented 9 years ago

I've checked out the master, reproduced the error, then pulled in the pull-request, rebuilt, redeployed and it's still doing the same thing...

--> Added 'x:\temp\RPTest\packages/RProvider.1.0.15/' to library include path
> 
[Loading x:\temp\RPTest\packages\RProvider.1.0.15\RProvider.fsx]
RProvider.fsx(17,1): error FS3053: The type provider 'RProvider.RProvider' reported an error: The type provider constructor has thrown an exception: The system cannot find the file specified

I've pulled the fix with: git fetch origin pull/123/head:shadowfix git checkout shadowfix

And did ./build.cmd Clean ./build.cmd NuGet to repackage the new build

If you want me to change anything in the way I tried/did whatever I did, let me know...

damageboy commented 9 years ago

I've taken a look @ the code and it's pretty clear there's more than one place that need patching. RInteropClient.fs needs this sort of a fix too. I'll trying doing something with this...

damageboy commented 9 years ago

I've created #124 which build on what @jack-pappas did, and patches another file in a similar way... Tested to work, this actually fixes #122 with shadow copies on

damageboy commented 9 years ago

Could anyone merge #124 ?

tpetricek commented 9 years ago

Merged, version 1.0.16 should be out soon!