Commit Graph
7594 Commits
Author SHA1 Message Date
eugene yokota 84bcb3f112 Merge pull request #5356 from eed3si9n/bport/repo-override
[1.3.x] lm-coursier-shaded 2.0.0-RC5-3
2020-01-09 18:40:27 -05:00
Eugene Yokota 30a3d3af45 lm-coursier-shaded 2.0.0-RC5-3
Fixes https://github.com/sbt/sbt/issues/5333
Fixes https://github.com/sbt/sbt/issues/5324
Fixes https://github.com/sbt/sbt/issues/5268
Ref https://github.com/sbt/sbt/issues/5282
2020-01-09 16:16:42 -05:00
Eugene Yokota 73cc49cd71 Update repo override test
Fixes https://github.com/sbt/sbt/issues/5335
2020-01-09 15:30:54 -05:00
eugene yokota c23f951368 Merge pull request #5334 from eed3si9n/bport/holiday
[1.3.x] "client / clean" + scalatest layer revert + cross parallel fix
v1.3.6
2019-12-24 16:06:30 -05:00
Ethan Atkins b0758e99c8 Fix cross multi command performance
In 53788ba356, I changed the cross multi
parser to issue all of the commands sequentially. This caused a
performance regression for many use cases:
https://github.com/sbt/sbt/issues/5321. This commit restores the old
behavior of `+` if the command to run has no arguments.
2019-12-24 14:44:33 -05:00
Ethan Atkins f288572f70 Upgrade scala 2.13 version in scripted tests 2019-12-24 14:44:22 -05:00
Eugene Yokota 60abcc836f Reproduce #5308
#5308
2019-12-24 14:43:55 -05:00
Eugene Yokota 72d9207fef Don't close test ClassLoader by default
Fixes https://github.com/sbt/sbt/issues/5262
2019-12-24 14:43:47 -05:00
Ethan Atkins 735a9d2ec0 Revert "Place scalatest framework jar in its own classloader"
This partially reverts commit 8518c4b4fd.

I left in the useful changes to ReverseLookupClassLoader.
2019-12-24 14:43:38 -05:00
Eugene Yokota dcd0d39e9c Remove actions/doc-scala-instance
Fixes https://github.com/sbt/sbt/issues/5316

The latest doesn't look like it's testing anything.
2019-12-24 14:43:10 -05:00
Eugene Yokota 8acc54ac00 workaround client / clean problem
Ref https://github.com/sbt/sbt/issues/5314
Ref https://github.com/sbt/sbt/pull/5265

In sbt 1.3.4, it's possible to define a subproject named `client`.
The current parser behaves differently whether we calll `client/clean` or `client / clean` with whitespaces. The one with the whitespace invokes `client` command (as in thin client). This gets triggered by `+clean` because the new implementation uses whitespace.
2019-12-24 14:41:59 -05:00
eugene yokota 8ef2c1130f Merge pull request #5306 from eed3si9n/bport/cache_removal
[1.3.x] Fixes update task not invalidating
v1.3.5
2019-12-13 10:05:33 -05:00
eugene yokota 4bb6922c75 Merge pull request #5304 from eed3si9n/wip/bumplm
[1.3.x] lm 1.3.1
2019-12-13 09:51:08 -05:00
Eugene Yokota 53fdad0427 Fixes update task not invalidating
Fixes https://github.com/sbt/sbt/issues/5292
Ref https://github.com/sbt/sbt/issues/5142

`update` task checks if the timestamp is still the same from the previous resolution. This no longer works since lm-coursier does not populate the timestamps in `UpdateReport`. See https://github.com/coursier/sbt-coursier/blob/2e5c8aed5e20a14c5d439ef5ec35dd6ac00f30f5/modules/lm-coursier/src/main/scala/lmcoursier/internal/SbtUpdateReport.scala#L346-L351

Since the stamps are empty, this caused `update` not to invalidate when the cache is completely missing. This works around the issue by checking if the file still exists. It also adds a warning that the file is missing.
2019-12-13 08:55:24 -05:00
eugene yokota c4a7fdd853 Merge pull request #5305 from eed3si9n/bport/classloader-close
[1.3.x] Add closeClassLoader setting
2019-12-13 08:52:54 -05:00
Ethan Atkins 5ace894157 Add closeClassLoader setting
There have been a number of issues that have come up because of sbt
1.3.0 aggressively closing classloaders. While these issues have been
quite useful in helping us determine some issues related to classloader
lifecycle, we should give users the option to prevent sbt from closing
the classloaders.

I also noticed that the classloader-cache/spark test has been
occasionally segfaulting on travis so I disable classloader closing in
that test.
2019-12-12 22:58:31 -05:00
Eugene Yokota 929c2c71a9 lm 1.3.1
Fixes https://github.com/sbt/sbt/issues/5185
2019-12-12 22:52:41 -05:00
eugene yokota a91b6c4e0d Merge pull request #5297 from eed3si9n/bport/mix
[1.3.x] Thread-safe ZombieClassLoader + ScalaTest ClassLoader + cross command fix
2019-12-11 23:34:39 -05:00
eugene yokota 3526c7b99a Merge pull request #5296 from eed3si9n/bport/new
[1.3.x] Fixes sbt new by restoring the terminal
2019-12-11 23:15:52 -05:00
Ethan Atkins 1db1e9751e Place scalatest framework jar in its own classloader
Closing the ManagedClassLoader generated by test can cause nonlocal
effects because the jdk shares some JarFile resources across multiple
URLClassLoaders. As a result, if one classloader is trying to load a
resource and the classloader is closed, it might cause the resource
loading to fail (see https://github.com/sbt/sbt/issues/5262). This can
be fixed by moving the scalatest framework jar (and its dependencies)
into an additional classloader layer that sits between the scala library
loader and the rest of the test dependencies.

In addition to adding the new layer, I reworked the
ReverseLookupClassLoader to use its dependent classloader to find
resources that may below it in the classloading hierarchy rather than
constructing an entirely new classloader for resources.

After this change, I was able to run test in the repro project:
https://github.com/rjmac/sbt-5262 1000 times with no failures. Note that
the repro is sensitive to the jdk used. I could not reproduce with jdk11
but I could typically induce a failure within 20 or so runs with jdk8.

I benchmarked this change with
https://github.com/eatkins/scala-build-watch-performance and performance
was roughly the same as 1.3.4 with turbo mode and about 200-250ms faster
in non-turbo mode (which can be explained by the time to load the
scalatest classes).
2019-12-11 22:49:44 -05:00
Ethan Atkins 4f25ff216a Make ZombieClassLoader thread safe
The previous implementation of ZombieClassLoader was not thread safe.
This caused problems because it is possible for the ManagedClassLoader
in test to leak into the coursier thread pool if the test uses bouncy
castle apis. Unfortunately, these apis seem to in some cases assign
static variables using the Thread context class loader. Because the
bouncycastle apis are implemented by the jdk, they are found in the
system classloader and thus the static references leak out of the test
context.

I had a local repro of https://github.com/sbt/sbt/issues/5249 that is
fixed by this change.
2019-12-11 22:49:29 -05:00
Ethan Atkins da8f2057c7 Support input tasks in cross (+) command 2019-12-11 22:49:06 -05:00
Ethan Atkins b84cb1c93c Don't import fields from local variables
I found it hard to reason about where certain local variables, like
currentRef, were coming from. I also changed 'x' to 'extracted' in a few
places for clarity as well.
2019-12-11 22:48:54 -05:00
Eugene Yokota 5e6fe3bfcd [1.3.x] Fixes sbt new by restoring the terminal
Ref https://github.com/sbt/sbt/pull/5295
2019-12-11 22:29:12 -05:00
eugene yokota 1eb8e2f549 Merge pull request #5272 from smarter/backport-mkIvyConfiguration-precise-type
|backport] Give a more precise type to mkIvyConfiguration
2019-12-06 17:41:22 -05:00
Guillaume Martres 82cd29ae34 |backport] Give a more precise type to mkIvyConfiguration
Backport of https://github.com/sbt/sbt/pull/5271
2019-12-05 21:38:02 +01:00
eugene yokota 413994d3b4 Merge pull request #5241 from eed3si9n/bport/coursierbump
[1.3.x] lm-coursier-shaded 2.0.0-RC5-2
v1.3.4
2019-11-22 15:46:18 -05:00
Eugene Yokota 1dd4c70c10 mima 2019-11-22 14:56:33 -05:00
Eugene Yokota 1e845746a0 lm-coursier-shaded 2.0.0-RC5-2
Fixes #5132
Fixes #4706
Fixes #4688
2019-11-22 14:56:24 -05:00
eugene yokota e03c62ff16 Merge pull request #5239 from eed3si9n/bport/load
[1.3.x] backport some fixes
2019-11-22 14:31:37 -05:00
Samvel Abrahamyan fa1aad602e Sleep the current thread when we need to retry background job shutdown 2019-11-22 13:28:16 -05:00
Frank S. Thomas 8860cf4cfd Include description and homepage in ivy.xml files
This PR includes the values of the `description` and `homepage`
settings into the `ivy.xml` files generated by the `makeIvyXml`
task. It restores the behaviour of sbt 1.2.8 and if `useCoursier`
is set to `false`.

Two things are changed in this PR:
 * `IvyXml.content` now adds the `homepage` attribute to the
   `description` element if `project.info.homePage` is not empty.
 * `CoursierInputsTasks.coursierProject0` now fills the previous
   empty `CProject.info` field with the description and homepage.

Closes: #5234
2019-11-22 13:03:30 -05:00
Eugene Yokota fc3a0ff036 addPluginSbtFile command fixes
Ref #4211
Fixes #4395
Fixes #4600

