Commit Graph

11353 Commits

Author SHA1 Message Date
eugene yokota 22a9fd4de0
Merge pull request #5158 from eatkins/scripted-parser
Scripted parser fixes
2019-10-07 14:27:50 +02:00
Ethan Atkins ae84e162ad Limit scripted page numbers
The completions were generating page numbers that didn't make sense if
there were a small number of scripted tests. For example, suppose that
there were only two tests defined, it would generate *1of3 *2of3 and
*3of3 completions even though there weren't even three tests.
2019-10-06 14:07:30 -07:00
Ethan Atkins 9dff18d736 Fix scripted parser crash
In a local progress, I was able to induce a crash in tab completions
because the group key did not exist in pairMap.
2019-10-06 14:07:30 -07:00
eugene yokota 11bc90c481
Merge pull request #5157 from eatkins/safe-clean
Clean ivy resolution cache before regular clean
2019-10-06 06:38:54 -04:00
Ethan Atkins 5d8b94de55 Clean ivy resolution cache before regular clean
The way clean was implemented, it was running `clean`, `ivyModule` and
`streams` concurrently. This was problematic because clean could blow
away files needed by `ivyModule` and `streams`. To fix this, move the
cleanCachedResolutionCache into a separate task and run that before the
normal clean.

Should fix https://github.com/sbt/sbt/issues/5067.
2019-10-05 16:42:16 -07:00
Eugene Yokota 460d1f5aa7 Rename to lintUnused for clarification
Address other review comments
2019-10-04 09:04:43 -04:00
Eugene Yokota 3a96ffa2cf include lintBuild as part of reload command 2019-10-03 23:40:21 -04:00
Eugene Yokota 765c451832 add lintBuild task to warn on unsed settings
Fixes https://github.com/sbt/sbt/issues/3183

This implements an input task  lintBuild that checks for unused settings/tasks.
Because most settings are on the intermediary to other settings/tasks, they are included into the linting by default. The notable exceptions are settings used exclusively by a command. To opt-out, you can either append it to `Global / excludeLintKeys` or set the rank to invisible.

On the other hand, many tasks are on the leaf (called by human), so task keys are excluded from linting by default. However there are notable tasks that trip up users, so they are opted-in using `Global / includeLintKeys`.
2019-10-03 23:40:21 -04:00
eugene yokota 22a6ff5d57
Merge pull request #5148 from eatkins/supershell-console
Clear supershell lines before suppressed task
2019-10-03 20:46:28 -04:00
eugene yokota ee471a2a82
Merge pull request #5151 from eatkins/scripted-timeout
Add timeout to scripted statements
2019-10-03 20:45:57 -04:00
eugene yokota 5ed3de9b94
Merge pull request #5152 from eed3si9n/wip/xenial
Switch to xenial image
2019-10-03 20:43:37 -04:00
eugene yokota 5f07701b7b
Merge pull request #5146 from eed3si9n/wip/bak
Fixes "Could not create directory ...classes.bak"
2019-10-03 20:41:44 -04:00
Ethan Atkins cce8358115 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-03 15:36:32 -07:00
Ethan Atkins 155526fb11 Add timeout to scripted statements
Sometimes scripted tasks hang in ci and they are effectively impossible
to debug. To workaround this, I add a five minute timeout to any
scripted test and print the log if the test fails.
2019-10-03 15:34:53 -07:00
Eugene Yokota 9cf3243407 Fixes "Could not create directory ...classes.bak"
Fixes https://github.com/sbt/sbt/issues/1673

