Commit Graph

6002 Commits

Author SHA1 Message Date
Ethan Atkins 0de8345e33 Remove watch loops
When source generators write into the unmanaged source directory, bad
things can happen. Continuous builds will loop indefinitely and
compiling will fail because the generated sources get added to the
source list twice, causing the incremental compiler to complain about
compiling classes it has already seen. My two-pronged solution is to
de-duplicate the sources task and to filter out managed source files in
watch sources. The drawback to the latter is that it causes the source
generation task to be executed twice per compile.
2018-04-27 14:42:37 -07:00
Dale Wijnand bf8df381f5
Merge pull request #4123 from eed3si9n/wip/repl
Re-fix console and JLine bug
2018-04-26 07:00:21 +01:00
Eugene Yokota a798c4adff Re-fix console and JLine bug
Fixes #3482 take 3

There are two bugs related REPL and JLine.
1. JLine getting disabled (up arrow not working) on the second run of `console` task.
2. Typed characters not showing up even on the `console` task.

The first issue was fixed by #4054 which added `t.init`. When I noticed the second problem, I fixed it in #4082 (adds `t.restore`) but undid the first fix. This attempts to fix both the issues.
2018-04-25 16:55:26 -04:00
Eugene Yokota 334789c919 1.1.5-SNAPSHOT 2018-04-25 16:15:19 -04:00
Dale Wijnand 5bf1be1202
Merge pull request #4115 from dwijnand/cleanup/drop-negate-params-in-scalac-opts
Drop -Ywarn-unused:-params
2018-04-24 13:53:07 +01:00
Dale Wijnand c0756e14d9
Merge pull request #4114 from OlegYch/fix-4112
Remove usage of DynamicVariable and fix memory leak, fixes #4112
2018-04-24 09:53:39 +01:00
Dale Wijnand 065b65a05e
Drop -Ywarn-unused:-params
Previously we'd get in the build logs:

    [error] params cannot be negated, it enables other arguments

and lots of wawrnings.

Now we just get lots of warnings without the non-fatal error message.
2018-04-24 07:29:49 +01:00
OlegYch eeeb4c9ff2 Remove usage of DynamicVariable and fix memory leak, fixes https://github.com/sbt/sbt/issues/4112 2018-04-23 20:46:08 +03:00
Dale Wijnand a2af3bff15
Merge pull request #4098 from eatkins/filter
Exclude directories instead of including files
2018-04-23 08:15:11 +01:00
Dale Wijnand cd7eb95728
Merge pull request #4093 from laughedelic/unexpected-responses
WIP: Fix unexpected responses from the server
2018-04-23 08:02:30 +01:00
Dale Wijnand dfff1ed928
Merge pull request #4032 from eed3si9n/wip/servertest
improve server testing
2018-04-18 07:12:53 +02:00
Eugene Yokota 1ec07c1867 Recover sbtOn 2018-04-17 23:26:29 +02:00
Ethan Atkins 2bb717dbf9 Exclude directories instead of including files
The existing filter caused SourceModificationWatch.watch to ignore
deleted files because !file.exists implies !file.isFile. The intention
of the filter was to exclude directories that had a name ending in
".scala".
2018-04-13 11:36:40 -07:00
Alexey Alekhin a1e3146c08
Don't use initialize request id for the internal collectAnalyses call 2018-04-12 19:47:32 +02:00
Dale Wijnand a8c1239e32
Merge pull request #4058 from retronym/topic/quietly-cancel
Avoid printing RejectedExectionExeption stack trace after cancellation
2018-04-11 12:00:03 +01:00
Dale Wijnand 2e2c3f6e89
Merge pull request #4087 from hvesalai/patch-2
Update to Jline 2.14.6
2018-04-11 11:55:56 +01:00
Heikki Vesalainen e5a37cad42
Update to Jline 2.14.6
This version of Jline fixes three things for Emacs users:
- ANSI colors are now enabled for Emacs.
- Terminal echo is now disabled for Emacs.
- History is enabled for all dump terminals.
2018-04-11 00:10:56 +03:00
eugene yokota 7ae83cc755
Merge pull request #4085 from eed3si9n/wip/bumpzinc
Zinc 1.1.5
2018-04-09 13:37:50 -04:00
Eugene Yokota b9eb7764f3 Zinc 1.1.5 2018-04-09 12:37:42 -04:00
Dale Wijnand 98e2b0b5d3
Merge pull request #4082 from eed3si9n/wip/repl
Re-fixing console and JLine
2018-04-09 11:23:58 +01:00
Eugene Yokota 8ed796fb25 Re-fixing console and JLine
Fixes #3482 take 2

