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

Disable cache in CLI #1535

Merged
merged 2 commits into from
Apr 27, 2017
Merged

Disable cache in CLI #1535

merged 2 commits into from
Apr 27, 2017

Conversation

matthid
Copy link
Member

@matthid matthid commented Apr 27, 2017

No description provided.

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

@nosami Can you check if this works?

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Yes. Give me a minute. I would expect it to work apart from the caching tests :)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Same error

when running script
requested token for ConstructorBuilder

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.Emit.ModuleBuilder.build_metadata (System.Reflection.Emit.ModuleBuilder) [0x00000] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.ModuleBuilder.Save () [0x001ad] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.AssemblyBuilder.Save (string,System.Reflection.PortableExecutableKinds,System.Reflection.ImageFileMachine) [0x0022b] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.AssemblyBuilder.Save (string) [0x00000] in <5357e6452d21439088fd8589dfcf1134>:0
  at Fake.FSIHelper.handleCaching<a_REF> (bool,Yaaf.FSharp.Scripting.IFsiSession,a_REF,System.IO.DirectoryInfo,Fake.FSIHelper/CacheInfo) [0x00046] in <5901cdec7c20dbeda7450383eccd0159>:0
  at Fake.FSIHelper.runScriptUncached (bool,string,System.Collections.Generic.IEnumerable`1<string>,bool,Fake.FSIHelper/CacheInfo,System.IO.TextWriter,System.IO.TextWriter) [0x00236] in <5901cdec7c20dbeda7450383eccd0159>:0
  at Fake.FSIHelper.runFAKEScriptWithFsiArgsAndRedirectMessages (bool,Fake.FSIHelper/FsiArgs,System.Collections.Generic.IEnumerable`1<System.Tuple`2<string, string>>,Microsoft.FSharp.Core.FSharpFunc`2<string, Microsoft.FSharp.Core.Unit>,Microsoft.FSharp.Core.FSharpFunc`2<string, Microsoft.FSharp.Core.Unit>,bool) [0x0015d] in <5901cdec7c20dbeda7450383eccd0159>:0
  at Fake.FSIHelper.executeBuildScriptWithArgsAndFsiArgsAndReturnMessages (string,string[],string[],bool) [0x00038] in <5901cdec7c20dbeda7450383eccd0159>:0
  at Test.FAKECore.when_running_script.RunExplicitWithResult (string,string[],string[],bool) [0x00023] in <5be32c41453a46b88625282d5ca4e474>:0
  at Test.FAKECore.when_running_script/<>c.<.ctor>b__25_1 () [0x0006c] in <5be32c41453a46b88625282d5ca4e474>:0
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004d] in <5357e6452d21439088fd8589dfcf1134>:0
  at <unknown> <0xffffffff>

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Are the tests using the CLI?

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

No

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

@nosami I looked at the code again. I think the binary should actually work (even when the tests don't).
Problem is that it is hard to make the caching tests ignore failures on specific mono versions, they are quite strict in that regard. The new fix might be green or maybe not but the binary should work...

@nosami
Copy link
Member

nosami commented Apr 27, 2017

I've only managed to repro this bug so far through the test suite. The FAKE binary works against FCS

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

Ok so mono seems to choke with the following code

open System
type MyAttr() =
  inherit Attribute()
  do failwith "test"

[<MyAttr()>]
type Test () =
  do ignore ()
[<assembly: MyAttr()>]
do ()

@nosami can you verify? At least that's the one we are using in the Test-case that probably failed.

@nosami
Copy link
Member

nosami commented Apr 27, 2017

✔ ~/src/faketest
12:27 $ cat faketest.fsx
open System
type MyAttr() =
  inherit Attribute()
      do failwith ""test""

      [<MyAttr()>]
      type Test () =
        do ignore ()
    [<assembly: MyAttr()>]
    do ()
✔ ~/src/faketest
12:27 $ fsharpi faketest.fsx

/Users/jason/src/faketest/faketest.fsx(7,7): error FS0010: Incomplete structured construct at or before this point in member definition

@forki forki merged commit 1f38e51 into fsprojects:master Apr 27, 2017
@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

you intendation is off. And you need to run it with FAKE as fsharpi is probably just working (as there is no cache)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

oops. paste bug

12:31 $ cat faketest.fsx
open System
type MyAttr() =
  inherit Attribute()
  do failwith ""test""

[<MyAttr()>]
type Test () =
  do ignore ()
[<assembly: MyAttr()>]
do ()
✔ ~/src/faketest
12:31 $ fsharpi faketest.fsx

/Users/jason/src/faketest/faketest.fsx(4,17): error FS0039: The value or constructor 'test' is not defined. Maybe you want one of the following:
   Set
   set
   Text

Looks some error with failwith

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

Ah sorry I failed the quotes because of escaping in the C# string :)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Yeah.. just spotted :)

@nosami
Copy link
Member

nosami commented Apr 27, 2017

12:34 $ fake
requested token for ConstructorBuilder

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.Emit.ModuleBuilder.build_metadata (System.Reflection.Emit.ModuleBuilder) [0x00000] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.ModuleBuilder.Save () [0x001ad] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.AssemblyBuilder.Save (string,System.Reflection.PortableExecutableKinds,System.Reflection.ImageFileMachine) [0x0022b] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.AssemblyBuilder.Save (string) [0x00000] in <5357e6452d21439088fd8589dfcf1134>:0
  at Fake.FSIHelper.handleCaching<a_REF> (bool,Yaaf.FSharp.Scripting.IFsiSession,a_REF,System.IO.DirectoryInfo,Fake.FSIHelper/CacheInfo) [0x00046] in <5901b853ccf1c534a745038353b80159>:0
  at Fake.FSIHelper.runScriptUncached (bool,string,System.Collections.Generic.IEnumerable`1<string>,bool,Fake.FSIHelper/CacheInfo,System.IO.TextWriter,System.IO.TextWriter) [0x00236] in <5901b853ccf1c534a745038353b80159>:0
  at Fake.FSIHelper.runFAKEScriptWithFsiArgsAndRedirectMessages (bool,Fake.FSIHelper/FsiArgs,System.Collections.Generic.IEnumerable`1<System.Tuple`2<string, string>>,Microsoft.FSharp.Core.FSharpFunc`2<string, Microsoft.FSharp.Core.Unit>,Microsoft.FSharp.Core.FSharpFunc`2<string, Microsoft.FSharp.Core.Unit>,bool) [0x0015d] in <5901b853ccf1c534a745038353b80159>:0
  at Fake.FSIHelper.runBuildScriptWithFsiArgsAt (bool,Fake.FSIHelper/FsiArgs,System.Collections.Generic.IEnumerable`1<System.Tuple`2<string, string>>,bool) [0x0002c] in <5901b853ccf1c534a745038353b80159>:0
  at Program/clo@76-1.Invoke (Microsoft.FSharp.Core.Unit) [0x00320] in <5901b85ef91bc6c0a74503835eb80159>:0
  at <StartupCode$FAKE>.$Program.main@ () [0x00407] in <5901b85ef91bc6c0a74503835eb80159>:0
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) [0x0004c] in <5357e6452d21439088fd8589dfcf1134>:0

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

