Commit Graph

9384 Commits

Author SHA1 Message Date
Eugene Yokota d8c9eb90c6 exclude inter-project resolvers when resolving the compiler bridge
Fixes #4669
2019-05-12 23:03:07 -04:00
eugene yokota c1d2e703b6
Merge pull request #4664 from eatkins/m3-io-fixes
M3 io fixes
2019-05-12 18:24:00 -04:00
Ethan Atkins b96be5343b Support char buffered stdin on windows in continuous
I finally realized that the trick is that for non cygwin windows, the
available method on the jline wrapped input stream always returns zero.
Unlike on posix, however, the read method is interruptible which means
that we can just spin up a background thread that polls from the input
stream and writes it into a buffer.

I verified that it was no longer necessary to hit <enter> after 'r' to
rerun the continuous command on my windows vm after this change.
2019-05-11 22:01:49 -07:00
Ethan Atkins 4b915ff69e Run more scripted tests on windows
Given that there are io differences between windows and posix systems,
we should aim to run the tests that do a lot of io on windows. There are
a few tests that don't work because of some platform specific issues so
I added a filter that excludes these tests on windows in ScriptedTests.
2019-05-11 22:01:49 -07:00
Ethan Atkins 8f54ecd536 Check meta build sources before task evaluation
This commit finally fixes #241 by adding support for sbt to either
print a warning or automatically reload the project if the metabuild
sources have changed. To facilitate this, I introduce a new key,
metaBuildSourceOption which has three options:
1) IgnoreSourceChanges
2) WarnOnSourceChanges
3) ReloadOnSourceChanges

When the former is set, sbt will not check if the meta build sources
have changed. Otherwise, sbt will use the buildStructure / fileInputs to
get the ChangedFiles for the metabuild. If there are any changes, it
will either warn or reload the build depending on the value of
metaBuildSourceOption.

The mechanism for diffing the files is that I add a step to EvaluateTask
where, if the project has been loaded and
metaBuildSourceOption != IgnoreSourceChanges, we evaluate the needReload
task. If we need a reload, we return an error that indicates that a
Reload is necessary. When that error is detected, the MainLoop will
prepend "reload" to the pending commands for the state. Otherwise we
just print a warning and continue.

I benchmarked the overhead of this and it wasn't too bad. I generally
saw it taking 5-20ms to perform the check. Since this is only done once
per task evaluation run, I don't think it's a big deal. When
IgnoreSourceChanges is set, there is O(10us) overhead. If performance
does become a problem, we could add a global watch service and skip the
needReload evaluation if no files have been modified.

I removed the watchTrackMetaBuild key and made it so that the continuous
builds only track the meta build when
metaBuildSourceOption == ReloadOnSourceChanges
2019-05-11 22:01:49 -07:00
Ethan Atkins 4007810adb Add watchPersistFileStamps key
The persistentFileStampCache does seem to work pretty well but in case
users encounter issues, I add a boolean flag that allows the user to
turn this behavior off and always re-stamp every source file in every
task evaluation run.
2019-05-11 22:01:48 -07:00
Ethan Atkins ec09e73437 Improve cache invalidation strategy
Previously the persistent attribute map was only reset when the file
event monitor detected a change. This made it possible for the cache to
be inconsistent with the state of the file system*. To fix this, I add an
observer on the file tree repository used by the continuous build that
invalidates the cache entry for any path for which it detects a change.
Invalidating the cache does not stamp the file. That only happens either
when a task asks for the stamp for that file or when the file event
monitor reports an event and we must check if the file was updated or
not.

After this change, touching a source file will not trigger a build
unless the contents of the file actually changes.

I added a test that touches one source file in a project and updates the
content of the other. If the source file that is only ever touched ever
triggers a build, then the test fails.

* This could lead to under-compilation because ExternalHooks would not
detect that the file had been updated.
2019-05-11 22:01:48 -07:00
Ethan Atkins 3d965799f3 Fix trigger bug
I got the if condition wrong which was setting the fileInputs to have a
LastModified stamp.
2019-05-11 21:34:02 -07:00
Ethan Atkins 8a456aef8a Always inject input tasks
I had tried to be cute and only inject certain tasks if they're actually
used, but that made it so that dynamic tasks may not have be able to use
them.
2019-05-11 21:34:02 -07:00
Ethan Atkins 40dc3ff7b3 Move json formatters
Organizationally this was sloppy with the FileStamp implementation
classes split by a bunch of json formatters.
2019-05-11 21:34:02 -07:00
Ethan Atkins f60d4060dd Fix toString for Update 2019-05-11 21:34:02 -07:00
Ethan Atkins b6ad077a72 Update io
The new io verion removes the PathFinder <-> Glob implicit translations.
It also has a number of small bug fixes related to directory listing via
FileTreeView.
2019-05-11 21:34:02 -07:00
Ethan Atkins 2ab8fed8fd Deprecation cleanup
The main project emits a number of deprecation warnings. I've isolated
the deprecation warnings related to Watch to the DeprecatedContinuous
file. I fixed the deprecation warnings where it was straightforward to
do so. After this change, there are three non-watch related changes
emitted:

