Commit Graph

9384 Commits

Author SHA1 Message Date
Eugene Yokota 3be8efc36e make Global / cancelable true by default
Fixes #3252
2019-04-25 12:14:37 -04:00
eugene yokota 3269eae533
Merge pull request #4606 from eed3si9n/wip/update
trim update and add updateFull
2019-04-25 12:13:22 -04:00
Dale Wijnand 9a56c0d005
Cleanup zinc-lm-integration 2019-04-25 12:01:33 +01:00
Dale Wijnand e978357e47
In-source zinc's LM integration code 2019-04-25 11:57:37 +01:00
Dale Wijnand b9b520f79e
Merge remote-tracking branch 'zinc-lm-intergration/bring-back-a-piece-of-zinc' into zinc-lm-integration
* zinc-lm-intergration/bring-back-a-piece-of-zinc: (90 commits)
  Add scala-integration resolver
  call it compiler-bridge_2.13
  bump Scala bridge to use 2.13.0-RC1
  Break the dependency on LM, and thus Ivy
  Skip Scala 2.10 and Scala 2.11 components for JDK 11
  Refactor compiler bridge unit test
  Fix the several typos detected by github.com/client9/misspell
  Got rid of multiple warnigns
  include only scala-library into the boot classpath during run
  Drop "final" modifier from private case classes, to prevent false positive. Refer https://issues.scala-lang.org/browse/SI-4440
  Support scala 2.13.0-pre-* & 2.13.0-M1
  Split compiler bridge tests to another subproject
  Remove unused imports + variables
  Add back, re-configure & re-enable Scalafmt
  Use Scala 2.12.3
  Remove any reference to `F0` and `F1`
  Adapt Zinc to use the new LibraryManagement API
  Fix ScalaFmt wiring
  Add scalaCompiler variant that accepts ModuleID
  Bump all the modules
  ...
2019-04-25 11:57:36 +01:00
Eugene Yokota 6c7faf2b86 trim update and add updateFull
Fixes #4438

This slims down update's UpdateReport by removing evicted modules
caller information. The larger the graph, the effect would be more
pronounced. For example, I saw a graph reduce from 5.9MB to 1.1MB in JSON file.
2019-04-23 14:08:17 -04:00
eugene yokota 4074cb32d3
Merge pull request #4605 from eed3si9n/wip/bumplm
bump to lm 1.3.0-M3
2019-04-23 13:52:08 -04:00
Eugene Yokota 3a355f6025 refactor project/transitive-plugins 2019-04-23 12:55:25 -04:00
eugene yokota 9b71ee1d6e
Merge pull request #4459 from alexarchambault/topic/update-classifiers-dependency-resolution
Have updateClassifiers use the dependencyResolution task
2019-04-21 19:18:01 -04:00
eugene yokota 0087f360aa
Merge pull request #4604 from eed3si9n/wip/progress2
move super shell rendering to logger
2019-04-21 17:58:58 -04:00
Eugene Yokota 2a206a6c40 Util 1.3.0-M6 2019-04-21 16:56:50 -04:00
eugene yokota 3568b13a2e
Merge pull request #196 from eed3si9n/wip/lock
move super shell rendering to ConsoleAppender
2019-04-21 15:40:11 -04:00
Eugene Yokota 465ff8e10a Make loggers synchronized
This is to workaround for "[success]" logs displaying after the prompt is displayed.
2019-04-21 04:03:22 -04:00
Eugene Yokota e28e052b5b move super shell rendering to ConsoleAppender
Ref https://github.com/sbt/sbt/issues/4583
This moves the super shell rendering to ConsoleAppender with several improvements.

