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

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 dotty-staging:create-staging-lib branch 14 times, most recently from 4501e88 to 49645bd Aug 21, 2019

@nicolasstucki nicolasstucki self-assigned this Aug 22, 2019

@nicolasstucki nicolasstucki force-pushed the dotty-staging:create-staging-lib branch 3 times, most recently from bbf73b8 to 9890305 Aug 22, 2019

@nicolasstucki nicolasstucki marked this pull request as ready for review Aug 23, 2019

@nicolasstucki nicolasstucki requested a review from smarter Aug 23, 2019

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 = {

This comment has been minimized.

Copy link
@smarter

smarter Aug 25, 2019

Member

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)

This comment has been minimized.

Copy link
@nicolasstucki

nicolasstucki Aug 26, 2019

Author Contributor

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

project/Build.scala Outdated Show resolved Hide resolved
project/Build.scala Outdated Show resolved Hide resolved

@nicolasstucki nicolasstucki force-pushed the dotty-staging:create-staging-lib branch from 9890305 to 028615e Aug 26, 2019

@nicolasstucki

This comment has been minimized.

Copy link
Contributor Author

commented Aug 26, 2019

Rebased

@nicolasstucki nicolasstucki requested a review from smarter Aug 26, 2019

project/Build.scala Outdated Show resolved Hide resolved

@nicolasstucki nicolasstucki force-pushed the dotty-staging:create-staging-lib branch 2 times, most recently from a749162 to 0252bed Aug 27, 2019

@nicolasstucki nicolasstucki requested a review from smarter Aug 27, 2019

// 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").

This comment has been minimized.

Copy link
@nicolasstucki

nicolasstucki Aug 27, 2019

Author Contributor

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

@nicolasstucki nicolasstucki force-pushed the dotty-staging:create-staging-lib branch from 0252bed to fdec7ad Aug 28, 2019

@smarter

This comment has been minimized.

Copy link
Member

commented on project/Build.scala in fdec7ad Aug 28, 2019

"see ..." part needs to be updated to refer to quoted-example-project

@smarter

This comment has been minimized.

Add a comment (comments start with a #) here too saying why we don't want this to compile

@nicolasstucki nicolasstucki merged commit 6a08e09 into lampepfl:master Aug 29, 2019

2 checks passed

CLA User signed CLA
Details
continuous-integration/drone/pr Build is passing
Details

@nicolasstucki nicolasstucki deleted the dotty-staging:create-staging-lib branch Aug 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.