So at least we have a more minimal repro now. I guess we can verify now if the latest version (with the patch of this PR) is working. Thanks for the quick feedback.

@nosami
Copy link
Member

nosami commented Apr 27, 2017

It doesn't work using your patch

✔ ~/src/monodevelop/main/external/fsharpbinding [d15-2-fix-53895 L|✚ 16…319⚑ 14]
12:35 $ mono ~/src/fake/build/FAKE.exe
requested token for ConstructorBuilder

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.Emit.ModuleBuilder.build_metadata (System.Reflection.Emit.ModuleBuilder) [0x00000] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.ModuleBuilder.Save () [0x001ad] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.AssemblyBuilder.Save (string,System.Reflection.PortableExecutableKinds,System.Reflection.ImageFileMachine) [0x0022b] in <5357e6452d21439088fd8589dfcf1134>:0
  at System.Reflection.Emit.AssemblyBuilder.Save (string) [0x00000] in <5357e6452d21439088fd8589dfcf1134>:0
  at Fake.FSIHelper.handleCaching<a_REF> (bool,Yaaf.FSharp.Scripting.IFsiSession,a_REF,System.IO.DirectoryInfo,Fake.FSIHelper/CacheInfo) [0x00046] in <5901d4357c20dbeda745038335d40159>:0
  at Fake.FSIHelper.runScriptUncached (bool,string,System.Collections.Generic.IEnumerable`1<string>,bool,Fake.FSIHelper/CacheInfo,System.IO.TextWriter,System.IO.TextWriter) [0x0023a] in <5901d4357c20dbeda745038335d40159>:0
  at Fake.FSIHelper.runFAKEScriptW

@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

Ah so mono is crashing completely. Oh

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Yeah... and running the same script with fsharpi is fine.

@nosami
Copy link
Member

nosami commented Apr 27, 2017

Looks like a Mono/Cecil issue

@forki
Copy link
Member

forki commented Apr 27, 2017

this is released now.

@matthid matthid mentioned this pull request Apr 27, 2017
@matthid
Copy link
Member Author

matthid commented Apr 27, 2017

Next try: #1536

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