There's been report of intermittent "Could not create directory" error related to "classes.bak." retronym identified that all configurations are using the same directory, and that might be the cause of race condition.
This addresses the issue by assigning a unique directory for each configuration.
2019-10-03 17:37:50 -04:00
Jason Zaugg e062a61bfe Reproducer for the symptoms described in #1673 2019-10-03 17:37:50 -04:00
Eugene Yokota 2cd134cb61 Switch to xenial image
The majority of Travis CI builds have probalby migrated to using Xenial now, so it's better to migrate with the pack.
2019-10-03 17:18:14 -04:00
Ethan Atkins d05e6580af
Merge pull request #5150 from eatkins/repo-override
Revert "mark dependency-management/default-resolvers pending"
2019-10-03 14:02:31 -07:00
Ethan Atkins 1ef931741c Revert "mark dependency-management/default-resolvers pending"
This reverts commit b47ed4e62a.
The test started passing recently.
2019-10-03 12:10:29 -07:00
eugene yokota 7540fac248
Merge pull request #295 from azolotko/5135-detect-more-memory-settings
Detect more memory settings
2019-09-30 15:35:24 -04:00
eugene yokota f72990123f
Merge pull request #5112 from eed3si9n/wip/root
Throw error if you run sbt from /
2019-09-30 15:04:25 -04:00
Margus Sipria 108611ca25 Fix for JUnitXmlTestsListener that is removing part of test name when it contains dot (#5139)
Fix for JUnitXmlTestsListener removing part of test when it contains dot
Fixes https://github.com/sbt/sbt/issues/5114
Fixes https://github.com/sbt/sbt/issues/2949
2019-09-30 10:47:15 -04:00
eugene yokota 0bdde4aee8
Merge pull request #5137 from eed3si9n/wip/hedgehog
Use Scala Hedgehog in ParseKey test
2019-09-30 10:43:40 -04:00
Alex Zolotko 1ac4c7400a Detect more memory settings
Fixes sbt/sbt#5135
2019-09-30 13:40:04 +02:00
Eugene Yokota 1cfe14a877 Ignore the build ref case 2019-09-30 02:18:11 -04:00
Eugene Yokota d1993bcabb use hedgehog.Result 2019-09-30 02:09:02 -04:00
Eugene Yokota f2de61c681 check for ambiguous project names 2019-09-30 01:56:03 -04:00
Eugene Yokota 073c89059e make URI longer to avoid conflict 2019-09-30 01:56:00 -04:00
Eugene Yokota ad1596c400 increase example count 2019-09-30 01:53:50 -04:00
Charles O'Farrell 67a3eca698 Use hedgehog in ParseKey, Delegates, and ParserSpec test 2019-09-30 01:52:57 -04:00
eugene yokota 91146a2d9d
Merge pull request #293 from er1c/travis
Fix No compatible version found for adopt@1.8.212-04
2019-09-28 15:49:15 -04:00
eugene yokota dca44d570d
Merge pull request #5131 from eatkins/deadlock
Make internal classloaders parallel capable
2019-09-28 15:20:41 -04:00
Eric Peters a114398c71 Fix No compatible version found for adopt@1.8.212-04 2019-09-28 06:59:34 -07:00
Ethan Atkins feb8c84b28 Bump travis java 8 version 2019-09-27 13:23:42 -07:00
Ethan Atkins a12bccf4a3 Use java to implement XMain classloaders
These classloaders which are created if sbt is launched with a legacy
launcher (or one that doesn't follow the current classloading hierarchy
convention), were implemented in scala, but that meant that they were
not parallel capable. I fix that by moving the implementations to java.
I also move the static method that creates a MetaBuildLoader into the
java class.
2019-09-27 13:23:42 -07:00
Ethan Atkins 8fd10bfb5f Make all test and run classloaders parallel capable
A number of users were reporting issues with deadlocking when using
1.3.2: https://github.com/sbt/sbt/issues/5116. This seems to be because
most of the sbt created classloaders were not actually parallel capable.
In order for a classloader to be registered as a parallel capable, ALL
of the parent classes except for object in the class hierarchy must be
registered as a parallel capable:
https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#registerAsParallelCapable--.
If a classloader is not registered as parallel capable, then a global
lock will be used internally for classloading and this can lead to deadlock.

It is impossible to register a scala 2 classloader as parallel capable
so I ported all of the classloaders to java.

This commit updates the java-serialization scripted test. Prior to the
port, the new version of the test would more or less always deadlock.
After this change, I haven't been able to reproduce a deadlock.

This had no significant performance impact when I reran
https://github.com/eatkins/scala-build-watch-performance
2019-09-27 13:23:42 -07:00
Eugene Yokota 563bcb93aa Throw error if you run sbt from /
Fixes #1458

Running sbt from `/` results to sbt getting stuck trying to load the directories recursively, and eventually erroring with a java.lang.OutOfMemoryError (after freezing for a long time) even on an Alpine container.

To prevent it, this adds a check to see if the absolute path is `/` or not.

```
/ $ sbt -Dsbt.version=1.4.0-SNAPSHOT
[error] java.lang.IllegalStateException: cannot run sbt from root directory without -Dsbt.rootdir=true; see sbt/sbt#1458
[error] Use 'last' for the full log.
```
2019-09-26 17:11:29 -04:00
eugene yokota 198dab9f39
Update DEVELOPING about nightlies (#5133)
Fixes https://github.com/sbt/sbt/issues/4489
2019-09-25 23:19:58 -04:00
Ignasi Marimon-Clos 7a87a9e02e Indicate `r`etry is the option applied if users just press RETURN (#4748)
The message:

```
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
```

is not explicit about retry being the option used when pressing return.
2019-09-25 21:33:19 -04:00
eugene yokota 23e0f6ebee
Merge pull request #291 from eed3si9n/wip/v
--verbose mode for Windows
2019-09-25 11:20:21 -04:00
eugene yokota dba0e5c82f
Merge pull request #290 from eed3si9n/wip/quote2
Fix equal sign handling for -D
2019-09-25 11:18:05 -04:00
Eugene Yokota 8caa28b57b --verbose mode for Windows 2019-09-25 07:45:16 +01:00
Eugene Yokota 98efb989db Fix equal sign handling for -D
Fixes sbt/sbt#2695
By the time the arguments are passed to a batch script,
it seems like  is parsed away.
for /F did not work since it would not handle double quoted
paths that include whitespaces.
This adds special handling for -D parameters only.
2019-09-25 06:57:07 +01:00
eugene yokota 9fc62e5ef5
Merge pull request #288 from er1c/versions
Add --numeric-version, --script-version, and update --version to print both versions
2019-09-24 21:03:35 -04:00
eugene yokota 0c9ac98b08
Merge pull request #225 from eatkins/divide-by-zero
Divide by zero
2019-09-24 20:54:20 -04:00
Eric Peters 56cdfcaa90 Add --numeric-version, --script-version, and update --version to print both versions 2019-09-24 16:55:57 -07:00
Ethan Atkins 9c2dd05b6a Avoid possible divide by zero
On the off chance that in some configurations the terminal width is set
to zero, avoid an exception by returning 0 for terminal lines. It is
likely that supershell will not work well if terminal width is zero, but
that's better than a potential crash (I think the crash would be in the
progress background thread, so I'm not sure how bad it would be, but
still its good to avoid).
2019-09-24 16:35:03 -07:00
Ethan Atkins 5cfab4c9a9 Cleanup implementation of progress report
It was a bit cleaner to consolidate `extra` and
(previousLines|info).length into prevLength and currentLength.
2019-09-24 16:33:42 -07:00
Ethan Atkins 0e69402660
Merge pull request #5126 from eatkins/fg-run
Close classloader in fgRun/fgRunMain
2019-09-24 15:26:49 -07:00
Ethan Atkins 3a27c7c37d
Merge branch 'develop' into fg-run 2019-09-24 13:50:56 -07:00