Open aggieben opened 1 year ago
I pushed another commit to my MBrace.Core repository (still dev
branch) trying to repro this issue with direct references to the MBrace projects instead of paket package references, and the problem reproduces the same way. This time I also use a paket load script to make sure all the dependencies are loaded. The scripts are like this:
ThespianCluster.fsx
:
#load "../../.paket/load/net6.0/main.group.fsx"
#r "../../src/MBrace.Core/bin/Debug/net6/MBrace.Core.dll"
#r "../../src/MBrace.Flow/bin/Debug/net6/MBrace.Flow.dll"
#r "../../src/MBrace.Runtime/bin/Debug/net6/MBrace.Runtime.dll"
#r "../../src/MBrace.Thespian/bin/Debug/net6/MBrace.Thespian.dll"
namespace global
module Config =
open MBrace.Core
open MBrace.Runtime
open MBrace.Thespian
// change to alter cluster size
let private workerCount = 4
let mutable private thespian = None
do
ThespianWorker.LocalExecutable <- (__SOURCE_DIRECTORY__ + "/../../src/MBrace.Thespian.Worker/bin/Debug/net6/mbrace.thespian.worker.exe")
/// Gets or creates a new Thespian cluster session.
let GetCluster() =
match thespian with
| None ->
let cluster =
ThespianCluster.InitOnCurrentMachine(workerCount,
logger = new ConsoleLogger(),
logLevel = LogLevel.Info)
printfn "got cluster: %A" cluster
thespian <- Some cluster
| Some t -> ()
thespian.Value
/// Kills the current cluster session
let KillCluster() =
match thespian with
| None -> ()
| Some t -> t.KillAllWorkers() ; thespian <- None
and `00-hello-world.fsx``:
#load "ThespianCluster.fsx"
let cluster = Config.GetCluster()
This issue seems to bear a resemblance to https://github.com/dotnet/fsharp/issues/13126. Unsure if they're related or not.
This one, too: https://github.com/dotnet/fsharp/issues/12703
I'm trying to run the
00-hello-world.fsx
script (a chunk at a time). So far, the relevant portion is as follows:ThespianCluster.fsx
is as follows:Note the package versions referenced in this script. I've got an active branch I'm working on in two forks (
dev
branch in each): https://github.com/aggieben/MBrace.Core https://github.com/aggieben/MBrace.StarterKitI've published some nupkgs to https://www.myget.org/F/aggieben/api/v3/index.json that were built from my forks; most of the changes revolve around nuget reference updates, and a few net6 migration things. Nothing really substantive is changed.
When I try to execute the foregoing scripts, FSI fails like this:![image](https://user-images.githubusercontent.com/1321/180282813-f5f1e967-40ca-4805-a137-6829471af006.png)
The error being:
error FS0193: Could not load file or assembly 'System.CodeDom, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
There's no accompanying stack trace, so I'm a bit lost as to why this error fails. The cluster does actually start. After running this, I have 4 console windows like this:![image](https://user-images.githubusercontent.com/1321/180283018-aa66716d-d385-4dbb-8ec6-3f721e7884da.png)
But the
cluster
variable isn't bound, so something is happening between the time the cluster starts and the time the code returns back throughGetCluster()
.FSI has clearly loaded the CodeDom assembly, because I'm able to run
open System.CodeDom;;
at the prompt with no problem.Has anyone got any idea what's causing this error?