I thought I tested #4054 using a local build, but when I ran 1.1.3, `console` did not display anything that I typed.
Switching to `usingTerminal` which calls `terminal.restore` similar to what I had in 1.1.1 fixes `console`.
2018-04-09 00:11:17 -04:00
eugene yokota 4d7149a7f3
Merge pull request #4078 from retronym/bump/houserules
Upgrade to latest sbt-houserules
2018-04-08 14:33:04 -04:00
Jason Zaugg 1abb0a3641 Upgrade to latest sbt-houserules 2018-04-08 14:31:48 +10:00
eugene yokota 314ff46432
Merge pull request #4076 from eed3si9n/wip/bumplauncher
launcher 1.0.4
2018-04-06 19:35:27 -04:00
Eugene Yokota 32385c8bb7 launcher 1.0.4 2018-04-06 18:36:10 -04:00
eugene yokota 8f6e2fe371
Merge pull request #4075 from eed3si9n/wip/bump
bump IO and Zinc
2018-04-06 18:10:07 -04:00
Eugene Yokota 8781c16cbb bump IO and Zinc 2018-04-06 16:30:33 -04:00
eugene yokota 7690a1bd24
Merge pull request #4070 from steinybot/fix/3432
Add dependencyResolution scoped to updateSbtClassifiers task
2018-04-06 05:58:27 -04:00
eugene yokota 5c32787574
Merge pull request #4071 from eed3si9n/wip/closewatch
Use MacOSXWatchService instead of PollingWatchService
2018-04-06 04:34:30 -04:00
Eugene Yokota 707bf08c4e Add new closewatch mode 2018-04-05 20:29:26 -04:00
Jason Pickens 9043a92e8b
Merge branch '1.1.x' into fix/3432 2018-04-06 10:55:21 +12:00
Jason Steenstra-Pickens 4dc76e2b38 Add dependencyResolution scoped to updateSbtClassifiers task
Fixes #3432
2018-04-06 10:41:31 +12:00
eugene yokota b7d3959241
Merge pull request #4067 from eed3si9n/wip/reload-perf
perf: optimize hash for build
2018-04-05 10:37:41 -04:00
Eugene Yokota ad3692b2df Use NIO Files.getLastModifiedTime for hashing 2018-04-05 04:22:16 -04:00
Eugene Yokota 04d6a8b44c perf: optimize hash for build
This hot path was discovered by retronym using FlameGraph.
This removes intermediate creation of Array.

`filesModifiedBytes` in particular was bad as it was going through all `*.class` files, each generating an Array. This replaces that with `fileModifiedHash` that accepts `MessageDigest`.

