fsprojects / FAKE

FAKE - F# Make
https://fake.build
Other
1.29k stars 587 forks source link

System.MissingMethodException: Fake.IO.DirectoryInfo.copyRecursiveTo #2128

Closed ovatsus closed 6 years ago

ovatsus commented 6 years ago

Version: Fake 5.3

I'm getting this error when I run the GenerateDocs task in FSharp.Data in current master:

    System.MissingMethodException: Method not found: 'Microsoft.FSharp.Collections.FSharpList`1<System.String> Fake.IO.DirectoryInfo.copyRecursiveTo(Boolean, System.IO.DirectoryInfo, System.IO.DirectoryInfo)'.
       at FSI_0003.copyFiles()
       at <StartupCode$FSI_0003>.$FSI_0003.main@() in C:\Git\FSharp.Data\docs\tools\generate.fsx:line 134

Here's the definition of the task:

Target "GenerateDocs" <| fun () ->
    executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"] [] |> ignore

If I open generate.fsx and execute it manually in F# interactive it works fine, it only throws that exception when running inside Fake

matthid commented 6 years ago

I can only recommend to update to the new runner as it seems you haven't yet migrated to it

matthid commented 6 years ago

executeFSIWithArgs (which is obsolete by the way) is just executing the fsi.exe process so I'm pretty sure this should reproduce without fake as well. Fake might execute a different fsi.exe than you do or with other arguments.

ovatsus commented 6 years ago

How do I move to the new runner? Looking at https://fake.build/fake-migrate-to-fake-5.htm it seems I only need to change from "fake build.fsx " to "fake run build.fsx --target ", but I get an error saying target run is not defined

matthid commented 6 years ago

@ovatsus First you need to switch to the new APIs, old APIs are not available in the new world

ovatsus commented 6 years ago

I already did (https://github.com/fsharp/FSharp.Data/pull/1201), this was after that

matthid commented 6 years ago

Then only specifying the modules is missing (direct #r and #I is no longer supported): https://fake.build/fake-migrate-to-fake-5.html#Add-FAKE-dependencies

ovatsus commented 6 years ago

having the #r and #I directly was very handy to be able to use the scripts both in Fake and as standalone fsi files for debugging, is that no longer supported?

matthid commented 6 years ago

You can #load scripts but I'd not recommend loading binaries, leave that to the runtime if possible it is hard/impossible to do correctly in netcore world. That's the reason why we still don't have a working fsi after all

matthid commented 6 years ago

@ovatsus If you have a concrete use-case in mind you can either open a new issue or add it here

ovatsus commented 6 years ago

Oh, I just realized, after upgrading to the new syntax, I can no longer Alt+Enter bits and pieces on build.fsx. That's a big regression for me

ovatsus commented 6 years ago

I'm not sure what you mean regarding loading binaries, but to execute the scripts I need the FAKE binaries loaded so the lib methods are available, right? I want to to support .Net Core, but it I'm using regular .Net Framework I still expect FSI evaluation to work. I'm not moving myself to .Net Core until IMO one of the best features of F#, being able to iteratively evaluate snippets of code, is available there

matthid commented 6 years ago

@ovatsus Basically you reference nuget packages with fake 5 and not individual dlls, you can complement this with the paket load script feature on the full framework fsi.

Additionally you can still run the fake 5 script in the full framework fsi with the following trick: https://fake.build/fake-debugging.html#Run-script-without-fake-exe-via-fsi

Regarding Alt+Enter that is a tooling problem and better addressed by asking people in ionide.