Instead of scrolling up, supershell is now changed to normal scrolling down, with more traditional cursor position. Before printing out the logs, last known progress reports are wiped out. In addition, there's now 5 lines of blank lines to accomodate for `println(...)` by tasks.
2019-04-21 03:59:19 -04:00
Eugene Yokota 95761b2ea1 Undo cursor tweaks around prompt 2019-04-20 23:51:13 -04:00
eugene yokota 67dc4ca44b
Merge pull request #197 from eed3si9n/wip/scalafmt
sbt-scalafmt 2.0.0
2019-04-20 23:38:35 -04:00
Eugene Yokota c4d6efe5af move super shell rendering to logger
Fixes #4583
Ref https://github.com/sbt/util/pull/196
2019-04-20 23:32:42 -04:00
Eugene Yokota 98ec0075f4 apply formatting 2019-04-20 23:23:13 -04:00
Eugene Yokota 2ac7501c7c sbt-scalafmt 2.0.0 2019-04-20 23:21:31 -04:00
eugene yokota 00f292524f
Merge pull request #4623 from eed3si9n/wip/scalafmt
sbt-scalafmt 2.0.0
2019-04-20 19:56:24 -04:00
Eugene Yokota 621a72e49a workaround Scalafmt regex
Ref https://github.com/scalameta/scalafmt/issues/1404
2019-04-20 14:18:10 -04:00
Eugene Yokota 1e157b991a apply formatting 2019-04-20 03:23:54 -04:00
Eugene Yokota 78c007c910 sbt-scalafmt 2.0.0 2019-04-20 03:23:08 -04:00
eugene yokota 01781f07d0
Merge pull request #4622 from helena/add-build-and-version-badges
Add Travis build status badge and latest version badge #4621
2019-04-19 12:39:13 -04:00
Helena Edelson 4bec206e3b Add Travis build status badge and latest version badge #4621 2019-04-19 06:36:46 -07:00
Eugene Yokota 895c1d39ce Add scala-integration resolver 2019-04-18 17:28:01 -04:00
Eugene Yokota 9daae10ad9 call it compiler-bridge_2.13 2019-04-18 17:28:00 -04:00
Eugene Yokota 9c16938c6a bump Scala bridge to use 2.13.0-RC1
We are fairly certain we can maintain source-compatibility of compiler bridge from 2.13.0-RC to 2.13.x.

See also https://github.com/sbt/zinc/issues/78 :)
2019-04-18 17:28:00 -04:00
eugene yokota 7665de253f
Merge pull request #4616 from dwijnand/merge-in-1.2.x
Merge 1.2.x into develop
2019-04-18 11:59:55 -04:00
eugene yokota cd7d42db76
Merge pull request #4618 from dwijnand/Resolve-compilation-warnings-in-test/Delegates
Resolve compilation warnings in test/Delegates
2019-04-18 11:19:58 -04:00
Dale Wijnand 546476981c
Resolve compilation warnings in test/Delegates 2019-04-18 09:21:08 +01:00
Dale Wijnand 6fe8df21bb
Merge branch '1.2.x' into merge-in-1.2.x
* 1.2.x: (28 commits)
  More bumping up the 2.12 version to 2.12.8 in 1.2.x
  Bump the 2.12 version to 2.12.8 in 1.2.x
  define whitesourceOnPush
  lm 1.2.4
  1.2.7-SNAPSHOT
  implement TestConsoleLogger
  bump util, lm, and zinc
  Bump scalatest to 3.0.6-SNAP5
  Bump log4j2 to 2.11.1
  drop notification override
  Ignore files in scripted group dirs
  Fix '~' for dependent projects with a broken parent
  util 1.2.3, zinc 1.2.4
  lm 1.2.2
  Adjust the tests
  Set withMetadataDirectory by default
  Fix single repo emulation script
  add onLoadMessage
  check PluginCross.scala consisntency
  Bump modules
  ...
2019-04-18 09:03:16 +01:00
Dale Wijnand 146afdf8cd Break the dependency on LM, and thus Ivy
This patch breaks the dependency that Zinc had on sbt's Library
Management (LM) library abstraction (sbt/librarymanagement) and thus,
transitively, on Ivy.