According to the flamegraph, evalCommon footprint reduced from 4.5% to 3.6%.
Using `time sbt reload reload reload exit`, the median reduced from 41.450s to 39.467s.
2018-04-05 03:26:02 -04:00
Dale Wijnand 91483e7f06
Merge pull request #4063 from dwijnand/fix-migrate-url
Fix migrate URL
2018-04-04 16:31:57 +01:00
Dale Wijnand 8c1337455d
Fix migrate URL
Fixes #4062
2018-04-04 14:26:03 +01:00
Jason Zaugg 015c3103f4
Merge pull request #1 from dwijnand/topic/quietly-cancel
Catch RejectedExecutionException into an Incomplete
2018-04-04 09:05:54 +10:00
Dale Wijnand 9b3694e443
Merge pull request #4054 from eed3si9n/wip/repl
Fix console, JLine issue
2018-04-03 16:44:42 +01:00
Dale Wijnand d444b6b8ae
Merge pull request #4002 from eed3si9n/wip/opt-delegation-test
add tests around scope delegation
2018-04-03 16:43:09 +01:00
Dale Wijnand b78a0f667b
Catch RejectedExecutionException in CompletionService.submit 2018-04-03 16:05:56 +01:00
Dale Wijnand d48aa310e6
Catch RejectedExecutionException in Execute#runKeep 2018-04-03 16:02:52 +01:00
Jason Zaugg 70d3484896 Avoid printing RejectedExectionExeption stack trace after cancellation
Before:

```
[warn] /Users/jz/code/zinc/internal/zinc-apiinfo/src/main/scala/xsbt/api/Visit.scala:187:19: parameter value s in method visitString is never used
[warn]   def visitString(s: String): Unit = ()
[warn]                   ^
^C
[warn] Canceling execution...
[warn] 10 warnings found
[info] Compilation has been cancelled
[error] java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ExecutorCompletionService$QueueingFuture@33ec70dd rejected from java.util.concurrent.ThreadPoolExecutor@4b832de6[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1410]
[error]     at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
[error]     at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
[error]     at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
[error]     at java.util.concurrent.ExecutorCompletionService.submit(ExecutorCompletionService.java:181)
[error]     at sbt.CompletionService$.submit(CompletionService.scala:36)
[error]     at sbt.ConcurrentRestrictions$$anon$4.submitValid(ConcurrentRestrictions.scala:176)
[error]     at sbt.ConcurrentRestrictions$$anon$4.submit(ConcurrentRestrictions.scala:165)
[error]     at sbt.Execute.submit(Execute.scala:262)
[error]     at sbt.Execute.ready(Execute.scala:242)
[error]     at sbt.Execute.notifyDone(Execute.scala:181)
[error]     at sbt.Execute.$anonfun$retire$2(Execute.scala:152)
[error]     at sbt.Execute.$anonfun$retire$2$adapted(Execute.scala:151)
[error]     at scala.collection.immutable.List.foreach(List.scala:389)
[error]     at sbt.Execute.retire(Execute.scala:151)
[error]     at sbt.Execute.$anonfun$work$2(Execute.scala:279)
[error]     at sbt.Execute$$anon$1.process(Execute.scala:24)
[error]     at sbt.Execute.next$1(Execute.scala:104)
[error]     at sbt.Execute.processAll(Execute.scala:107)
[error]     at sbt.Execute.runKeep(Execute.scala:84)
[error]     at sbt.EvaluateTask$.liftedTree1$1(EvaluateTask.scala:387)
[error]     at sbt.EvaluateTask$.run$1(EvaluateTask.scala:386)
[error]     at sbt.EvaluateTask$.runTask(EvaluateTask.scala:405)
[error]     at sbt.internal.Aggregation$.$anonfun$timedRun$4(Aggregation.scala:100)
[error]     at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:331)
[error]     at sbt.internal.Aggregation$.timedRun(Aggregation.scala:98)
[error]     at sbt.internal.Aggregation$.runTasks(Aggregation.scala:111)
[error]     at sbt.internal.Aggregation$.$anonfun$applyTasks$1(Aggregation.scala:68)
[error]     at sbt.Command$.$anonfun$applyEffect$2(Command.scala:130)
[error]     at sbt.internal.Aggregation$.$anonfun$evaluatingParser$11(Aggregation.scala:220)
[error]     at sbt.internal.Act$.$anonfun$actParser0$3(Act.scala:387)
[error]     at sbt.MainLoop$.processCommand(MainLoop.scala:154)
[error]     at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:137)
[error]     at sbt.State$$anon$1.runCmd$1(State.scala:242)
[error]     at sbt.State$$anon$1.process(State.scala:248)
[error]     at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:137)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.MainLoop$.next(MainLoop.scala:137)
[error]     at sbt.MainLoop$.run(MainLoop.scala:130)
[error]     at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:108)
[error]     at sbt.io.Using.apply(Using.scala:22)
[error]     at sbt.MainLoop$.runWithNewLog(MainLoop.scala:102)
[error]     at sbt.MainLoop$.runAndClearLast(MainLoop.scala:58)
[error]     at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:43)
[error]     at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error]     at sbt.StandardMain$.runManaged(Main.scala:113)
[error]     at sbt.xMain.run(Main.scala:76)
[error]     at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]     at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]     at xsbt.boot.Launch$.run(Launch.scala:109)
[error]     at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error]     at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]     at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]     at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error]     at xsbt.boot.Boot$.main(Boot.scala:17)
[error]     at xsbt.boot.Boot.main(Boot.scala)
[error] java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ExecutorCompletionService$QueueingFuture@33ec70dd rejected from java.util.concurrent.ThreadPoolExecutor@4b832de6[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1410]
[error] Use 'last' for the full log.
```

