Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Feature/policy #24

Closed
wants to merge 712 commits into from
Closed

Conversation

aloiscochard
Copy link

No description provided.

adriaanm and others added 30 commits August 12, 2013 15:27
The license is a standard 3-clause BSD license.

We're publishing modules under org.scala-lang.modules.
This signals they are "just another Scala library":
  - cross-versioned (cross-versioning under org.scala-lang confuses sbt)
  - backward binary compatible (but not forward like the core)

Compile under Optimize/Deprecation/Features/Lint.
TODO: remove compilationpath param, same as task classpath
Not all test configurations handle an existing log file.

In particular, kicking off javac will append to the log file
and always fail the test.

Don't even ask how I know that.
Check files split into conditional blocks with partest flags
have been broken since the new diff regime.

For some reason, no one noticed.

The clever scheme to "filter the diff" instead of just filtering
the check file is abandoned as futile and unnecessary.

Fix java6 checkfile for ifdiff fix.
Testicolor just passed file arguments through; this commit does
either toAbsolute or getAbsoluteFile (depending on the File API
impedance mismatch) at ConsoleRunner (command line) and Runner
(ant supplies absolute paths, but in case sbt runner doesn't,
and who knows). It also sprinkles toAbsolute internally, where
it may be redundant. Do I mean redundant or redolent?

I noticed that my branch from last year relativized to test root
always; so this is one of those choices one commits to.

The point of breakage in this case was, if a path is not absolute,
use test root / path, which only works (of course) if the relative
path is relative to test root, which is no longer the case.

Because all paths are now calculated with respect to the test file
path, the "out" dir would change its relative path depending on
the invocation.
Fixing #ifdiff uncovered a latent bug in partest when it detects
paths to normalize in test log output.  It would not normalize
file separators for test names with non-word characters.

This commit normalizes the test name to the ticket number as a
workaround until the next partest version is picked up.

It also fixes partest in this repo in case we've not yet switched
over to the new repo.  A separate PR will be submitted to the new
repo as necessary.
This reverts commit 9ff138a,
as it introduced a binary incompatible change due to
scala@2b1563fa74
scalap depends on scala-compiler, which depends (for the scaladoc part)
on scala-xml and scala-parser-combinators

More precisely, scala-compiler_2.11.0-M5 depends on
                     scala-xml_2.11.0-M4 and
      scala-parser-combinators_2.11.0-M4,
so that we get a binary version incompatibility warning.

It isn't really a problem, but we should consider doing something about this.

My preference: modularize scaladoc.
The sbt-pgp plugin v0.8 contained an incorrect selection
of the dispatch library version (the _2.9.1 version is
selected). That also has the effect of making it
incompatible with dbuild. Fixed in sbt-pgp 0.8.1.
Bumb sbt-pgp version to 0.8.1, corrects "dispatch" version
(No longer needed once dbuild is up and running.)
The path was prematurely expanded to an absoulte path; later
it was treated as a relative path to "test".

A workaround is to use:

    % JAVA_OPTS=-Dpartest.srcdir=disabled test/partest test/disabled/neg/t7020.scala

    baseDir:             /Users/jason/code/scala/build/pack/lib
    sourceDir:           /Users/jason/code/scala/test/disabled

    Selected 1 tests drawn from specified tests

     starting 1 test in neg
    ok 1 - neg/t7020.scala

    1/1 passed (elapsed time: 00:00:04)
    Test Run PASSED

Which avoids the failure:

    test/partest --srcpath disabled disabled/neg/t7020.scala Discarding 1 invalid test paths
    Uncaught exception on thread Thread[main,5,main]: java.lang.RuntimeException: Directory 'test' not found.
    java.lang.RuntimeException: Directory 'test' not found.