The reason Zinc depends on LM in the first place is to dynamically
download the compiler bridge sources JAR, which it then compiles in
order to bridge from binary-compatible Zinc to the never-binary-stable
(and most of the time source-compatible) compiler API.

From my research (that is, using GitHub Search) the only user of this
feature is sbt, with all other integrations (e.g. pants, bloop, mill)
providing the compiler bridge sources JAR directly (an alternative API
entry point).

Therefore the dependency on LM and that integration code could be
untangled from Zinc and moved into sbt.  That would also give an
opportunity to move the code in LM (back) into sbt, which I also think
would be a good idea.

For now this patch leaves that integration code in the already existing
`zinc-ivy-integration` module, but which is now no longer a dependency
of any other module of Zinc, specifically it is no longer a dependency
of the `zinc` and `zincScripted` modules.  I think, though,
zinc-ivy-integration should remain in the zinc repo, as a part of the
build, being tested in CI, until it's been moved (back) into sbt.  I'd
be happy to take care of both the remaining move and removal tasks.

In order to allow removing LM, Ivy and zinc-ivy-integration as
transitive dependencies of Zinc, this patch has to make a breaking
change to the `ZincUtil` object in the zinc module.  Despite it being
defined in the `sbt.internal.inc` package (i.e. not declared as public
API) ZincUtil is in fact a used (Scala) API of Zinc (usages discovered
via GitHub Search).  Therefore I chose to leave the object in the zinc
module and only drop from the object the two methods that directly
depend on LM's API.  Specifically (1) the `getDefaultBridgeModule`
method and (2) the `scalaCompiler` overload that depends on LM were
removed.  These methods now live in a new `ZincLmUtil` object in
zinc-ivy-integration, which sbt can switch to using.

In terms of risk, from my research (GitHub Search) the only users of
those methods are sbt and bloop.  I need to confirm but I think bloop
will be able to manage this breaking change (it looks it might be just
fallback usage? TBC).  For sbt we don't actual support using new Zinc
with old sbt, so sbt can also just update its usage on its next release.
Any other usage risks being broken but given it's internal, non-public
API I think it's fair game.

The remaining changes are in the testing so that zinc-ivy-integration's
test suite continues to test its download-and-compile behaviour, while
the rest of Zinc switches to using the prebuilt compiler bridges,
reusing and generalising some pre-existing zincScripted code (as well as
re-wiring some modules) so it can be used by zinc's tests too.
2019-04-16 12:10:03 +01:00
Dale Wijnand c3f9ba1e6e
Merge pull request #4612 from dwijnand/sbt-buildinfo-0.9.0
Upgrade to sbt-buildinfo 0.9.0
2019-04-15 08:15:28 +01:00
Dale Wijnand b38a7486dd
Upgrade to sbt-buildinfo 0.9.0 2019-04-13 09:44:09 +01:00
Ethan Atkins cbfcedc9d6
Merge pull request #4610 from eatkins/scala-check
Scala check
2019-04-07 16:04:33 -07:00
Ethan Atkins fc715cab44 Don't leak the sbt boot scala library into tests
It was reported in https://github.com/sbt/sbt/issues/4608 that there was
a regression that tests run against scala 2.11 would fail. This was
because the interface loader incorrectly contained the scala library. To
fix this, I needed to find the xsbt.boot.BootFilteredLoader in the
classloading hierarchy and put the sbt testing interface library in
between that loader and the scala library loader.
2019-04-07 15:08:52 -07:00
Ethan Atkins c9aec02d05 Improve toString for flat classloader
It can be helpful to see what jars are available to the underlying url
classloader as well as what the parent classloader is.
2019-04-07 15:08:52 -07:00
Eugene Yokota bf44a6f446 add header 2019-04-06 02:08:21 -04:00
Eugene Yokota 8790a7b45d bump to lm 1.3.0-M3
This also adds `CustomHttp.okhttpClient` and `CustomHttp.okhttpClientBuilder` settings to experimentally customize HTTP client.
2019-04-05 15:28:49 -04:00
eugene yokota 473d42ac78
Merge pull request #195 from eed3si9n/wip/cache
throw error on deserialization error
2019-04-04 22:53:38 -04:00
eugene yokota b40084f6fd
Merge pull request #4602 from eatkins/layer-config
Improve error reporting for classloading issues
2019-04-04 22:32:15 -04:00
Eugene Yokota 7431dbdf1a throw error on deserialization error 2019-04-04 00:53:44 -04:00
Ethan Atkins 031e9463da Improve error reporting for classloading issues
We noticed that the community build was failing for some projects due to
some class loading issues. My initial approach for detecting the errors
didn't always work because the test framework might wrap the underlying
exception. To fix that, I add the causes to the list of throwables to
scan for class loading related exceptions. I also added
ClassNotFoundException to the list of types to check for. I additionally
added more context to the error message so that it is more clear to the
user what specifically went wrong. The error message is intended to
provide examples that the user can actually paste into the console.
There is also a lot of manual line wrapping that could be improved by
defining paragraphs and then splitting on the jline terminal width. That
could be a useful internal helper function to improve our log messages
in general.

