Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrieve mono version and ignore caching on mono 5.0.0 #1536

Merged
merged 1 commit into from
Apr 27, 2017

Conversation

matthid
Copy link
Member

@matthid matthid commented Apr 27, 2017

Ok secound try...

relates to #1535 and #1534 (comment)

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

@nosami :)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

This works - apart from failing caching tests :)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

13:01 $ mono ~/src/fake/build/FAKE.exe
We don't try to cache, see https://github.com/fsharp/FAKE/pull/1534

This was referenced Apr 27, 2017
@forki forki merged commit 35e674f into fsprojects:master Apr 27, 2017
@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

This works - apart from failing caching tests :)

Well you tested it, that's enough for me :)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Still need to investigate the cause of this System.Reflection.Emit.ModuleBuilder.Save bug. Once that's fixed, we can revisit

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Can't repro with this standalone script

#r "FSharp.Compiler.Service.12.0.5/lib/net45/FSharp.Compiler.Service.dll"
open Microsoft.FSharp.Compiler.Interactive.Shell

open System.IO
open System.Text

// Intialize output and input streams
let sbOut = new StringBuilder()
let sbErr = new StringBuilder()
let inStream = new StringReader("")
let outStream = new StringWriter(sbOut)
let errStream = new StringWriter(sbErr)

// Build command line arguments & start FSI session
let argv = [| "C:\\fsi.exe" |]
let allArgs = Array.append argv [|"--noninteractive"|]

let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration()
let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream)  
let script =
    """
    open System
    type MyAttr() =
      inherit Attribute()
      do failwith "test"
    
    [<MyAttr()>]
    type Test () =
      do ignore ()
    [<assembly: MyAttr()>]
    do ()
    """
fsiSession.EvalScript script
let builder =
    match fsiSession.DynamicAssembly with
    | :? System.Reflection.Emit.AssemblyBuilder as builder -> builder
    | _ -> failwith "The DynamicAssembly property is no AssemblyBuilder!"
builder.Save("FSI-ASSEMBLY.dll")

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

@nosami Can you try with the Yaaf.FSharp.Scripting API, which is a small layer on top of FCS? (https://github.com/matthid/Yaaf.FSharp.Scripting/blob/develop/src/source/Yaaf.FSharp.Scripting/YaafFSharpScripting.fs) It executes some other sanity stuff before.

Do you compile and run the standalone script or run it via fsi?
There are some other subtle differences but I guess its one of those that matter...

@nosami
Copy link
Member

nosami commented Apr 27, 2017

I was running it via fsi. Currently working on a repro with Yaaf.FSharp.Scripting

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

You can see how the API is used here: https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/FSIHelper.fs#L459

Thanks for taking care :)

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

Running via fsi makes a difference as then another FSharp.Core is loaded and you have another environment...

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Weirdly, it doesn't repro in a console exe or using Yaaf.Scripting with default options

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

Well its a runtime crash, it can be the special way we setup our environment or a timing thing or any combination :/. Maybe it depends on the size of the stack at runtime...

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

(In other words I don't have another idea anymore ;) )

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Yeah.. no worries - will keep digging

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

You can only really go the other way: Start with the FAKE code and reduce the code until the error disappears :)

@nosami
Copy link
Member

nosami commented Apr 29, 2017

Fixed by mono/mono#4769

@matthid matthid deleted the disable_caching branch June 16, 2017 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants