Include sbt-ivy-snapshots to launchconfig
Prior to this change, the launchconfig for sbt was generated using
Transform's resource generator so releases would include
`typesafe-ivy-releases` repo, and snapshot releases would include
`typesafe-ivy-snapshots` and `sonatype-snapshots` repos in addition.
This is no longer useful since nightly builds are now published to
`sbt-ivy-snapshots` instead, which is backed by Bintray.
This removes the switching logic, so both `typesafe-ivy-releases` and
`sbt-ivy-snapshots` repos are always included into the launchconfig.
This removes the step of needing to download a launcher just to try the
nightly builds.
As described in #2336, I noticed that when using 0.13 nightly from
Bintray, sbt was unable to locate the compiler source.
Since `updateSbtClassifiers` is already set up to download sbt's own
sources, the `ivyConfiguration` should be reused. However, `compilers`
is a derived task, which is unable to depend on a scoped key.
To workaround this I had to create a new key called
`bootIvyConfiguration`. This should now use the metabuild's resolvers
to download the compiler bridge source.
Adds a new setting `useJCenter`, which is set to `false` by default.
When set to `true`, JCenter will be placed as the first external
resolver to find library dependencies.
The implementation of `externalResolvers` is changed to incorporate the
setting by calling `Resolver.reorganizeAppResolvers`. These changes
were required because `externalResolvers` uses whatever that's in the
launchconfig, which the build user may not upgrade.
Fix for regression triggered by #2325 -- apparently, the API visitor would
force all the lazy stubs so the `AbstractLazy` `writeReplace` was not exercised.
With the private subtrees being ignored, the visitor didn't force the lazy stub,
and the `writeProtected` method was not inherited in `SafeLazy.Impl`.
From https://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html
`writeReplace` must be protected for its override to be inherited.
> `Serializable` classes that need to designate an alternative object to be used
> when writing an object to the stream should implement this special method with
> the exact signature:
> `ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;`
>
> This `writeReplace` method is invoked by serialization if the method exists and
> it would be accessible from a method defined within the class of the object
> being serialized. Thus, the method can have `private`, `protected` and
> `package-private` access.
>
> **Subclass access to this method follows java accessibility rules.**
(Thanks to retronym for digging up the docs.)
The fix is captured, indirectly, by the scripted test
`source-dependencies/java-analysis-serialization-error`.
The crash manifested as a `NotSerializableException`,
because we don't visit the private subtrees of the API graph,
which would previously force all Lazy stubs as a side-effect.
There was a backstop in `AbstractLazy` (`writeReplace`), but
somehow that didn't work.
```
java.io.NotSerializableException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
[...]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:329)
at xsbt.api.SourceFormat$.writes(SourceFormat.scala:24)
at xsbt.api.SourceFormat$.writes(SourceFormat.scala:15)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:329)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:329)
at sbt.inc.TextAnalysisFormat21661anonfun at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.javr$.aggregate(TextAnalysisFormat.scala:18)
at sbt.inc.TextAnalysisFormat$.objToString(TextAnalysisFormat.scala:329)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:213)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:213)
at sbt.inc.TextAnalysisFormat21661anonfun21661writeMap.apply(TextAnalysisFormat.scala:381)
at sbt.inc.TextAnalysisFormat21661anonfun21661writeMap.apply(TextAnalysisFormat.scala:377)
at scala.collection.mutable.ResizableArray.foreach(Resizable at sbt.inc.TextAnalysisFormalection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at sbt.inc.TextAnalysisFormat$.sbt21661writeMap(TextAnalysisFormat.scala:377)
at sbt.inc.TextAnalysisFormat$.write(TextAnalysisFormat.scala:216)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:64)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:64)
at sbt.inc.TextAnalysisFormat21661anonfun.apply(TextAnalysisFormat.scala:64)
at sbt.inc.FormatTimer$.aggregate(TextAnalysisFo at sbt.inc.TextAnalysisFormat21661anonfun.scala:25)
at sbt.inc.TextAnalysisFormat$.write(TextAnalysisFormat.scala:64)
at sbt.inc.FileBasedStore21661anon21661anonfun.apply(FileBasedStore.scala:12)
at sbt.inc.FileBasedStore21661anon21661anonfun.apply(FileBasedStore.scala:12)
at sbt.Using.apply(Using.scala:24)
at sbt.inc.FileBasedStore21661anon.set(FileBasedStore.scala:12)
at sbt.inc.AnalysisStore21661anon.set(AnalysisStore.scala:16)
at sbt.inc.AnalysisStore21661anon.set(AnalysisStore.scala:27)
at sbt.Defaults21661anonfun.apply(Defaults.scala:799)
at sbt.Defaults21661anonfun at sbt.inc.TextAts.scala:793)
at scala.Function121661anonfun.apply(Function1.scala:47)
at sbt.21661anonfun21661u2219.apply(TypeFunctions.scala:40)
at sbt.std.Transform21661anon.work(System.scala:63)
at sbt.Execute21661anonfun21661anonfun.apply(Execute.scala:226)
at sbt.Execute21661anonfun21661anonfun.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute21661anonfun.apply(Exe at sbt.Using.apply(Using.scala:24)
mit.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions21661anon21661anonfun.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService21661anon.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors.call(Executors.java:439)
at java.util.concurrent.FutureTask.innerRun(FutureTask.java:303 at sbt.std.Transform21661anon.work(System(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
[error] (compile:compile) java.io.NotSerializableException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
[error] Total time: 2 s, completed Dec 21, 2015 12:05:19 PM
```
The NameHashing classes assumed that extracted API data structure have
private members filtered out already. That assumption was wrong and
resulted in bug #2324.
We fix the bug by simply reusing the same logic as used by SameAPI class.
Fixes#2324.
Mention that private members are being extracted and included in the api
structures but ignored in many other parts of incremental compiler. I've
made a mistake of assuming that private members are ignored at api
extraction time. This manifested itself as bug #2324.
Add a pending test that shows a bug in calculation of name hashes.
By design, only non-private members should contribute to name hashes. The
test shows that name hashes are calcuclated for strictly private members
too.
#1520 originally fixed#1514 by reimplementing part of chain resolver
to check all resolvers to find the latest snapshot artifacts.
This behavior did not work well with Maven repositories where sbt was
failing to calculate the correct publication dates.
Now that #2075 fixes the Maven integration issue we should enable this
flag back again.
The build user can opt out by:
updateOptions := updateOptions.value.withLatestSnapshots(false)
The checking code has bad run time characteristics and would need to be fixed
for large projects with deep task dependency chains.
The code in sbt.Execute has been in production for a long time so it seems safe
enough to drop the extra checks by default. To debug issues, you can set
`-Dsbt.execute.extrachecks=true` to revert to the old behavior.
Even though it's not really used, updateClassifiers constructs
dependency graph based on the result from update.
The direct cause of #2264 came from the fact that the `allModules`
returned from ConfigurationReport did not include dependency
configurations. For example it returned "compile" instead of
"compile->runtime". I've identified that in #2264 and was fixed by
@Duhemm in f49fb33e6d.
Martin identified that the fix still does not address the fact that
updateClassifier hardcodes the classifiers to be tried. This commit
adds the fallback behavior so for Ivy-published modules it will use the
explicit list of artifacts, and for others it will fallback to the
hardcoded list of classifiers.