Commit Graph

2952 Commits

Author SHA1 Message Date
eugene yokota d34c34d177
Merge pull request #6085 from eed3si9n/wip/metabuild-classpath2
Use the classpath obtained by the launcher for metabuild, take 2
2020-11-15 14:40:28 -05:00
Eugene Yokota b1a8f11011 Use the classpath obtained by the launcher for metabuild, take 2
Ref https://github.com/sbt/sbt/pull/4443
Fixes https://github.com/sbt/sbt/issues/5750

In #4443 I implemented an optimization where the metabuild would no longer re-resolve numerous sbt artifacts for metabuilds each time, and instead use whatever the JARs provided by the launcher. At the time, this technique didn't work for Coursier so I've placed in some workarounds for it. Now that Coursier's resolution has improved, it seems like the workaround is actually causing more harm. This removes the bandaid, and local testing shows that it seems to be working.

For instance, we no longer need to put in `ThisBuild / useCoursier := false` in sbt/sbt's `project/plugins.sbt`.
2020-11-15 12:19:03 -05:00
nafg 3c2565722a Tweak warning text 2020-11-15 00:05:06 -05:00
Naftoli Gugenheim 889b101cbd Update tests for fixed GCMonitor 2020-11-15 00:00:50 -05:00
Naftoli Gugenheim 6cca595420 Add file headers 2020-11-15 00:00:50 -05:00
Naftoli Gugenheim 1c258b8fc9 GCMonitor: Unit tests, refactor, and improve
* Refactor so as to be testable
 * Queue stores the _beginning_ timestamp of each GC time delta
 * Message states the correct time over which the GC time was recorded
 * Add heap stats from java.lang.Runtime to the message
2020-11-15 00:00:50 -05:00
Naftoli Gugenheim af7346f565 Program to manually test GCMonitor 2020-11-15 00:00:50 -05:00
eugene yokota 19ae383f9f
Merge pull request #6041 from eatkins/active-json
Start server if active.json file is removed
2020-11-04 23:06:45 -05:00
Ethan Atkins 749d32df36 Set the default scriptedBatchExecution to true
sbt itself effectively runs its scripted test with
scriptedBatchExecution true and scriptedParallelInstances 1. The
performance is much better when this works. This can cause issues, see
https://github.com/sbt/sbt/issues/6042, but we inadvertently made this
behavior the default in 1.4.0 and it took about a month before #6042 was
reported so I think most users would benefit from this default.
2020-11-04 18:47:31 -08:00
Ethan Atkins 452c49f84c Start server if active.json file is removed
If there are two sbt instances and one of them is running a server, the
other instance is presently prevented from ever starting a server. If an
sbt instance is unable to start a local server because of the presence
of another server, we can monitor the active.json file for changes and,
if it is deleted, we can then try again to start a new server instance.
2020-11-02 08:36:46 -08:00
eugene yokota 8c3f2a50f7
Merge pull request #6026 from eed3si9n/wip/content
Make remoteCacheId content-based
2020-11-01 22:06:37 -05:00
Eugene Yokota 744cfefa6c Refactor remote cache to per-config
Refactor remote caching to be scoped to configuration.
In addition, this avoid the use of dependency resolver (since I'm not resolving anything) and directly invoke the Ivy resolver for the artifact, somewhat analogus to publishing process.
This should speed up the `pullRemoteCache` since it avoids the POM download as well.

For sbt-binrary-remote-cache this created a bit of complication since the (publishing) resolver doesn't act correctly as (downloading) resolver in terms of the credentials, so I had to create a new key `remoteCacheResolvers` to have asymmetric resolver.
2020-11-01 19:15:28 -05:00
Eugene Yokota 6a356c61e0 Refactor remoteCacheId 2020-10-29 09:47:27 -04:00
Eugene Yokota 86e793cd74 Make remoteCacheId content-based
Fixes https://github.com/sbt/sbt/issues/5842
2020-10-27 10:36:53 -04:00
eugene yokota 1436960b34
Merge pull request #6023 from eatkins/sbtn-wizard
Add wizard for installing sbtn and completions
2020-10-26 18:59:42 -04:00
eugene yokota 8c3ea7d470
Merge pull request #6007 from adpi2/fix-bsp-reporter
Fix #6006: BuildServerReporter on Dotty
2020-10-26 18:59:06 -04:00
Ethan Atkins b107bdc09d
Merge branch 'develop' into sbtn-wizard 2020-10-26 15:09:57 -07:00
eugene yokota 1f770bc1c0
Merge pull request #6028 from adpi2/lint-exclude-idle-timeout
Add serverIdleTimeout to the list of excluded lint keys
2020-10-26 17:09:02 -04:00
Ethan Atkins 37e4dc5318 Disable InstallSbtnSpec
This test works fine locally on all platforms but there are issues in
CI. I think that it might work ok with 1.4.2 without a lot of extra
effort so I'm going to disable it for now.
2020-10-26 10:15:46 -07:00
Ethan Atkins beab10fc64 Add wizard for installing sbtn and completions
This commit adds a wizard for installing sbtn along with tab completions
for bash, fish, powershell and zsh. It introduces the `installSbtn`
command which installs sbtn into ~/.sbt/1.0/bin/sbtn(.exe) depending on
the platform. It also can optionally install completions. The
completions are installed into ~/.sbt/1.0/completions. The sbtn native
executable is installed by downloading the sbt universal zip for the
version (which can be provided as an input argument with a fallback to
the running sbt version) and extracting the platform specific binary
into ~/.sbt/1.0/bin. After installing the executable, it offers to setup
the path and completions for the four shells. With the user's consent,
it adds a line to the shell config that updates the path to include
~/.sbt/1.0/bin and another line to source the appropriate completion
file for the shell from ~/.sbt/1.0/completions.
2020-10-26 10:15:46 -07:00
eugene yokota cf78d18d63
Merge pull request #6008 from adpi2/fake-positions
Fix #5994: sourceMappers handles fake positions
2020-10-26 12:53:43 -04:00
Adrien Piquerez 3ca7951d13 Add serverIdleTimeout to the list of excluded lint keys 2020-10-26 16:12:47 +01:00
Adrien Piquerez 66f4032699 Fix BuildServerReporter and add tests 2020-10-26 09:04:14 +01:00
Adrien Piquerez 2425ca4950 handle fake positions in absoluteSourceMapper 2020-10-26 08:40:00 +01:00
Ethan Atkins 3aeede3774 Flush terminal output stream after readline
With the thin client, when running the command `exit`, it is often the
case that the log message `[info] disconnected` is printed on the same
line as the prompt. This is because there is a small flush delay on the
network client's output stream channel that causes the disconnected info
message to be logged before the the newline that jline 3 echoes to the
client has been printed. To fix this we can manually flush the terminal
output stream before exiting.
2020-10-24 15:49:02 -07:00
Ethan Atkins 69be879684 Reinstate watchBeforeCommand callback
A user reported that the watchBeforeCommand callback was not being
invoked in sbt 1.4.{0, 1}. This was an oversight that occurred when
refactoring watch for the thin client and there previously had been no
regression test for that callback.
2020-10-24 10:59:33 -07:00
eugene yokota 7a3ca0d9c2
Merge pull request #6011 from adpi2/fix-bsp-semanticdb-warning
Fix #5977: Fix semanticdb warning
2020-10-22 12:14:45 -04:00
eugene yokota 3536959c31
Merge pull request #6005 from eed3si9n/wip/prefixpaths
Fix earlyOutput and remoteCachePom paths
2020-10-22 11:36:49 -04:00
Adrien Piquerez 22e5308381 Fix BSP warning about semanticdb 2020-10-22 16:18:12 +02:00
Eugene Yokota 3d01d7fbbe Use different artifactPath for remoteCachePom
Fixes https://github.com/sbt/sbt/issues/6004

```
sbt:foo> remoteCachePom
[info] Wrote /private/tmp/foo/target/scala-2.13/remote-cache/foo_2.13-0.1.0-SNAPSHOT.pom

sbt:foo> makePom
[info] Wrote /private/tmp/foo/target/scala-2.13/foo_2.13-0.1.0-SNAPSHOT.pom
```
2020-10-22 00:07:46 -04:00
Eugene Yokota 88d7da5141 Fix earlyOutput paths
Fixes https://github.com/sbt/sbt/issues/5929
2020-10-22 00:03:48 -04:00
Ethan Atkins a0db985c36 Fix canonical input for network client
It is valid for the thin client input stream to return -1 as an EOF when
the user inputs ctrl+d in canonical mode.
2020-10-21 14:26:21 -07:00
Ethan Atkins 7ad20edbd3
Merge branch 'develop' into evaluate-task-memory-leak 2020-10-21 11:49:01 -07:00
eugene yokota f217b59868
Merge pull request #5996 from xuwei-k/remote-cache-extract-message
improve remote cache extract log message
2020-10-21 14:32:18 -04:00
Ethan Atkins d9acfed220 Fix EvaluateTask memory leak
EvaluateTask was holding references to SafeState that could be quite
large. This was reported as #5992. In that project, I ran the `ci` task
and observed the OOM as reported. I took a heap dump prior to OOM and
got the retained size graph from visualvm (which took hours to compute).
The lastEvaluatedState was holding a reference to SafeState that was
1.7GB. The project max heap size was set to 2GB. Instead of using the
lastEvaluatedState, we can just use StandardMain.exchange.withState.
The cached instances of state were used for task cancellation and
completions. While it is possible that early on in booting
StandardMain.exchange.withState could return a null state, in practice
this won't happen because it is set early on during the sbt boot
commands.

After this change, I successfully ran the `ci` task in the #5992 issue
project with the same memory parameters as their ci config.
2020-10-21 08:01:40 -07:00
Ethan Atkins 78620cd902 Manage ansi codes and color codes separately
The ConsoleAppender formatEnabledInEnv field was being used both as an
indicator that ansi codes were supported and that color codes are
enabled. There are cases in which general ansi codes are not supported
but color codes are and these use cases need to be handled separately.
To make things more explicit, this commit adds isColorEnabled and
isAnsiSupported to the Terminal companion object so that we can be more
specific about what the requirements are (general ansi escape codes or
just colors). There are a few cases in ConsoleAppender itself where
formatEnabledInEnv was used to set flags for both color and ansi codes.
When that is the case, we use Terminal.isAnsiSupported because when that
is true, colors should at least work but there are terminals that
support color but not general ansi escape codes.
2020-10-21 08:01:12 -07:00
xuwei-k 37fa5573f0 improve remote cache extract log message
build.sbt

```
lazy val common = Def.settings(
  scalaVersion := "2.12.12",
  pushRemoteCacheTo := Some(
    MavenCache("local-cache", (ThisBuild / baseDirectory).value / "remote-cache")
  ),
  remoteCacheId := "fixed-id",
  remoteCacheIdCandidates := Seq(remoteCacheId.value)
)

pushRemoteCache := {}
pullRemoteCache := {}

lazy val p1 = project.settings(common)
lazy val p2 = project.settings(common)
lazy val p3 = project.settings(common)
lazy val p4 = project.settings(common)
lazy val p5 = project.settings(common)
lazy val p6 = project.settings(common)
lazy val p7 = project.settings(common)
lazy val p8 = project.settings(common)
lazy val p9 = project.settings(common)
```

run: `sbt pushRemoteCache clean pullRemoteCache`

before

```
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-test)
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-test)
```

after

```
[info] remote cache artifact extracted for p2:p2:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p9:p9:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p8:p8:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p7:p7:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p5:p5:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p1:p1:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p5:p5:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p7:p7:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p2:p2:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p8:p8:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p9:p9:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p1:p1:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p3:p3:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p3:p3:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p4:p4:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p4:p4:0.0.0-fixed-id Some(cached-test)
[info] remote cache artifact extracted for p6:p6:0.0.0-fixed-id Some(cached-compile)
[info] remote cache artifact extracted for p6:p6:0.0.0-fixed-id Some(cached-test)
```
2020-10-20 23:13:33 +09:00
eugene yokota 9f7985a2d9
Merge pull request #5991 from eed3si9n/wip/release-lint
Exclude keys starting with some prefixes from linting
2020-10-19 15:36:33 -04:00
Eugene Yokota 5d876dc287 Exclude keys starting with some prefixes from linting
Fixes https://github.com/sbt/sbt/issues/5849
2020-10-19 13:31:30 -04:00
Guillaume Martres c44e2c63bc Properly log the ClassfileManager output 2020-10-19 12:57:45 -04:00
eugene yokota 28833db333
Merge pull request #5983 from xirc/issues/5955
Add `shellPrompt` into excludeLintKeys
2020-10-18 04:06:28 -04:00
xuwei-k bbdd11150b remove unused code 2020-10-18 15:11:41 +09:00
xuwei-k d582dfc4be Scala-2-dependsOn-Scala-3 feature with Scala.js
fix 5971
2020-10-18 15:11:41 +09:00
Taichi Yamakawa cb7a08dfe2 Add `shellPrompt` into excludeLintKeys
Resolve the issue https://github.com/sbt/sbt/issues/5955
2020-10-18 14:54:54 +09:00
eugene yokota d0b8cf0984
Merge pull request #5932 from aaabramov/feature/3212/new-plugins-view
Brings new `plugins` command output message as per #3212
2020-10-11 13:19:16 -04:00
eugene yokota f02edee1d5
Merge pull request #5956 from adpi2/improve-bsp-reporter
Fix #5950: Better BSP reporting
2020-10-11 13:16:30 -04:00
eugene yokota 21c73c5bd7
Merge pull request #5967 from naderghanbari/fix-5959-dep-html
Fix #5959: dependencyBrowseGraph fails with Couldn't load 'graph.html'
2020-10-11 13:15:08 -04:00
eugene yokota b806d3ed3d
Merge pull request #5964 from rdesgroppes/detect-adoptopenjdk-on-macos
Detect AdoptOpenJDK on macOS
2020-10-11 13:12:15 -04:00
eugene yokota 916498c0c2
Merge pull request #5948 from adpi2/fix-custom-reporter
Fix #5935: Introduce bspReporter key
2020-10-11 13:10:34 -04:00
Nader Ghanbari 75be157679 Use cdnjs and github instead of samsarin.com 2020-10-11 12:03:32 -04:00