vsajip
Well, I spent a little more time trying to get this working on Linux (Ubuntu 22.04) and I have to admit that I'm totally confused. I went into the synaptic package manager and I uninstalled mono. A forced removal in which I uninstalled mono-runtime and everything else associated with it, including IronPython. I figured I would just try to go through the installation steps here: https://github.com/javacc21/javacc21/blob/master/.github/workflows/csharp-tests.yml
So then I did sudo apt install dotnet6
and then I figured I could install IronPython and it would use dotnet. I try to do the IronPython install as per the above YAML spec, i.e. https://github.com/javacc21/javacc21/blob/master/.github/workflows/csharp-tests.yml#L59-L60 and I get:
revusky@gram ~ % sudo dpkg -i ironpython_2.7.11.deb
Selecting previously unselected package ironpython.
(Reading database ... 300477 files and directories currently installed.)
Preparing to unpack ironpython_2.7.11.deb ...
Unpacking ironpython (2.7.11) ...
dpkg: dependency problems prevent configuration of ironpython:
ironpython depends on mono-runtime (>= 5.12); however:
Package mono-runtime is not installed.
ironpython depends on libmono-posix4.0-cil (>= 5.12); however:
Package libmono-posix4.0-cil is not installed.
dpkg: error processing package ironpython (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
ironpython
This Debian package "thinks" that mono-runtime
is a dependency of ironpython and won't install the latter if Mono is not there. So, what to do? I re-install mono-runtime and then the above command works and I've got ironpython 2.7.11 installed and then when I type ipy
on the command line, I get:
IronPython 2.7.11 (2.7.11.1000)
[.NETFramework,Version=v4.5 on Mono 6.8.0.105 (Debian 6.8.0.105+dfsg-3.2 Wed Jun 30 05:34:49
UTC 2021) (64-bit)]
Type "help", "copyright", "credits" or "license" for more information.
>>>
So it's running ironpython on Mono. And, as best I understand, the mono runtime is installed on ubuntu, at least this latest version, by default -- which would be why I have no recollection of ever installing it!
So, here's a question: when you type ipy
on your development box, does it tell you that your IronPython is running on top of Mono, or somehow is it using Dotnet?
Of course, this leads finally to other questions, like: shouldn't our tests really work indistinctly with mono or dotnet anyway?
You see, this is what I don't grasp. With the Jython, you have this jython.jar and it really should (and I think does) work on just about any JVM. So, if you grabbed the IBM Java implementation instead of the Oracle one, I'm pretty sure that Jython doesn't care. And, actually, since Jython is a rather stagnant project, I think you'd have to have a very ancient JVM (at least 15 years old) to be unable to run it. And, since Oracle has been pretty good about maintaining backward compatibility, any JVM will will do, from JDK 5 (most likely , though I'm just guessing...) up to the just-released JDK 19. You type java -jar jython.jar
and it will just work. (Though our build/test requires JDK 8 or higher.) But anyway, the tests that use jython do just work as long as you have the jython.jar in $HOME/bin.
I mean, if the C# code we are generating is not very bleeding edge at all, it ought to build and run on Mono as well as any Dotnet that's not really really old. But I am reasoning more or less by analogy with how things work with Java, which, for all its imperfections, really does fullfill the write once, run anywhere promise pretty well. (Well, at least for non-GUI, I daresay...) And backward compatibiity is very very good. I mean, one can test on different Java versions for thoroughness sake, but it is very very rare that you would write code that runs on JDK version n and it doesn't also run on JDK version n+1 or n+2 or whatever.
Well, anyway, looking on the bright side, I am (gradually) learning some stuff as a result of fighting with this, but really, I think this should be a lot smoother. I cannot fathom how the automated test works on the server but I can't get it working on my local box (on any system, Windows, Linux or Mac!) to save my life seemingly.