Update: Tried November CTP release. Same error message. Forgot to mention that this server has the Ubuntu server edition installed. I don't have this issue on my Ubuntu desktop that runs Desktop 10.10. So I suspected that it could be some command line related libraries missing. After I installed libreadline-dev and libreadline5, the error message disappeared. However, the issue that fsi stuck is still there.
Update2: Tried the new Mono 2.8.1. Same FSI stuck issue.
Update3: As this issue is very reproducible, I reported it as a bug in fsi.exe to Microsoft. Let's see how it goes.
Update4: Got quick response from Don Syme. The solution he suggested resolved this issue. I created the answer myself.
Hi,
I installed F# 2.0 in a server running Ubuntu 10.10 and Mono 2.8. fsc.exe runs perfect, I have no problem in compiling fs files. However, when I run fsi.exe as follows: mono /usr/local/FSharp/bin/fsi.exe
I got the FSI prompt, but an error message keep repeating
"Failed to install ctrl-c handler - Ctrl-C handling will not be available. Error was: Exception has been thrown by the target of an invocation"
Am I missing anything here?
The Mono 2.8 was compiled and installed from source.
F# has never worked for me under Linux. Today with Mono 2.8 and the November 2010 drop of F# (which confusingly has the exact same version number as the previous release?!) I get:
If I run the
wget
command that it suggests then it dies:Now if I rerun the F# installer I get a different error:
If I copy the
mono.snk
file from the Mono 2.8 directory into the F# directory by hand then the installer seems to work:But F# itself still fails to work in exactly the same way that it did before (appearing to hang whenever input is entered):
I have to use CTRL+Z to regain control and then
kill %1
to kill the rogue process.Feel really awkward to answer my own question. Anyway, I'll answer it so other people can benefit from.
First of all, install libreadline-dev and libreadline5 so you can get rid of the following error message
Failed to install ctrl-c handler - Ctrl-C handling will not be available. Error was: Exception has been thrown by the target of an invocation
If you encounter fsi.exe stuck issue, try
It works perfectly in my case.
Here is my understanding of why such an issue happened. If you look into the code, you will find out fsi.exe actually references System.Windows.Forms, which further links to the Window system. In my case, I ran fsi in a server without X system installed. Consequently, fsi stuck there trying to talk to the nonexistent X. That explains why I don't have the issue in my desktop.