Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dotty-staging library #7080

Merged
merged 11 commits into from
Aug 29, 2019

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Aug 21, 2019

Extract the staging out of the standard library and compiler.

  • Create dotty-staging project that depends on dotty-compiler
  • Add missing test infrastructure dependencies on the dotty-staging project or jar
  • Move ScopeId logic into dotty.tools.dotc.quoted.QuoteContext
  • Remove library/src-non-bootstrapped/scala/quoted/package.scala
  • Move staging.{run, withQuoteContext}, Toolbox, QuoteDriver, QuoteCompiler, ExprCompilationUnit to dotty-staging
  • Implement Toolbox.make directly (instead of as a java reflection call)
  • Now projects need to depend on "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value

@nicolasstucki nicolasstucki force-pushed the create-staging-lib branch 14 times, most recently from 4501e88 to 49645bd Compare August 22, 2019 13:57
@nicolasstucki nicolasstucki self-assigned this Aug 22, 2019
@nicolasstucki nicolasstucki force-pushed the create-staging-lib branch 3 times, most recently from bbf73b8 to 9890305 Compare August 23, 2019 10:16
@nicolasstucki nicolasstucki marked this pull request as ready for review August 23, 2019 12:31
import java.io.File.{ pathSeparator => sep }
val args = "-from-tasty" :: "-Yretain-trees" :: "-classpath" :: s"$classpath$sep$currentClasspath" :: classes
(new Consume).process(args.toArray)
}

private def getCurrentClasspath(cl: ClassLoader): String = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be duplicated with QuoteDriver ? (Unrelated but this implementation looks very fragile to me, this makes way too many assumptions about how classloaders are setup, which might be broken by sbt 1.3 uses of layered classloaders for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into it in another PR. For now we keep the same behaviour as before.

library/src/scala/quoted/ScopeException.scala Show resolved Hide resolved
project/Build.scala Outdated Show resolved Hide resolved
project/Build.scala Outdated Show resolved Hide resolved
@nicolasstucki
Copy link
Contributor Author

Rebased

project/Build.scala Outdated Show resolved Hide resolved
@nicolasstucki nicolasstucki force-pushed the create-staging-lib branch 2 times, most recently from a749162 to 0252bed Compare August 27, 2019 07:47
// when compiling a project that depends on dotty-staging (see ...), but we always need it to be present
// on the JVM classpath at runtime.
dependsOn(dottyCompiler(Bootstrapped) % "provided").
dependsOn(dottyCompiler(Bootstrapped) % "compile->runtime").
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smarter I had to separate the dependencies. % "provided,compile->runtime,test->test" was not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants