How do I run a Fast Scala Compiler remote server?

1.1k views Asked by At

I want to set an fsc process running on a box that I can then access remotely.

I understand I need to share a temp directory.

However, I'm struggling to even get it going on my laptop.

I'm trying:

fsc -Djava.io.tmpdir=/tempscala -server 127.0.0.1:8080

but it just gives me the usage options...

Help?

1

There are 1 answers

1
CPJ On BEST ANSWER

I think you're mis-understanding what fsc does. fsc starts a daemon process which stays alive between calls to compile, so it doesn't have to do all the initializing work each time. You can't actually run the compile on a completely separate box unless you have a shared file system.

As Jeha says, you should specify a temp directory with -D, then the scala files you wish to compile (this is why you're getting the usage instructions - it's missing a vital piece of information).

You also need to drop the -server, as fsc picks the port it's going to run on, and tells you it the first time you run it. You'll see lines something like this:

[Temp directory: /var/folders/oj/ojMgC8mDH4uK9fM5cjlK1E+++TI/-Tmp-/scala-devel/temp]
[Port number: 54056]
[Connected to compilation daemon at port 54056]

Then, when you want to recompile, you just call the same command again (still no need to specify server ports), then finally when you're done run fsc -shutdown

see here for the man pages