diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-02-16 18:58:58 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-04-13 19:41:44 +0200 |
commit | 476778612e71379cf648693f7d02039301fb5607 (patch) | |
tree | a6d27763253f9de38ba03e155450039c9b6cead5 /bin | |
parent | 0fe56ea73e6775a315f54772dc6bfb40815c7c98 (diff) | |
download | dotty-476778612e71379cf648693f7d02039301fb5607.tar.gz dotty-476778612e71379cf648693f7d02039301fb5607.tar.bz2 dotty-476778612e71379cf648693f7d02039301fb5607.zip |
Fix #2184: Hyper Bootstrap! Integrate the backend as a git submodule
The backend lives in the scalac fork at
https://github.com/lampepfl/scala/tree/sharing-backend. Before this
commit, the scala-compiler built from this fork was a dependency of
Scala just to get this backend. This made it much more cumbersome to
test changes to the backend and also forced us to depend on Scala 2.11.5
since that is the version of scalac that the forked backend is based on.
This commit changes this by adding a git submodule in the
`scala-backend` directory that points to the scalac fork. We do not
compile the whole submodule, instead we add the subset of files we need
to the dotty-compiler project in the sbt build. See backend.md for more
information (online at
http://dotty.epfl.ch/docs/contributing/backend.html) once this commit is
merged.
The most important thing to note is that whenever you clone dotty you
should do `git clone --recursive` to also clone the submodule. If you
already have a cloned dotty you'll need to do:
git submodule update --init
You will need to repeat this command anytime you update dotty and the
backend has been updated, otherwise the content of `scala-backend` will
be stale.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/common | 6 | ||||
-rwxr-xr-x | bin/dotc | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/bin/common b/bin/common index 0a084c8a6..d1a9db482 100755 --- a/bin/common +++ b/bin/common @@ -10,7 +10,7 @@ function getLastStringOnLineWith { # Configuration SCALA_VERSION=$(getLastStringOnLineWith "val scalacVersion") SCALA_BINARY_VERSION=2.11 -SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler") +SCALA_ASM_VERSION=$(getLastStringOnLineWith "% \"scala-asm\" %") SBT_VERSION=$(grep "sbt.version=" "$DOTTY_ROOT/project/build.properties" | sed 's/sbt.version=//') bootcp=true bootstrapped=false @@ -146,8 +146,8 @@ if [ "$SCALA_REFLECT_JAR" == "" ]; then SCALA_REFLECT_JAR=$(find_jar "$HOME/.ivy2/cache/org.scala-lang/scala-reflect/jars" "scala-reflect-$SCALA_VERSION.jar") fi -if [ "$SCALA_COMPILER_JAR" == "" ]; then - SCALA_COMPILER_JAR=$(find_jar "$HOME/.ivy2/cache/me.d-d/scala-compiler/jars" "scala-compiler-$SCALA_COMPILER_VERSION.jar") +if [ "$SCALA_ASM_JAR" == "" ]; then + SCALA_ASM_JAR=$(find_jar "$HOME/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles" "scala-asm-$SCALA_ASM_VERSION.jar") fi if [ "$SBT_INTERFACE_JAR" == "" ]; then @@ -20,12 +20,12 @@ CompilerMain=dotty.tools.dotc.Main FromTasty=dotty.tools.dotc.FromTasty ReplMain=dotty.tools.dotc.repl.Main -if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$SBT_INTERFACE_JAR" ] +if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_ASM_JAR" -o ! -f "$SBT_INTERFACE_JAR" ] then echo To use this script please set echo SCALA_LIBRARY_JAR to point to scala-library-$SCALA_VERSION.jar "(currently $SCALA_LIBRARY_JAR)" echo SCALA_REFLECT_JAR to point to scala-reflect-$SCALA_VERSION.jar "(currently $SCALA_REFLECT_JAR)" - echo SCALA_COMPILER_JAR to point to scala-compiler-$SCALA_VERSION.jar with bcode patches "(currently $SCALA_COMPILER_JAR)" + echo SCALA_ASM_JAR to point to scala-asm-$SCALA_ASM_VERSION.jar "(currently $SCALA_ASM_JAR)" echo SBT_INTERFACE_JAR to point to interface-$SBT_VERSION.jar "(currently $SBT_INTERFACE_JAR)" fi @@ -116,9 +116,9 @@ trap onExit INT classpathArgs () { if [[ "true" == "$bootstrapped" ]]; then check_jar "dotty-bootstrapped" "$DOTTY_JAR" "target" 'build_jar "test:runMain dotc.build" target' &> /dev/null - toolchain="$DOTTY_JAR:$DOTTY_LIB_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR" + toolchain="$DOTTY_JAR:$DOTTY_LIB_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_ASM_JAR:$SBT_INTERFACE_JAR" else - toolchain="$SCALA_LIBRARY_JAR:$DOTTY_LIB_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR" + toolchain="$SCALA_LIBRARY_JAR:$DOTTY_LIB_JAR:$SCALA_REFLECT_JAR:$SCALA_ASM_JAR:$SBT_INTERFACE_JAR" fi bcpJars="$INTERFACES_JAR:$MAIN_JAR:$DOTTY_LIB_JAR" cpJars="$INTERFACES_JAR:$MAIN_JAR:$DOTTY_LIB_JAR:$TEST_JAR" |