Commit Graph

7525 Commits

Author SHA1 Message Date
eugene yokota 3ca185fe30
Merge pull request #5106 from eed3si9n/wip/1.3.1
[1.3.x] clear banner + bump IO
2019-09-19 21:19:48 -04:00
Eugene Yokota 634a11ab4d io 1.3.1 2019-09-19 18:10:47 -04:00
Eugene Yokota 13a047dafe clear banner 2019-09-19 18:09:57 -04:00
eugene yokota 613e5b61cf
Merge pull request #5101 from eed3si9n/bport/meta_resolvers
[1.3.x] add includePluginResolvers
2019-09-19 14:25:42 -04:00
eugene yokota 581dad2505
Merge pull request #5103 from eed3si9n/bport/appveyor
[1.3.x] Drop Visual Studio 2015 testing
2019-09-19 13:43:45 -04:00
Eugene Yokota be9ff19a91 Drop Visual Studio 2015 testing 2019-09-19 13:41:36 -04:00
eugene yokota 52f0646c4f
Merge pull request #5100 from eatkins/1.3.x-stream-locks-backport
[1.3.x] stream locks backport
2019-09-19 13:37:56 -04:00
Eugene Yokota e40b53272f add includePluginResolvers
Fixes #5070

This adds a new setting called `includePluginResolvers` (default `false`).
When set to `true`, it the project will include resolvers from the metabuild.

This allows the build user to declare a resolver in one place (`project/plugins.sbt`) that gets applied to both the metabuild as well as all the subprojects. The scenario comes up when someone distributes a software on their own repo. Ref #4103
2019-09-19 13:13:43 -04:00
eugene yokota 43e8eced71
Merge pull request #5099 from eatkins/1.3.x-zombie-classloaders-backport
[1.3.x] zombie classloaders backport
2019-09-19 13:10:10 -04:00
Ethan Atkins 84f9148bce Add per file stream locks
We have seen failures in scripted to create the output file for streams
and it has also been reported in https://github.com/sbt/sbt/issues/5067.
I believe this may caused by the same stream output being initialized by
multiple tasks. To fix this, I add locking on a per-file basis. There
was (and is) additional synchronization on the Streams _instance_, but
the per-file locks are stored in the Streams companion object so the
locking should be honored no matter which Streams instance calls make.

I also skip the call to IO.touch if the file already exists. I believe
that this is the common case and since IO.touch was being called with
setModified = false, it should be fine to skip the touch when the file
exists.

Prior to this change, I was able to induce the issue in #5067 in roughly
1/50 of calls to `scripted actions/cross-multiproject`. I wasn't able to
reproduce after this change.
2019-09-19 08:43:03 -07:00
Ethan Atkins fb0888dada Make allowZombieClassLoaders public
For forward binary compatibility in the 1.3.x series, this key needed to
be private[sbt], but we can make it public in 1.4.x.
2019-09-19 08:38:59 -07:00
Ethan Atkins 8674e18981 Add the ability to resurrect closed classloaders
There have been a number of complaints about the new classloader closing
behavior. It is too aggressive about closing classloaders after test and
run. This commit softens the behavior by allowing a classloader to be
resurrected after close by creating a new zombie classloader that has
the same urls as the original classloader. After this commit, we always
close the classloaders when we are done, but they can still leak
file descriptors if a zombie is created.

To configure the behavior, I add the allowZombieClassLoaders key. If it
is false (which is default), we will warn but still allow them. If it
is true, then we silence the warning. In a later version of sbt, we can
change the semantics to be strict.

I verified after this change that I could add a shutdown hook in `run`
and it would be evaluated so long as I set `bgCopyClasspath := false`.
Otherwise the needed jars were deleted before the hooks could run.

Bonus: delete unused ResourceLoaderImpl class
2019-09-19 08:38:50 -07:00
Ethan Atkins bc373d5f26 Add 1.3.0 to mima 2019-09-19 08:38:46 -07:00
eugene yokota 2d4cc650f5
Merge pull request #5090 from eatkins/1.3.x-build-sources-backport
[1.3.x] build sources backport
2019-09-17 14:08:13 -04:00
Ethan Atkins 4df049ed0c Monitor meta build sources
We want to recursively monitor the project meta build, but we also want
to avoid listing directories that don't exist. To compromise, I rework
the buildSourceFileInputs to add the nested project directories if they
exist. Because the fileInputs are a setting, this means that adding a
new project directory and *.sbt or *.scala will not immediately trigger
a rebuild, but in most common cases, it will. I added a scripted test
for this.
2019-09-17 09:38:58 -07:00
Ethan Atkins 6aa6fcede3 Monitor project build sources
In sbt 1.3.0, we only monitor build sources in the root project
directory and the root project meta build directory. This commit adds
these inputs for each project.

