arc_lupus
arc_lupus

Reputation: 4114

Compile IronPython with Mono

When I try to install IronPython on Debian with Mono (3.12), I get the following error:

socket.cs(1900,63): error CS0117: `System.Net.Sockets.SocketOptionName' does not contain a definition for `IPv6Only'

How can I solve this problem? According to the IronPython website, everything should compile without errors.

In the Mono mailing list there is already such a bug, but there is no answer to this bug. Therefore I thought that maybe this forum is a better place for this question.

Upvotes: 3

Views: 911

Answers (2)

KCD
KCD

Reputation: 10271

Correct, up to mono 4.0 throws Protocol option not supported when setting IPv6Only false.

This is probably resolved here: https://github.com/mono/mono/blob/mono-4.2.0-branch/mono/metadata/socket-io.c#L536

But do note the compile flag IPV6_V6ONLY

Upvotes: 0

Rob
Rob

Reputation: 46

I'm no expert on either IronPython or Mono, but out of curiosity I just tried this.

For whatever reason, the IPV6Only value in the SocketOptionName enum appears to be missing in the Mono implementation. The error message you're getting is from the code in IronPython.Module/Socket.cs attempting to reference this. It turns out that this is already recognised in the codebase as a feature that not all platforms have, so there's an easy workaround:

The Common.proj project file in the Solutions/ directory in your git checkout defines a number of possible ReferencedPlatform values. The default value is V4. Just below there in the XML, find a block starting:

<PropertyGroup Condition="'$(ReferencedPlatform)' == 'V4'">

Nested in there is a Features element with a list of the features that apply, and if you find and delete FEATURE_IPV6 at the end of the list, then you should find that the project will build using make. I briefly tried firing up the ipy.exe that is generated and it seems to work.

Obviously this isn't a very good solution. Probably the best thing would be to file a bug report with the IronPython project. I guess that Mono on Linux is probably a fairly low priority for the guys who are working to maintain it.

Upvotes: 3

Related Questions