After:

```
sbt:zinc Root> ;zincIvyIntegration/cleanClasses;zincIvyIntegration/compile
[success] Total time: 0 s, completed 03/04/2018 2:24:33 PM
[info] Compiling 5 Scala sources and 1 Java source to /Users/jz/code/zinc/internal/zinc-ivy-integration/target/scala-2.12/classes ...
[warn] /Users/jz/code/zinc/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ResourceLoader.scala:14:42: parameter value classLoader in method getPropertiesFor is never used
[warn]   def getPropertiesFor(resource: String, classLoader: ClassLoader): Properties = {
[warn]                                          ^
[warn] /Users/jz/code/zinc/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala:13:17: Unused import
[warn] import java.net.URLClassLoader
[warn]                 ^
[warn] /Users/jz/code/zinc/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala:137:26: Unused import
[warn]       import sbt.io.Path.toURLs
[warn]                          ^
[warn] /Users/jz/code/zinc/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala:94:30: The outer reference in this type test cannot be checked at run time.
[warn]     private final case class ScalaArtifacts(compiler: File, library: File, others: Vector[File])
[warn]                              ^
^C
[warn] Canceling execution...
[warn] four warnings found
[info] Compilation has been cancelled
[error] Total time: 1 s, completed 03/04/2018 2:24:35 PM
```

Best served with https://github.com/scala/scala/pull/6479

Fixes #3958
2018-04-03 14:27:21 +10:00
Jason Zaugg 0b801e7598 Bump Scala version to 2.12.5 2018-04-03 14:25:59 +10:00
Eugene Yokota 88f50ce35d Fix console, JLine issue
Fixes #3482
2018-03-30 23:09:01 -04:00
Ethan Atkins fff32db7ce Use MacOSXWatchService instead of PollingWatchService
This watch service should be more responsive and significantly reduce
the disk overhead of the polling based service for large repos.
2018-03-28 17:11:30 -07:00
eugene yokota fa56cf394b
Merge pull request #4046 from eed3si9n/wip/bumpsbt
bump to 1.1.3-SNAPSHOT
2018-03-28 09:11:19 -04:00
Eugene Yokota 1b77b35333 bump to 1.1.3-SNAPSHOT 2018-03-27 06:53:05 -04:00
Eugene Yokota f607b6c73f sbt 1.1.2 2018-03-27 06:52:32 -04:00
Dale Wijnand b0f9fe77b6
Merge pull request #4036 from eed3si9n/wip/fix-startup-log
Fixes -error not suppressing startup logs
2018-03-26 15:28:50 +01:00