Fixes https://github.com/sbt/sbt/issues/5061.
2019-09-17 09:38:54 -07:00
Ethan Atkins 204351990c
Merge pull request #5087 from eatkins/1.3.x-supershell-blacklist
[1.3.x] Add consoleQuick and state to skipReportTasks
2019-09-16 18:40:06 -07:00
Ethan Atkins 577070c79f Improve formatting in Continuous 2019-09-15 11:44:11 -07:00
Ethan Atkins 041904f9b6 Skip state in task progress
In the `watch` input task, which is an alternative to `~`, with super
shell, there would be a solitary progress line for `state` in between
builds.
2019-09-15 11:44:11 -07:00
Ethan Atkins f8c40ea5b3 Add consoleQuick to skipReportTasks
This was an oversight that caused consoleQuick to not work with
supershell. We should probably try to figure out a way to allow custom
tasks to black list themselves from super shell reporting.
2019-09-15 11:42:03 -07:00
Ethan Atkins 8a161069dd
Merge pull request #5082 from eatkins/classloader-backport
[1.3.x] Classloader backport
2019-09-14 20:33:13 -07:00
Ethan Atkins 7c03c7f530 Manage classloader in BackgroundJobService
In https://github.com/sbt/sbt/issues/5075 we realized that sbt 1.3.0
introduces a regression where it closes the classloader used to invoke
the main method for in process run before all of its non-daemon threads
have terminated. To fix this and still close the classloader, I add a
method, runInBackgroundWithLoader that provides the background job
services with an optional classloader that it can close after the job
completes.

This cleanly merges and works with 1.3.x as well.
2019-09-14 18:53:03 -07:00
Ethan Atkins 8605fd5b9b Add scripted test for closing classloaders
https://github.com/sbt/sbt/issues/5075 reports that sbt 1.3.0 has a
regression for in process run. In sbt 1.3.0, we close the classloader
that invokes the main method before all of the daemon threads complete.
This adds a scripted test that fails due to this regression.
2019-09-14 18:53:03 -07:00
eugene yokota 28590b76ad
Merge pull request #5077 from eed3si9n/bport/2.12.10
[1.3.x] lm-coursier-shaded 2.0.0-RC3-4 + Scala 2.12.10
2019-09-13 11:44:37 -04:00
xuwei-k 58b0484d80 avoid deprecated /: and :\
use foldLeft and foldRight

https://github.com/scala/scala/blob/v2.13.0/src/library/scala/collection/IterableOnce.scala#L682-L686
2019-09-12 20:53:41 -04:00
Eugene Yokota 02f23b313b Scala 2.12.10 2019-09-12 19:00:37 -04:00
Eugene Yokota 087469c75f lm-coursier-shaded 2.0.0-RC3-4 2019-09-12 19:00:19 -04:00
eugene yokota 011be19445
Merge pull request #5064 from eed3si9n/bport/bugs
[1.3.x] backport some fixes
2019-09-10 11:00:02 -04:00
Ethan Atkins b88be07459 Update deprecation warnings for api changes
During refactoring, these warnings got out of date. I also added
scaladoc to the watchTriggeredMessage key.