1) Defaults.scala:3760 uses the deprecated InputTask.apply. This seems
   fixable but I'm not in a hurry
2) oldLoadFailed and oldLastGrep are used by Main. I think this could
   just be fixed by removing the deprecation warnings and setting them
   private[sbt] since they will still be available in the shell.
2019-05-11 21:34:02 -07:00
Ethan Atkins b15b638632 Remove unused private[sbt] key
This slipped through by mistake.
2019-05-11 21:34:02 -07:00
eugene yokota 9845bd40df
Merge pull request #4668 from eatkins/safer-meta-loader
Filter scala-library more safely
2019-05-12 00:26:37 -04:00
Ethan Atkins f9eb631b13 Filter scala-library more safely
I previously tried to fix https://github.com/sbt/sbt/issues/4608 in
fc715cab44 by finding the instance of
xsbt.boot.BootFilteredLoader in the classloader heirarchy. This was a
risky approach since it made a lot of assumptions about the classloaders
used to invoke xMain.run. Since the point is to filter out the scala
standard library jar, I reworked things to just find all the parents of
the scala provider loader and then walk the graph from the root
classloader until it finds the classloader that contains the scala
library. If no such classloader exists, it ends up returning the parent
of the scala provider library.

I also renamed the libraryLoader parameter to scalaProviderLoader since
that is what is actually passedin. It is actually the libraryLoader that
we want to exclude.
2019-05-11 19:45:25 -07:00
eugene yokota cf932c8a13
Merge pull request #4666 from eed3si9n/wip/coursierlog
silence coursier log when supershell is off
2019-05-11 19:39:21 -04:00
eugene yokota 19cf0cd691
Merge pull request #200 from eed3si9n/wip/bump
IO 1.3.0-M10, and nightly version
2019-05-11 19:29:24 -04:00
Eugene Yokota dec2ba2d07 IO 1.3.0-M10, and nightly version
Fixes #199
2019-05-11 15:56:28 -04:00
eugene yokota 1eb1db64a6
Merge pull request #4667 from eed3si9n/wip/parsekey
Reduce the test noise by making id more realistic
2019-05-11 10:41:52 -04:00
Eugene Yokota b4ea530036 reduce the example size to 1000 2019-05-11 04:52:42 -04:00
Eugene Yokota b18f3e8710 Reduce the test noise by making id more realistic
Fixes #3893

This fixes the flaky ParserSpec by making the id generation more realistic ASCII identifiers.
2019-05-11 03:55:34 -04:00
Eugene Yokota a0aa828238 format build.sbt 2019-05-11 03:42:06 -04:00
Eugene Yokota b96925bbda run 10000 examples to reduce flakiness 2019-05-11 03:41:41 -04:00
Eugene Yokota 7433f1f4ed make Coursier cache directory configurable 2019-05-11 01:11:07 -04:00
Eugene Yokota 9137e21028 silence coursier log when supershell is off 2019-05-11 00:56:40 -04:00
Eugene Yokota 1ba195a4f5 Refactor out keepPreloaded
Ref https://github.com/sbt/sbt/issues/4661
2019-05-11 00:13:22 -04:00
eugene yokota 83db3f16c8
Merge pull request #4663 from eed3si9n/wip/localpreloaded
exclude preloaded local repos for now
2019-05-10 20:54:26 -04:00
Eugene Yokota bcbd29f496 exclude preloaded local repos for now
Ref https://github.com/sbt/sbt/issues/4661
local-preloaded-ivy contains dangling ivy.xml without JAR files.
We might include local-preloaded again once we have a preloaded in Maven layout.
2019-05-09 23:34:37 -04:00
eugene yokota 10dc29b4b4
Merge pull request #4659 from eed3si9n/wip/jdkdetection
ignore bad SDKMAN directories
2019-05-09 13:31:44 -04:00
Eugene Yokota 4b9533b124 ignore bad SDKMAN directories
Fixes #4655
2019-05-09 01:59:03 -04:00
eugene yokota 405e4cd9be
Merge pull request #4658 from eatkins/zinc-component-launcher
Add launcher interface dependency
2019-05-09 01:18:32 -04:00
Ethan Atkins 02e78bd31d Add scalaXml to testingProj dependencies
This also seemed to be missing once the sbt metabuild classpath stopped
leaking into the compiler clAdd scalaXml to testingProj dependencies

