Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 791
arc_lupus Avatar asked Feb 11 '26 03:02

arc_lupus


1 Answers

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.

like image 59
Rob Avatar answered Feb 13 '26 18:02

Rob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!