Skip to content

Merge/2.11.x to 2.12.x 20160203 [ci: last-only]#4941

Merged
retronym merged 54 commits intoscala:2.12.xfrom
retronym:merge/2.11.x-to-2.12.x-20160203
Feb 4, 2016
Merged

Merge/2.11.x to 2.12.x 20160203 [ci: last-only]#4941
retronym merged 54 commits intoscala:2.12.xfrom
retronym:merge/2.11.x-to-2.12.x-20160203

Conversation

@retronym
Copy link
Member

@retronym retronym commented Feb 3, 2016

% git co -b merge/2.11.x-to-2.12.x-20160203 origin/2.12.x
Branch merge/2.11.x-to-2.12.x-20160203 set up to track remote branch 2.12.x from origin.
Switched to a new branch 'merge/2.11.x-to-2.12.x-20160203'

% export MB=$(git merge-base head origin/2.11.x)

% transcript git log --graph --oneline --decorate $MB...origin/2.11.x
https://gist.github.com/1a3acdfcb215a9f62756

% git merge bf599bc
Auto-merging versions.properties
CONFLICT (modify/delete): src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js deleted in HEAD and modified in bf599bc. Version bf599bc of src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js left in tree.
Auto-merging src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
CONFLICT (content): Merge conflict in src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
Auto-merging src/reflect/scala/reflect/internal/Symbols.scala
Auto-merging src/library/scala/math/package.scala
Auto-merging src/library/scala/concurrent/duration/Duration.scala
Auto-merging src/compiler/scala/tools/nsc/typechecker/Contexts.scala
CONFLICT (content): Merge conflict in src/compiler/scala/tools/nsc/typechecker/Contexts.scala
Auto-merging src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
Auto-merging src/compiler/scala/tools/nsc/transform/patmat/Logic.scala
Auto-merging src/compiler/scala/tools/nsc/transform/UnCurry.scala
Auto-merging src/compiler/scala/tools/nsc/transform/Constructors.scala
CONFLICT (content): Merge conflict in src/compiler/scala/tools/nsc/transform/Constructors.scala
CONFLICT (modify/delete): src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala deleted in HEAD and modified in bf599bc. Version bf599bc of src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala left in tree.
Auto-merging src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala
Auto-merging project/Osgi.scala
Auto-merging build.sbt
Automatic merge failed; fix conflicts and then commit the result.

% git commit -a
[merge/2.11.x-to-2.12.x-20160203 9535599] Merge commit 'bf599bc' into merge/2.11.x-to-2.12.x-20160203

% git log bf599bc..8c50d84
commit 8c50d842a39e2a5f02aca462b834ab2b0c2a14af
Author: Som Snytt <som.snytt@gmail.com>
Date:   Thu Jan 7 14:38:49 2016 -0800

    [backport] SI-9616 False positive in unused import warning

    This is a minimal backport of the fix for SI-9383.

% git merge -sours 8c50d84
Merge made by the 'ours' strategy.

% git merge cc6fea6
Auto-merging test/junit/scala/reflect/ClassTagTest.scala
Auto-merging src/library/scala/concurrent/Future.scala
Auto-merging src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
Auto-merging src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
Auto-merging src/compiler/scala/reflect/quasiquotes/Parsers.scala
Auto-merging scripts/jobs/integrate/bootstrap
CONFLICT (content): Merge conflict in scripts/jobs/integrate/bootstrap
Auto-merging build.sbt
CONFLICT (content): Merge conflict in build.sbt
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.

% git commit
[merge/2.11.x-to-2.12.x-20160203 b1a6fc2] Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203

janekdb and others added 30 commits September 30, 2015 22:01
Tested on Ubuntu 14.04.3 LTS.

SUMMARY

   1. Use `set -e` to ensure ant failure bails script.
   2. Make best effort to display scaladoc build diff.
   3. Quiet output from git checkout.
   4. Prefer plumbing over porcelain when getting hashes.
   5. Use short hashes to enhance output readability.
   6. Use branch name when available.
   7. Ensure scaladoc copies are clean.
   8. Remove redundant use of scaladoc-compare.
   9. Improve message formatting.
  10. Use $(...) instead of backticks for more legible code.
  11. Pause after reporting missing old file.
  12. Report missing new files.

DETAILS

1. Use `set -e` to ensure an ant failure bails the script. Turn off before
diff because diff returns an error code when the compared files differ,
which is expected to be seen.

2. Make best effort to display scaladoc build diff preferring graphical
clients.

opendiff is a Mac OS X command that opens a graphical diff display, meld
is a graphical client for Ubuntu and other distros. On Ubuntu fallback to
gvimdiff which will display graphically if possible otherwise in the
console. Ultimately default to diff.

Command detection taken from,

  http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script

3. Quiet output from git checkout to avoid detached head warning.

The user does not need to see the detached head warning when running this.

4. Prefer plumbing over porcelain to avoid 'not found' error when getting
SHA1s.

