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

Problem building on Linux #22

Open
rmunn opened this issue Dec 17, 2017 · 2 comments
Open

Problem building on Linux #22

rmunn opened this issue Dec 17, 2017 · 2 comments

Comments

@rmunn
Copy link
Contributor

rmunn commented Dec 17, 2017

This issue probably isn't FParsec's fault per se, but it's something that FParsec will probably need to work around since I doubt the root cause of the issue will be fixed.

When building FParsec on Linux with Mono, I ran into several issues, one of which is the following exception thrown when running test_fparsec.exe after the build has completed:

System.Runtime.Serialization.SerializationException: The type 'I18N.CJK.CP932Decoder' is not marked as serializable.
  at FParsec.Cloning.Cloner.CreateWithoutLock (System.Type type) [0x0002e] in <e6b426514886430789b41741320a466a>:0 
  at FParsec.Cloning.Cloner.Create (System.Type type) [0x00010] in <e6b426514886430789b41741320a466a>:0 
  at FParsec.Test.CloningTests.encodingTests () [0x0007c] in <5a3691c4f61b05e0a7450383c491365a>:0 
  at FParsec.Test.CloningTests.run () [0x00037] in <5a3691c4f61b05e0a7450383c491365a>:0 
  at AllTests.run () [0x000bc] in <5a3691c4f61b05e0a7450383c491365a>:0 
  at <StartupCode$test_fparsec>.$AllTests.main@ () [0x00001] in <5a3691c4f61b05e0a7450383c491365a>:0 

Looking at the Mono source, it seems that the error message is 100% correct: CP932Decoder is not serializable. I haven't been able to find any documentation that specifies that decoder instances are supposed to be serializable, so I doubt the Mono project will consider it a bug that the CP932Decoder class (and many other decoders) do not have the Serializable attribute. Therefore, FParsec will probably need to work around this issue.

I worked around this by wrapping a try ... with :? System.Runtime.Serialization.SerializationException -> () expression around the tests in question (inside the for loop). That worked for me. And I don't know if there's much value in testing old single-byte codepages whose Mono code hasn't been touched since 2006, so I think that the simplistic solution (just skip the test if a SerializationException happens) is probably best here.

@wallymathieu
Copy link

I had the same problem...

@mattiasw2
Copy link

Would really appreciate it if you would build and publish the .dlls for the dotnetcore2 version.

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

No branches or pull requests

3 participants