I tested this commit with:

    % (cd /code/scala-partest && sbt 'set publishTo := Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))' publish)
    ...
    [info]  published scala-partest_2.11.0-M5 to /Users/jason/.m2/repository/org/scala-lang/modules/scala-partest_2.11.0-M5/1.0.0-SNAPSHOT/scala-partest_2.11.0-M5-1.0.0-SNAPSHOT.jar

    % git diff versions.properties
    diff --git a/versions.properties b/versions.properties
    index 865ce3e..0dd4369 100644
    --- a/versions.properties
    +++ b/versions.properties
    @@ -2,6 +2,6 @@ starr.version=2.11.0-M5

     # the below is used for depending on dependencies like partest
     scala.binary.version=2.11.0-M5
    -partest.version.number=1.0-RC5
    +partest.version.number=1.0.0-SNAPSHOT
     scala-xml.version.number=1.0-RC4
     scala-parser-combinators.version.number=1.0-RC2

    % rm build/pack/partest.properties

    % test/partest --srcpath disabled test/disabled/neg/t7020.scala
    ...
    sourceDir:           /Users/jason/code/scala/test/disabled

    Selected 1 tests drawn from specified tests

    # starting 1 test in neg
    ok 1 - neg/t7020.scala

    1/1 passed (elapsed time: 00:00:04)
    Test Run PASSED
lrytz and others added 25 commits September 2, 2014 16:33
…ready-where-was-summer

Conflicts:
	src/library/scala/util/matching/Regex.scala
…t-really-sept-2-already-where-was-summer

Conflicts:
	versions.properties
…lly-sept-2-already-where-was-summer

Merge 2.11 to 2.12
Conflicts:
	bincompat-backward.whitelist.conf
	bincompat-forward.whitelist.conf
	build.number
	build.xml
	partest/src/main/scala/scala/tools/partest/utils/Properties.scala
	src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala
	src/compiler/scala/tools/nsc/backend/jvm/BCodeTypes.scala
	src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
	src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
	src/compiler/scala/tools/nsc/transform/Delambdafy.scala
	src/compiler/scala/tools/nsc/transform/Erasure.scala
	src/compiler/scala/tools/nsc/transform/patmat/ScalacPatternExpanders.scala
	src/compiler/scala/tools/nsc/typechecker/Contexts.scala
	src/compiler/scala/tools/nsc/typechecker/Implicits.scala
	src/compiler/scala/tools/nsc/typechecker/Infer.scala
	src/compiler/scala/tools/nsc/typechecker/Namers.scala
	src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
	src/compiler/scala/tools/nsc/typechecker/Typers.scala
	src/eclipse/repl/.classpath
	src/interactive/scala/tools/nsc/interactive/Global.scala
	src/library/scala/collection/IterableProxy.scala
	src/library/scala/collection/MapProxy.scala
	src/library/scala/collection/TraversableProxy.scala
	src/scaladoc/scala/tools/nsc/doc/DocFactory.scala
	src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala
	src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala
	src/scaladoc/scala/tools/nsc/doc/Settings.scala
	src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala
	src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala
	test/files/run/t4461.check
	test/scaladoc/resources/code-indent.scala
	test/scaladoc/scalacheck/HtmlFactoryTest.scala
	versions.properties
After the merge there were three test failures:

  test/files/run/t8708_b
  test/files/jvm/future-spec
  test/files/jvm/varargs
SI-8803 generate super accessor for super[A], if A is outer superclass
One wasn't our doing, handled in last merge. The other two
were test output differences.
* origin/HEAD: (606 commits)
  Removed file which snuck back in during last merge.
  Clarification of accidental fiction.
  Readme tweaks.
  Looks like I'll need shorter version numbers.
  Waging the glorious battle against README scrollbars.
  Added license information.
  Added README.
  Update bootstrap compiler version to now-published 1.0.0-M4.
  Fix mima test.
  Bump version to prepare for artifact release.
  Addressing the three test failures.
  Integrating libsbt.
  SI-8786 disable part of test that's failing the jdk8 build
  Version tweaks.
  Remove ghostly bippy.
  scala 2.11.2.
  SI-8113 allow a newline between a link target and title
  SI-8810 scaladoc: fixed code block indentation normalization
  SI-8410 Summarize if warnings and not disabled
  SI-8410 Don't warn fatally on disabled flag
  ...