Calling get-scala-commit-sha errors out on Ubuntu 14.04.3 with
Bash 4.3.11 with these messages,

    tools/get-scala-commit-sha: 11: tools/get-scala-commit-sha: [[: not found
    tools/get-scala-commit-sha: 17: tools/get-scala-commit-sha: Bad substitution

5. Use short hashes to enhance output readability.

6. Use branch name when available.

If the branch name is not used when the working directory is restored
after checkout out the parent commit we will be in a detached HEAD
state. Make a best effort to avoid that.

7. Ensure scaladoc copies are clean.

Remove previous copy of scaladoc to ensure consistent behaviour on runs
past the first.

8. Remove use of scaladoc-compare because the equivalent functionality is
provided when iterating the new files.

9. Improve message formatting.

10. Use $(...) instead of backticks for more legible code.

11. Pause after reporting missing old file.

Without this pause it was easy to miss the message when we had this
sequence of differences,

 * differing files
 * missing file
 * differing files

12. Report missing new files.

Along with reporting new files with no corresponding old file report the
complementary scenario.
It's useful to know that log is the natural logarithm, not 10log or 2log or so.
Also did sqrt "while I was at it"
Under -optimize, the pattern matcher tries to avoid local variables
in favour of directly accessing to non-var case class accessors.

However, the code that analysed the patterns failed to account
properly for repeated parameters, which could either lead to
a compiler crash (when assuming that the n-th subpattern must have
a corresponding param accessor), or could lead to a correctness
problem (when failing to eagerly the bound elements from the
sequence.)

The test case that tried to cover seems only to have been working
because of a separate bug (the primary subject of SI-9567) related
to method-local case classes: they were treated during typechecking
as extractors, rather than native case classes.

The subsequent commit will fix that problem, but first we must
pave the way with this commit that emits local vals for bound
elements of case class repeated params.
Typechecking constructor patterns of method local case classes
was only working because of the existence of the unapply method
in the companion, which is used if navigation to the case class
companion object fails.

We now support defintion of, and pattern matching on, case classes
with more than 22 parameters. These have no `unapply` method
in the companion, as we don't have a large enough tuple type to
return. So for such case classes, the fallback that we inadvertently
relied on would no longer save us, and we'd end up with a compile
error advising that the identifier in the constructor pattern was
neither a case class nor an extractor.

This is due to the propensity of `Symbol#companionXxx` to return
`NoSymbol` when in the midst of typechecking. That method should
only be relied upon after typechecking. During typechecking,
`Namers#companionSymbolOf` should be used instead, which looks in the
scopes of enclosing contexts for symbol companionship. That's
what I've done in this commit.
- Create the directory for the output file when building an OSGi
  bundle. Otherwise a publishing command would fail if dist/mkPack had
  not been run before.

- Depend only on “packagedArtifact” in “mkPack”, not on “packageBin”.
  The latter is sbt’s standard packaging task but some of the required
  dependencies need to be packaged as OSGi bundles.
- Fix the scoping of files/lib/*.jar. These files were not on the
  classpath when running partest from sbt.

- Pass the same standard Java options to partest as from the command
  line. This requires new versions of scala-partest and
  scala-partest-interface.

- Fix the classpath scanning in jvm/innerClassEnclMethodJavaReflection.
  It only worked for JARs and relative directories but not for absolute
  directory paths (which are produced by sbt).
This allows partest to be run from the command line on the artifacts
produced by the sbt build. The actual location for partest.properties
is hardcoded in the partest script as build/pack/partest.properties.
This will have to be changed when we make sbt the default build tool.
To test this now you can manually copy the generated file from
build-sbt/quick/partest.properties to build/pack/partest.properties.
Fixes the index/length comparison in `Vector#take` and `Vector#drop` so that they handle all possible integer values.

Given the collection's invariants `startIndex >= endIndex` and `0 >= startIndex, endIndex`, it is sufficient to change the arithmetic in the comparison as done in this commit to avoid overflows. As cases when `n <= 0` are handled beforehand, `endIndex - n` cannot overflow, contrary to `startIndex + n`. If without the danger of overflows the condition yields true, on the other hand, `startIndex + n` cannot overflow as it is smaller than `endIndex` (as the previous formulation of the condition shows).
Also

 - Fix grammar on duplicated DecorateAsJava comment by copying over from
   JavaConverters
 - Remove author tags
Bug fixes for the sbt build and partest
SI-9581 Fix overflow on Vector take and drop methods
The alternative choice was to change "Hide All" to "Hide all" to match existing
capitalization but title case fits for this UI.
…ization

Apply title case to Scaladoc buttons: By Inheritance & Show All
Document JavaConverters conversion from java.util.Properties to Map
SI-9567 Fix pattern match on 23+ param, method local case class
Script to compare the current scaladoc with the parent commit's doc
Docs for >> operation of integer types (from Byte to Long) had a wrong
direction saying that it is bit-shift left.
The links were being skipped with a warning before this commit.

The key change was to remove the result type and add an asterisk.
This is a minimal backport of the fix for SI-9383.
# Improve version handling in the sbt build:

The new settings `baseVersion` and `baseVersionSuffix` make it easier
to set version numbers for different kinds of builds in a consistent
way without e.g. having to first get a git SHA outside of sbt.

The new task `generateBuildCharacterPropertiesFile` writes the file
`buildcharacter.properties` to the root dir. The format is compatible
with the same file produced by the ANT build but it only contains a
subset of the properties, in particular the Maven version, which is
needed in publishing scripts and passed around between different
Jenkins jobs as `jenkins.properties`.

SHAs in version numbers are consistently shortened to 7 digits (as used
by git and github). Previously we used 7 digits in Maven snapshot
version numbers but 10 digits in canonical and OSGi version numbers.

# Add Jenkins script support to the sbt build:

The new command `setupPublishCore` takes the PR validation snapshot
repository as an argument and changes the required settings for the
`publish-core` build (use SHA-SNAPSHOT versioning, compile with
optimization enabled, do not publish scaladoc sets)

For example, the following command can be used to generate
`buildcharacter.properties` with the version numbers needed for PR
validation builds:

  sbt setupPublishCore dummy generateBuildCharacterPropertiesFile

The sbt build will now automatically detect and use a “~/.credentials”
file with the credentials for publishing to a remote repository.

# Call sbt from `publish-core`:

The correct`$SBT_CMD` is set directly in `bootstrap` and used by
`publish-core` to first generate `buildcharacter.properties` and then
build and publish. Parsing the git revision, computing a version
number and getting binary dependencies are no longer required in the
script. This is all done in the sbt build.
Binary search should be used for every `IndexedSeqLike` instance and not only for `IndexedSeq`. According the Scaladoc, it is `IndexedSeqLike` that guarantees "constant-time or near constant-time element access and length computation".
SI-8641 Fix right shift docs for integer types
SI-9605 Searching does not use binary search for Array
…inks

Fix Scaladoc overloaded method link to Duration companion object
The the word 'the' is often used twice. Fix that.
SethTisue and others added 10 commits January 27, 2016 10:44
This commit adds explicit checks with syntax errors for tuple literals
and types of more than 22 elements. An alternative approach to fixing
SI-9572 would be to revert to the old failure mode of Scala 2.10 where
references to arbitrary `scala.TupleXY` would be generated in the
parser, which then leads to “type/object not found” errors in the
typechecker. This fix here is more intrusive but arguably provides a
better user experience.

Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to
`Parsers` because they can now generate syntax errors. New methods
`makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking
on top of `makeTupleType` and `makeTupleTerm`. They are overridden with
no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
SI-9534 Use BoxedUnit in all cases for creating Array[Unit]
SI-9572 Check for illegal tuple sizes in the parser
 Conflicts:
	src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala
	src/compiler/scala/tools/nsc/transform/Constructors.scala
	src/compiler/scala/tools/nsc/typechecker/Contexts.scala
	src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
	src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js
@scala-jenkins scala-jenkins added this to the 2.12.0-M4 milestone Feb 3, 2016
@retronym retronym changed the title Merge/2.11.x to 2.12.x 20160203 [ci:lastOnly] Merge/2.11.x to 2.12.x 20160203 [ci:last-only] Feb 3, 2016
@retronym retronym changed the title Merge/2.11.x to 2.12.x 20160203 [ci:last-only] Merge/2.11.x to 2.12.x 20160203 [ci: last-only] Feb 3, 2016
@retronym retronym closed this Feb 3, 2016
@retronym retronym reopened this Feb 3, 2016
@retronym retronym mentioned this pull request Feb 3, 2016
20 tasks
@retronym retronym force-pushed the merge/2.11.x-to-2.12.x-20160203 branch from 896348b to da46355 Compare February 3, 2016 23:19
@retronym
Copy link
Member Author

retronym commented Feb 4, 2016

Needed to merge 2.12.x onto this PR because of a new, trivial conflict in versions.properties.

@retronym
Copy link
Member Author

retronym commented Feb 4, 2016

/rebuild

@lrytz
Copy link
Member

lrytz commented Feb 4, 2016

Anything to review, or all conflicts were easy to fix?

@retronym
Copy link
Member Author

retronym commented Feb 4, 2016

Review of the end result of build.sbt by @szeiger.

Other conflicts were straightforward enough. There was a big typo-fixing commit that caused some trivial conflicts.

@szeiger
Copy link
Contributor

szeiger commented Feb 4, 2016

LGTM

retronym added a commit that referenced this pull request Feb 4, 2016
Merge/2.11.x to 2.12.x 20160203 [ci: last-only]
@retronym retronym merged commit 353c305 into scala:2.12.x Feb 4, 2016
@adriaanm adriaanm added 2.12 and removed 2.12 labels Oct 29, 2016
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.