Skip to content

WIP: 0.13.8 backports#2

Open
adriaanm wants to merge 382 commits into0.13.8from
0.13.8-backports
Open

WIP: 0.13.8 backports#2
adriaanm wants to merge 382 commits into0.13.8from
0.13.8-backports

Conversation

@adriaanm
Copy link
Owner

Backported the following PRs to 0.13.8, with corresponding merge commits

Merge transcript:

g co -b 0.13.8-backports v0.13.8

g merge -s ours 2cb9694^
g log ..2cb9694
g merge 2cb9694
g rm -f notes/0.13.9.markdown 
g add -u
g commit

g merge -s ours 303b068^
g merge 303b068
g co HEAD ivy/src/main/scala/sbt/MakePom.scala ivy/src/main/scala/sbt/ivyint/CachedResolutionResolveEngine.scala ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala ivy/src/main/scala/sbt/JsonUtil.scala
g commit

g merge be8175b
g merge -s ours 66af3ad^
g merge 66af3ad
g co -f HEAD  main/src/main/scala/sbt/Project.scala ivy/src/test/scala/CachedResolutionSpec.scala ivy/src/test/scala/BaseIvySpecification.scala compile/src/main/scala/sbt/compiler/AnalyzingCompiler.scala
g commit

g merge b7c331b267
g merge 53ef1c5
g merge -s ours d3cb469^ -m"No-op merge to base of #2261"
g merge d3cb469 -m"Merge #2261 ExtractAPI considers method sigs before & after erasure"
g merge bad824c0b1 -m"Merge #2325 Do not compute name hashes for private members."

g commit -m"Bump to scala 2.10.6, version as -SNAPSHOT by default"

g co inc-comp-stable-self 
g rebase -i 0.13.8-backports
g co 08383a2850 compile/interface/src/main/scala/xsbt/ExtractAPI.scala
grc
g co e13d075e16 compile/interface/src/main/scala/xsbt/Dependency.scala
grc

eed3si9n and others added 30 commits June 9, 2015 18:10
This provides a convenience function for running an input task from the
extracted state. This is particularly useful for commands, release steps
etc that may want to run input tasks, like scripted.
Provide more diagnostic info for undefined settings
To pass File => Unit callback across the classloader boundary
I am encoding it as a java.util.List[File] by overriding
 method.
This was needed since Java didn't allow me to cast
from one classloader to the other.
Bumping up Scala version to 2.10.5/2.11.6. Fixes sbt#1666, Ref sbt#1980
This matters when someone tries to locally build sbt from source.
Adds bundledLauncherProj to allProj
Fixes sbt#2043. bintrayRelease is repeated 20x?
…abc51ec93

When I went digging into Ivy's code base I discovered that it's been
checking if the repository layout pattern ends with M2_PATTERN to use
maven-metadata.xml, which for sbt would return false since we customize
the mattern -
https://github.com/apache/ant-ivy/blob/2.3.0/src/java/org/apache/ivy/plu
gins/resolver/IBiblioResolver.java#L497-L499
Reinstate SNAPSHOT test that was fixed in sbt#1520/sbt#1514
Fixes sbt#2005. Bump to ivy 2.3.0-sbt-c5d1b95fdcc1e1007740ffbecf4eb07abc…
Fixes sbt#1973. Renames distinct to distinctName
eed3si9n and others added 22 commits December 14, 2015 11:38
Bumping Scala version to 2.10.6.
…-checks

Fixes sbt#2302. Don't check pre and post conditions in sbt.Execute by default
Consider signatures of methods before and after erasure in ExtractAPI
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.
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 sbt#2324.
The NameHashing classes assumed that extracted API data structure have
private members filtered out already. That assumption was wrong and
resulted in bug sbt#2324.

We fix the bug by simply reusing the same logic as used by SameAPI class.

Fixes sbt#2324.
Conflicts:
  - ivy/src/main/scala/sbt/JsonUtil.scala
  - ivy/src/main/scala/sbt/MakePom.scala
  - ivy/src/main/scala/sbt/ivyint/CachedResolutionResolveEngine.scala
  - ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala
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
```
@adriaanm adriaanm force-pushed the 0.13.8-backports branch 2 times, most recently from 83d2c12 to 170db58 Compare December 22, 2015 06:11
Fix for regression triggered by sbt#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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.