This is a reimplementation of `--addPluginSbtFile`. #4211 implemented the command to load extra `*.sbt` files as part of the global plugin subproject. That had the unwanted side effects of not working when `.sbt/1.0/plugins` directory does not exist. This changes the strategy to load the `*.sbt` files as part of the meta build.

```
$ sbt -Dsbt.global.base=/tmp/hello/global --addPluginSbtFile=/tmp/plugins/plugin.sbt
[info] Loading settings for project hello-build from plugin.sbt ...
[info] Loading project definition from /private/tmp/hello/project
sbt:hello> plugins
In file:/private/tmp/hello/
	sbt.plugins.IvyPlugin: enabled in root
	sbt.plugins.JvmPlugin: enabled in root
	sbt.plugins.CorePlugin: enabled in root
	sbt.ScriptedPlugin
	sbt.plugins.SbtPlugin
	sbt.plugins.SemanticdbPlugin: enabled in root
	sbt.plugins.JUnitXmlReportPlugin: enabled in root
	sbt.plugins.Giter8TemplatePlugin: enabled in root
	sbtvimquit.VimquitPlugin: enabled in root
```
2019-11-22 12:26:33 -05:00
Dale Wijnand 0aa6b12e0f Cleanup Load.loadTransitive
The largest win is creating the helper, inner, "load" method.
2019-11-22 12:26:18 -05:00
eugene yokota 8ca7ef6901 Merge pull request #5205 from eed3si9n/bport/nohouse
[1.3.x] in-source sbt-houserules
2019-10-20 10:21:41 -04:00
Eugene Yokota 67c3a96538 sbt 1.3.3 2019-10-20 01:34:05 -04:00
Eugene Yokota 56fa678f3f in-source sbt-houserules 2019-10-20 01:31:45 -04:00
Filipe Regadas 71ae19a8c7 Fix MiMa 2019-10-20 01:31:26 -04:00
Filipe Regadas efd8dece58 Fix #5110: allow semanticdbVersion override 2019-10-20 01:30:52 -04:00
Filipe Regadas 68bb4344a1 Fix MiMa 2019-10-20 01:28:26 -04:00
Filipe Regadas 2e2dee90eb Fix librarymanagement project Id 2019-10-20 01:28:07 -04:00
Filipe Regadas 2bce551450 Add sbt-mima-plugin 2019-10-20 01:27:50 -04:00
eugene yokota 50f3acd4c8 Merge pull request #5183 from eed3si9n/wip/bump
[1.3.x] util 1.3.2, zinc 1.3.1
v1.3.3
2019-10-14 01:15:01 -04:00
Eugene Yokota 738bd64630 util 1.3.2, zinc 1.3.1 2019-10-14 00:26:34 -04:00
eugene yokota 4d1a83a801 Merge pull request #5163 from eatkins/1.3.x-supershell-backports
[1.3.x] supershell backports
2019-10-12 12:03:12 -04:00
eugene yokota fa84bd2bbc Merge pull request #5159 from eatkins/1.3.x-scripted-parser-backport
[1.3.x] scripted parser backport
2019-10-07 21:01:39 +02:00
Ethan Atkins e5cfa9ec7e Shutdown progress thread when there are no tasks
It is still possible for progress threads to leak so shut them down if
there are no active tasks. The report0 method will start up a new thread
if a task is added.
2019-10-07 11:58:10 -07:00
Ethan Atkins d5a4a35314 Use only one progress thread during task evaluation
In some circumstances, sbt would generate a number of task progress
threads that could run concurrently. The issue was that the TaskProgress
could be shared by multiple EvaluateTaskConfigs if a dynamic task was
used. This was problematic because when a dynamic task completed, it
might call afterAllCompleted which would stop the progress thread. There
also was a race condition because multiple threads calling initial could
theoretically have created a new progress thread which would cause a
resource leak.

To fix this, we modify the shared task progress so that the `stop()`
method is a no-op. This should prevent dynamic tasks from stopping the
progress thread. We also defer the creation of the task thread until
there is at least one active task. This prevents a thread from being
created in the shell.

The motivation for this change was that I found that sometimes there was
a leaked progress thread that would make the shell not really work for
me because the progress thread would overwrite the shell prompt. This
change fixes that behavior and I was able to validate with jstack that
there was consistently either one or zero task progress threads at a
time (zero in the shell, one when tasks were actually running).
2019-10-07 11:58:05 -07:00
Ethan Atkins 8ff0e133d3 Use logger rather than ConsoleOut for TaskTimings
When running sbt -Dtask.timings=true, the task timings get printed to
the console which can overwrite the shell prompt. When we use a logger,
the timing lines are correctly separated from the prompt lines.
2019-10-07 11:58:00 -07:00
Ethan Atkins 3ab5040bc7 Clear supershell lines before suppressed task
I noticed that when entering the console, I'd often be left with a
supershell line at the bottom of the screen that would eventually get
interlaced with my console commands. This can be eliminated by clearing
the supershell progress before evaluating the task if it is one of the
skip tasks.
2019-10-07 11:57:42 -07:00