This also seemed to be missing once the sbt metabuild classpath stopped
leaking into the compiler clAdd scalaXml to testingProj dependencies

This also seemed to be missing once the sbt metabuild classpath stopped
leaking into the compiler clAdd scalaXml to testingProj dependencies

This also seemed to be missing once the sbt metabuild classpath stopped
leaking into the compiler classpath.
2019-05-08 19:34:01 -07:00
Ethan Atkins 0d8f0816bc Add launcher interface dependency
Previously the zincLmIntegrationProj would compile if the meta build classpath
leaked into the compilation classpath. I found that the project would
not compile a clean build running an sbt built off of origin/develop.
2019-05-08 18:29:58 -07:00
eugene yokota 6e9a8241d4
Merge pull request #198 from eed3si9n/wip/plugins2
Bump sbt-whitesource
2019-05-04 02:31:29 -04:00
Eugene Yokota 96c91bb2a1 Drop 2.10 cross building 2019-05-04 02:23:55 -04:00
Eugene Yokota 74fb5cde9a Bump sbt-whitesource 2019-05-04 01:17:44 -04:00
eugene yokota f5edeec2fd
Merge pull request #4647 from eed3si9n/wip/progress
Remove State out of progressReports
2019-05-03 17:51:51 -04:00
Eugene Yokota e8a22bf805 Remove State out of progressReports 2019-05-03 16:44:42 -04:00
Eugene Yokota 668a0379eb sbt 1.3.0-M3 2019-05-03 16:43:52 -04:00
eugene yokota ac15eb516f
Merge pull request #4646 from dwijnand/projects-help-usage
Fix projects help usage text
2019-05-03 11:46:28 -04:00
Dale Wijnand f5495bdd67
Fix projects help usage text 2019-05-03 08:58:56 +01:00
eugene yokota 8fa3bcf90d
Merge pull request #4644 from eatkins/close-classloaders
Properly close a number of classloaders
2019-05-02 22:12:54 -04:00
eugene yokota cfa64e12d1
Merge pull request #4645 from eatkins/unnecessary-sleep
Unnecessary sleep
2019-05-02 22:04:39 -04:00
eugene yokota 5aeaa2981a
Merge pull request #4627 from eatkins/WIP-file-inputs
Add support for managed task inputs
2019-05-02 22:03:42 -04:00
Ethan Atkins 7f719d7233 Remove unnecessary sleep
I'm not sure what the previous purpose of this was, but syncTo is
blocking so this just seems to add 100ms to the run task startup time.
2019-05-02 14:43:00 -07:00
Ethan Atkins 67df72ab01 Properly close a number of classloaders
I discovered there were a number of places where closing a ClassLoader
didn't work correctly because I was assuming it was a URLClassLoader
when it was actually a ClasspathFilter. I also incorrectly imported the
wrong kind of URLClassLoader in Run.scala. Finally, I close the
SbtMetaBuildClassLoader when xMain exits now.
2019-05-02 14:38:33 -07:00
Ethan Atkins 924c6857d1 Add package/mappings to launcher base scripted tests
I don't understand why this wasn't failing before.
2019-05-02 14:36:08 -07:00
Ethan Atkins 540229986d Add disabled to list of valid scripted test names
I noticed that when I ran scripted locally (with no arguments) it was
hard to tell if they succeeded or not because the last test it ran was
metadata-only-resolver which had no valid test files and dumped a bunch
of lines to stderr. I noticed there were a number of tests that had
files named disabled but no other tests with a test named disable so I
renamed metadata-only-resolver to disabled..
2019-05-02 14:36:08 -07:00
Ethan Atkins 507346f3f6 Simplify file management settings
I decided that there were too many settings related to the file
management that did similar things and had similar names but did
slightly different things. To improve this, I introduce the ChangedFiles
class to sbt.nio.file and switch to having just two task for file input
and output retrieval: all(Input|Output)Files and
changed(Input|Output)Files. If, for example, changedInputFiles returns
None that means that either the task has not yet been run or there were
no changes. If there have been any changes, then it will return
Some(changes) and the user can extract the relevant changes that they
are interested in.

The code may be slightly more verbose in a few places, but I think it's
worth it for the conceptual clarity.
2019-05-02 14:36:08 -07:00