Conflicts:
	build.number
	src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
	src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css
	src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
	test/scaladoc/scalacheck/HtmlFactoryTest.scala
	versions.properties
@aloiscochard
Copy link
Author

Sorry I wanted to do that on my fork :-s

@aloiscochard aloiscochard deleted the feature/policy branch September 5, 2014 23:29
milessabin pushed a commit that referenced this pull request Aug 12, 2016
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```
milessabin pushed a commit that referenced this pull request Jul 31, 2017
Non local returns aren't eliminated after inlined in 2.11 or 2.12

```
⚡ scala
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.

scala> @inlune def foo(a: => Any) = if ("".isEmpty) a else ""
<console>:11: error: not found: type inlune
       @inlune def foo(a: => Any) = if ("".isEmpty) a else ""
        ^

scala> @inline def foo(a: => Any) = if ("".isEmpty) a else ""
foo: (a: => Any)Any

scala> class InlineReturn { def test: Any = foo(return "") }
defined class InlineReturn

scala> :javap -c InlineReturn#test
  public java.lang.Object test();
    Code:
       0: new           #4                  // class java/lang/Object
       3: dup
       4: invokespecial #32                 // Method java/lang/Object."<init>":()V
       7: astore_1
       8: getstatic     #36                 // Field $line4/$read$$iw$$iw$.MODULE$:L$line4/$read$$iw$$iw$;
      11: aload_1
      12: invokedynamic #59,  0             // InvokeDynamic #0:apply:(Ljava/lang/Object;)Lscala/Function0;
      17: invokevirtual #63                 // Method $line4/$read$$iw$$iw$.foo:(Lscala/Function0;)Ljava/lang/Object;
      20: goto          44
      23: astore_2
      24: aload_2
      25: invokevirtual #66                 // Method scala/runtime/NonLocalReturnControl.key:()Ljava/lang/Object;
      28: aload_1
      29: if_acmpne     39
      32: aload_2
      33: invokevirtual #69                 // Method scala/runtime/NonLocalReturnControl.value:()Ljava/lang/Object;
      36: goto          41
      39: aload_2
      40: athrow
      41: goto          44
      44: areturn
    Exception table:
       from    to  target type
           8    20    23   Class scala/runtime/NonLocalReturnControl
```

```
⚡ ~/scala/2.11.8/bin/scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.

scala> @inline def foo(a: => Any) = if ("".isEmpty) a else ""
foo: (a: => Any)Any

scala> class InlineReturn { def test: Any = foo(return "") }
defined class InlineReturn

scala> :javap -c InlineReturn#test
  public java.lang.Object test();
    Code:
       0: new           #4                  // class java/lang/Object
       3: dup
       4: invokespecial #13                 // Method java/lang/Object."<init>":()V
       7: astore_1
       8: getstatic     #19                 // Field .MODULE$:L;
      11: new           #21                 // class InlineReturn$$anonfun$test$1
      14: dup
      15: aload_0
      16: aload_1
      17: invokespecial #24                 // Method InlineReturn$$anonfun$test$1."<init>":(LInlineReturn;Ljava/lang/Object;)V
      20: invokevirtual #28                 // Method .foo:(Lscala/Function0;)Ljava/lang/Object;
      23: goto          39
      26: astore_2
      27: aload_2
      28: invokevirtual #31                 // Method scala/runtime/NonLocalReturnControl.key:()Ljava/lang/Object;
      31: aload_1
      32: if_acmpne     40
      35: aload_2
      36: invokevirtual #34                 // Method scala/runtime/NonLocalReturnControl.value:()Ljava/lang/Object;
      39: areturn
      40: aload_2
      41: athrow
    Exception table:
       from    to  target type
           8    26    26   Class scala/runtime/NonLocalReturnControl

scala> :quit
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.