The underlying issue could be addressed by allowing the user to specify
libraries that get excluded from the dependency classpath for layering
purposes. I'm not sure the best way to do that yet and adding that
feature wouldn't fix any existing builds so I think that would be better
handled in 1.4.0.
2019-04-03 11:02:49 -07:00
Ethan Atkins 5b1756fe60
Merge pull request #4601 from eatkins/improve-layers
Improve layers
2019-04-02 21:46:35 -07:00
Ethan Atkins 73cfd7c8bd Don't leak the sbt metabuild classpath in run/test
Prior to this commit, it was difficult to prevent the sbt metabuild
classpath from leaking into the runtime and test classpaths. The biggest
issue is that the test-inferface jar was located in the metabuild
classpath. We tried to prevent leakage using the DualClassLoader, but
this was an ugly solution that did not seem to work reliably. The fix is
to modify the actual sbt metabuild classloader provided by the sbt
launcher.

To do this, I add a new classloader SbtMetaClassLoader that isolates the
test-interface jar from the rest of the classpath. I modify xMain to
create a new AppConfiguration that uses this new classloader and
use reflection to invoke the sbt main method using the new classloader.

Not only do I think that this is a much saner solution than DualLoaders,
I accidentally fixed #4575 with this change.
2019-04-02 20:53:37 -07:00
Ethan Atkins 2c19138394 Fix classpath ordering for layered classloaders
The order of the classpath was not previously preserved because I
converted the runtime and test classpaths to set. I fix that in this
commit.
2019-04-02 20:53:37 -07:00
Ethan Atkins 399dd920b0 Set bgCopyClasspath false for shared layer config
It isn't possible to share the runtime and test layers correctly with
bgCopyClasspath is used because the runtime classpath uses the
dependencies copied to the boot directory while the test classpath uses
the classes in target and .ivy2. Since this is not the default and users
have to opt in to
ClassLoaderLayeringStrategy.ShareRuntimeDependenciesLayerWithTestDependencies,
I think this is fine.
2019-04-02 20:53:37 -07:00
Ethan Atkins a4f1d23d71 Close test and run classloaders
It's good practice to call close on a URLClassLoader when we're done
with it.
2019-04-02 20:53:37 -07:00
Ethan Atkins 8ef5a67b64 Add better error message if run fails
It is possible with the new layering strategies that tests may fail if a
java package private class is accessed across classloader layers. This
will result in an IllegalAccessError that is hard to debug. With this
commit, I add an error message that will be displayed if run throws an
IllegalAccessError that suggests that the user try the
ScalaInstance layering strategy or the flat layering strategy.
2019-04-02 20:53:37 -07:00