Skip to content

Find most specific version of compiler interface sources#2106

Merged
eed3si9n merged 5 commits intosbt:0.13from
Duhemm:interface-specific-sources-clean
Jul 17, 2015
Merged

Find most specific version of compiler interface sources#2106
eed3si9n merged 5 commits intosbt:0.13from
Duhemm:interface-specific-sources-clean

Conversation

@Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Jul 15, 2015

Ref #681

This commit introduces a mechanism that allows sbt to find the most
specific version of the compiler interface sources that exists using
Ivy.

For instance, when asked for a compiler interface for Scala 2.11.8-M2,
sbt will look for sources for:

  • 2.11.8-M2 ;
  • 2.11.8 ;
  • 2.11 ;
  • the default sources.

This commit also modifies the build definition by removing the
precompiled projects and configuring the compiler-interface project so
that it publishes its source artifacts in a Maven-friendly format.

@eed3si9n eed3si9n added the ready label Jul 15, 2015
@typesafe-tools
Copy link

Can one of the admins verify this patch?

Copy link
Member

Choose a reason for hiding this comment

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

Glad to see this has a name :). Can you add a comment on what this class is meant to do?

@jsuereth
Copy link
Member

Genereally, LGTM. Great work!

@Duhemm Duhemm force-pushed the interface-specific-sources-clean branch from 1ebd4dc to 0df55a2 Compare July 15, 2015 13:37
@Duhemm
Copy link
Contributor Author

Duhemm commented Jul 15, 2015

Feedback addressed, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

This part feels stringy. I wonder if it could be represented as Vector[VersionNumber] and fold this cascade logic also into the class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I implemented it directly in VersionNumber, and moved the tests to VersionNumberSpec. The implementation is much shorter now :).

@eed3si9n
Copy link
Member

Yea. Generally this looks pretty awesome. Some minor comments/concerns.
I think this should accompany a page in sbt/website's developer guide section and a quick description and a link in the release note.

This commit introduces a mechanism that allows sbt to find the most
specific version of the compiler interface sources that exists using
Ivy.

For instance, when asked for a compiler interface for Scala 2.11.8-M2,
sbt will look for sources for:

 - 2.11.8-M2 ;
 - 2.11.8 ;
 - 2.11 ;
 - the default sources.

This commit also modifies the build definition by removing the
precompiled projects and configuring the compiler-interface project so
that it publishes its source artifacts in a Maven-friendly format.
@Duhemm Duhemm force-pushed the interface-specific-sources-clean branch from 0df55a2 to 90a8423 Compare July 16, 2015 09:19
@eed3si9n
Copy link
Member

Thanks for the update. LGTM pending Travis and notes.

@eed3si9n
Copy link
Member

So this test is failed on Travis twice a row, so it could be legit?

[error] DEBUGME: Clearing errors: ArrayBuffer()
[error] DEBUGME: Logging: /tmp/sbt_a3ae04a6/semantic-errors/src/main/scala/bad.scala:2:Error: type mismatch;
[error]  found   : Boolean(false)
[error]  required: Int
[info] [success] Total time: 1 s, completed Jul 16, 2015 12:04:50 PM
[info] [info] Defining *:compileOrder
[info] [info] The new value will be used by compile:compile::compileInputs, test:compile::compileInputs
[info] [info] Reapplying settings...
[info] [info] Set current project to semantic-errors (in build file:/tmp/sbt_a3ae04a6/semantic-errors/)
[info] [info] Compiling 1 Scala source and 1 Java source to /tmp/sbt_a3ae04a6/semantic-errors/target/scala-2.10/classes...
[info] [error] /tmp/sbt_a3ae04a6/semantic-errors/src/main/java/bad.java:3: incompatible types
[info] [error] found   : int
[info] [error] required: bad
[info] [error]     public bad foo() { return 1; }
[info] [error]                               ^
[info] [error] 1 error
[info] java.lang.AssertionError: assertion failed: Failed to report any problems!

@Duhemm
Copy link
Contributor Author

Duhemm commented Jul 16, 2015

scripted compiler-project/semantic-errors is fixed.
scripted dependency-management/mvn-local passes given that one has flushed Travis' caches before running it.

Duhemm added a commit to Duhemm/website that referenced this pull request Jul 16, 2015
Those are the notes for the mechanism implemented in sbt/sbt#2106.
@eed3si9n
Copy link
Member

scripted dependency-management/mvn-local passes given that one has flushed Travis' caches before running it.

Could you explain why that is? Do we have to change the test?

@jsuereth
Copy link
Member

@eed3si9n Martin is seeing odd stale cache issues unless he does that. The kind of issue that doesn't make any sense (i.e. failure to find a pom.xml file that was just published).

@jsuereth
Copy link
Member

@eed3si9n I'm cool merging this if you are.

eed3si9n added a commit that referenced this pull request Jul 17, 2015
Find most specific version of compiler interface sources
@eed3si9n eed3si9n merged commit 5824ef6 into sbt:0.13 Jul 17, 2015
@eed3si9n eed3si9n removed the ready label Jul 17, 2015
@eed3si9n
Copy link
Member

Merged

@dwijnand
Copy link
Member

Shall we merge sbt/website#172 too then?

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.

5 participants