Skip to content

Conversation

@smarter
Copy link
Member

@smarter smarter commented Feb 27, 2019

As suggested by @adriaanm at some point.

When sbt is started with -Dscala.build.compileWithDotty=true, Dotty
will be used as the STARR (this is toggled by a property to avoid any
interference between sbt-dotty and the regular build). Using this,
we add compilation of the standard library using Dotty to the CI,
to make sure it's never unintentionally broken.

@scala-jenkins scala-jenkins added this to the 2.13.1 milestone Feb 27, 2019
@smarter smarter modified the milestones: 2.13.1, 2.13.0-RC1 Feb 27, 2019
@smarter smarter force-pushed the dotty-ci branch 2 times, most recently from 72362e7 to 02a57e7 Compare February 27, 2019 08:42
@smarter
Copy link
Member Author

smarter commented Feb 27, 2019

@SethTisue
Copy link
Member

CI failure is spurious (scala/scala-dev#617)

It was previously annotated with `@deprecatedInheritance` along with a bunch of
other annotations in 6e4d00e to make
upgrades smoother, but Dotty does not and is not planning to support
annotating a type with itself, and this is the last remaining issue to
compile the standard library with Dotty without any modification, so
just mark it `final` since I doubt extending this annotation was a
common occurence anyway.
When sbt is started with `-Dscala.build.compileWithDotty=true`, Dotty
will be used as the STARR (this is toggled by a property to avoid any
interference between sbt-dotty and the regular build). Using this,
we add compilation of the standard library using Dotty to the CI,
to make sure it's never unintentionally broken.
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall LGTM with a minor suggestion.

@SethTisue
Copy link
Member

you modified the Travis build, but I suggest the same change should be made in the Jenkins one in the scripts directory. (unless others on my team think it's not necessary)

we do have designs to fully switch from Jenkins to Travis, but we're not there yet. I'd say that the Jenkins one is the "real" one and the Travis one is still a somewhat experimental alternative.

(and, we're a bit nervous about the future of Travis, since its ownership has changed hands...)

@SethTisue
Copy link
Member

also, I am vaguely paranoid that the classfiles generated could end up being used downstream somehow. how sure are you that isn't an issue? (if not that sure, should it use an alternate target directory?)

@smarter
Copy link
Member Author

smarter commented Mar 12, 2019

also, I am vaguely paranoid that the classfiles generated could end up being used downstream somehow. how sure are you that isn't an issue?

Not sure what you mean, downstream of what ?

(if not that sure, should it use an alternate target directory?)

The classfiles end up in target/scala-0.14 so that's already different from the ones using the normal STARR.

@SethTisue
Copy link
Member

The classfiles end up in target/scala-0.14

👍 , then

(by downstream, I meant some later CI step (perhaps one that doesn't exist yet))

@smarter
Copy link
Member Author

smarter commented Mar 12, 2019

Ah I see, I think the best way to avoid that is to leave the Dotty stuff at the very end of the stuff executed by the ci.

@adriaanm adriaanm merged commit 525ac2f into scala:2.13.x Mar 18, 2019
adriaanm added a commit to adriaanm/scala that referenced this pull request Apr 2, 2019
Avoid unexpected class casts due to potential misuse in
subclasses of the following cunning trick, which allowed
for centralized implementation of common factory methods,
assuming the right overrides are provided in subclasses:
`protected type IterableCC[X] = CC[X] @uncheckedVariance`

Risk of not overriding correctly illustrated by
https://gist.github.com/lrytz/fe09791208969f07e211c5c8601db125.
It's basically an encoding of MyType, which is only sound under
pretty severe restrictions, which are not enforced by the
compiler.

Instead, we mix in a default implementation of the various
factory methods whenever we are in a trait where the
collection's type is known (and of the regular shape CC[A] or
MapCC[K, V]). It would be nice if we could conditionally mix in
this trait into the *Ops traits whenever `C =:= CC[A]`, but we
don't have that kind of inheritance (private inheritance would
be nice too, I guess, since the `*FactoryDefaults` traits don't
really add much utility to the public signature of these
collection classes).

While we're at it, also add an `empty` method at the top of the
hierarchy to facilitate the switch to dotty's for comprehensions
(since we want the stdlibs between Scala 2 & 3 to be the same,
and 2.14 will try to only make backwards compatible changes from
2.13).

Motivated by the intersection of scala#7458, scala#7929, scala#7800 (better
refchecks and compiling with dotc revealed part of the problem)

🤯

Co-authored-by: Lukas Rytz <[email protected]>
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.

6 participants