Question about building scala and sbt proper

Also, even if you manage to do this, consider that to compile scala 2.12.8, you need all of its dependencies, including https://github.com/scala/scala-asm and https://github.com/scala/scala-xml (not 100% sure if this is one is actually required for the build ?) which both have an sbt-based build.

The structure of the sbt build hasn’t deviated much from the ant build. It shouldn’t be that hard to make the old scripts work again. But as long as you only need it to get sbt out of the way I wouldn’t bother. Building the compiler and standard library is really quite simple. You could do it with a few lines of code in a shell script. The sbt build is so big (and the old ant build was even bigger) because it does many things you don’t want or need for building a simple bootstrapping compiler (dependency management, incremental builds, packaging, source generation, testing, scaladoc/REPL/etc.). It’s probably the same for sbt.

scala-asm and scala-xml shouldn’t pose any problems. scala-asm is a fork of asm, written in Java and built with ant. If you can build asm, you should be able to build scala-asm. scala-xml is still needed to compile 2.12 but it’s just another source folder that you have to compile to a JAR, same as scala-library, scala-reflect and scala-compiler.

Of course, none of this matters if you don’t have the right Scala binaries to start the bootstrapping process.

1 Like

Excuse my total ignorance on this, but I’m confused what your requirements are. Certainly you need some kind of compiler to get any kind of binaries regardless of the language? So what exactly does it mean to bootstrap?

Would it be legitimate if could you decompile the compiler to Java to get compiler source code you could compile with a Java compiler? Or simply claim that Java byte code is a kind of source code?

If they’ve been compiling Scala 2.11 in Debian, it seems like they have the modules and the dependencies figured out already. See the dependencies in the package pages:

There probably weren’t many significant changes in 2.12 to the build besides switching from ant to sbt.