Ref: https://github.com/sbt/sbt/issues/5051.
2019-09-10 09:28:38 -04:00
Dmitrii Naumenko 419486e4a5 remove duplicates from allJars when creating ScalaInstance #5052 (#5053)
Fixes #5052
2019-09-10 09:28:11 -04:00
Yusuke Yamada 358011ada6 Set swoval.tmpdir with absolute path via globalBasePath (#5048)
Fixes https://github.com/sbt/sbt/issues/5047

When setting swoval.tmpdir via globalBase, changed to set globalBase as absolute path.

`com.swoval.runtime.NativeLoader.loadPackaged` uses `java.lang.System.load`.
It requires absolute path, so we should set `swoval.tmpdir` with absolute path.
2019-09-10 09:27:36 -04:00
eugene yokota 7cd29cda7b
Merge pull request #5029 from eed3si9n/wip/1.3.0
sbt 1.3.0
2019-09-04 13:28:48 -04:00
Eugene Yokota 665eb8f870 sbt 1.3.0 2019-09-04 01:24:08 -04:00
eugene yokota fbfceb5ded
Merge pull request #5028 from eed3si9n/wip/bump
bump io, lm, and zinc to 1.3.0
2019-09-04 00:36:21 -04:00
Eugene Yokota fa3a09368e bump io, lm, and zinc to 1.3.0 2019-09-03 23:51:13 -04:00
eugene yokota be1163b672
Merge pull request #5025 from eatkins/supershell-appender
Improve supershell appender management
2019-09-03 19:25:09 -04:00
Ethan Atkins 7c31e03d27 Improve supershell appender management
To avoid reliance on jvm global variables, we need to share the super
shell state with each of the console appenders that write to the console
out. We only set the progress state for the console appenders for the
screen. This prevents messages that are below the global logging level
from modifying the progress state without preventing them from being
written to other appenders.

The ability to set the ProgressState for each of the console appenders
is added in a companion util PR.

I verified that the test output of io/test was correctly written to the
streams after this change (there were no progress lines in the output).
2019-09-03 15:22:34 -07:00
eugene yokota 4f2ffe9b36
Merge pull request #5018 from eatkins/output-file-stamp-cache
Use managedFileStampCache for dependency classpath
2019-09-02 23:17:27 -04:00
eugene yokota 26293640c6
Merge pull request #5022 from eatkins/supershell-no-color
Allow supershell in no color mode
2019-09-02 23:15:52 -04:00
eugene yokota 903571cc62
Merge pull request #5023 from eatkins/supershell-test-names
Name test tasks with the test name
2019-09-02 20:13:50 -04:00
Ethan Atkins b996675c93 Name test tasks with the test name
Ref https://github.com/sbt/sbt/issues/4911. This names each parallel
test task with the name of the task so that supershell can display it.
It only applies for parallel tests. When run sequentially, supershell
will still display executeTests.
2019-09-02 14:58:49 -07:00
Ethan Atkins 19ead4144d
Merge pull request #5014 from eatkins/fail-on-exception
Display only valid pages in scripted completions
2019-09-02 11:41:21 -07:00
Ethan Atkins a02a58dcfa Allow supershell in no color mode
Disabling supershell when color mode is disabled is a sensible default
(especially for piped output). However, I think it should still be
possible to use supershell in no color mode.

This requires a util change that also enables supershell in no color
mode.
2019-09-02 11:26:24 -07:00
eugene yokota 183b45897a
Merge pull request #5017 from eed3si9n/wip/once
evaluate test result only once
2019-09-02 01:04:25 -04:00
eugene yokota 7018d6ebf4
Merge pull request #5019 from eatkins/task-timings
Fix task timings
2019-09-02 01:04:03 -04:00
Ethan Atkins c525fa2551 Use managedFileStampCache for dependency classpath
It is redundant and slow to restamp all of the dependency classpath
files when they have likely already been stamped by a subproject.
For the classfiles of subprojects, we fill the managedFileStampCache
with the values returned by the zinc compile analysis product stamps.
This is why they are probably already in the managed cache and should be
up to date so long as zinc is working correctly.

I noticed that various outputFileStamps tasks were showing up in the
task timing report when I ran Test / definedTests in the main sbt project.
That task became about 400ms faster after this change.
2019-09-01 19:14:12 -07:00
Ethan Atkins 30ede13a09 Fix task timings
I noticed that the reports generated when using sbt.task.timings=true
made very little sense. They were displaying timings for tests that
couldn't possibly have been run. I tracked this down to the TaskTimings
be stored in the progressReport setting which meant they were reused
across multiple task runs. After this change, the reports made a lot
more sense.
2019-09-01 19:13:43 -07:00
Ethan Atkins 49bcef029d Display only valid pages in scripted completions
The tab completions for scripted have long been broken. They display a
number of non-sensical pages like '*0of9' or '*1of0'. Some of the
multiparser changes seem to have caused these invalid
2019-08-31 17:32:34 -07:00
eugene yokota a7dd86939f
Merge pull request #4971 from eatkins/play-watch-scripted
Play watch scripted
2019-08-29 16:22:58 -04:00
eugene yokota 37d5a3ee4e
Merge pull request #5006 from eed3si9n/wip/bump
util 1.3.0-M12
2019-08-29 16:11:03 -04:00