Skip to content

Avoid creating ScalaInstance when not used #6556

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

Merged
merged 4 commits into from
May 28, 2019
Merged

Conversation

eed3si9n
Copy link
Member

No description provided.

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

val isD = isDotty.value
val si = scalaInstance.taskValue
val siTaskInitialize = Def.valueStrict { si }
if (isD) dottyScalaInstance
Copy link
Member

Choose a reason for hiding this comment

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

Can we inline some of this stuff ? e.g.

if (isDotty.value) Def.task { ... }
else Def.valueStrict { ... }
```

Copy link
Member Author

Choose a reason for hiding this comment

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

I split things out so each step is easier to understand (for me). You can inline as much as you like.

Copy link
Member Author

Choose a reason for hiding this comment

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

@eed3si9n
Copy link
Member Author

I am not sure if this is related to this change

[error] java.io.FileNotFoundException: http://repo1.maven.org/maven2/ch/epfl/lamp/dotty_0.16/maven-metadata.xml
[error] 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)
[error] 	at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:91)
[error] 	at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1484)
[error] 	at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1482)
[error] 	at java.security.AccessController.doPrivileged(Native Method)
[error] 	at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782)
[error] 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1481)
[error] 	at java.net.URL.openStream(URL.java:1045)
[error] 	at scala.io.Source$.fromURL(Source.scala:140)
[error] 	at scala.io.Source$.fromURL(Source.scala:130)
[error] 	at dotty.tools.sbtplugin.DottyPlugin$autoImport$.dottyLatestNightlyBuild(DottyPlugin.scala:37)
[error] 	at ScalatestBuild$.dottyVersion$lzycompute(scalatest.scala:2136)
[error] 	at ScalatestBuild$.dottyVersion(scalatest.scala:2136)
[error] 	at ScalatestBuild$.$anonfun$dottySettings$1(scalatest.scala:2139)
[error] 	at sbt.internal.util.Init$Value.$anonfun$apply$3(Settings.scala:814)
[error] 	at sbt.internal.util.EvaluateSettings.$anonfun$constant$1(INode.scala:204)
[error] 	at sbt.internal.util.EvaluateSettings$MixedNode.evaluate0(INode.scala:221)
[error] 	at sbt.internal.util.EvaluateSettings$INode.evaluate(INode.scala:164)
[error] 	at sbt.internal.util.EvaluateSettings.$anonfun$submitEvaluate$1(INode.scala:87)
[error] 	at sbt.internal.util.EvaluateSettings.sbt$internal$util$EvaluateSettings$$run0(INode.scala:98)
[error] 	at sbt.internal.util.EvaluateSettings$$anon$3.run(INode.scala:94)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] java.io.FileNotFoundException: http://repo1.maven.org/maven2/ch/epfl/lamp/dotty_0.16/maven-metadata.xml
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

@smarter
Copy link
Member

smarter commented May 23, 2019

Failure is unrelated, the dottyLatestNightlyBuild task from sbt-dotty is looking for a nightly of dotty_0.16 but we won't have one until tonight's build (because we just released 0.15 and bumped version today), someone should make that task more robust.

@anatoliykmetyuk
Copy link
Contributor

The bug is fixed now, so this PR passes the CI.

@smarter smarter self-assigned this May 24, 2019
@smarter smarter merged commit e0dbba6 into scala:master May 28, 2019
@eed3si9n eed3si9n deleted the wip/taskdyn branch May 28, 2019 14:23
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.

4 participants