Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Metals Scala 2.12 version to 2.12.13 #2404

Merged
merged 2 commits into from
Jan 18, 2021

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jan 18, 2021

Fixes #2403

@tgodzik tgodzik requested a review from ckipp01 January 18, 2021 17:25
V.scala211,
V.sbtScala,
V.scala212,
// TODO https://github.com/scalameta/metals/issues/2392
Copy link
Member

@ckipp01 ckipp01 Jan 18, 2021

Choose a reason for hiding this comment

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

Can we just bump the version of Ammonite right away to not have to worry about this? It looks like it's available for 2.12.13 -> 2.3.8-32-64308dc3. Or were you purposefully not including that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So turns out there was a regression, but once com-lihaoyi/Ammonite#1146 is released we can upgrade.

Copy link
Member

@ckipp01 ckipp01 Jan 18, 2021

Choose a reason for hiding this comment

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

Regressions this week...

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Great job tackling all the stuff needed for this @tgodzik! LGTM!

@tgodzik
Copy link
Contributor Author

tgodzik commented Jan 18, 2021

It seems the change to semanticdb versions does not allow for Metals to specify the semanticdb definition now :sigh:

@ckipp01
Copy link
Member

ckipp01 commented Jan 18, 2021

It seems the change to semanticdb versions does not allow for Metals to specify the semanticdb definition now :sigh:

So is this #2401 causing our 4.4.6 to be overwritten by the SemanticdbPlugin value, 4.4.0?

@tgodzik
Copy link
Contributor Author

tgodzik commented Jan 18, 2021

It seems the change to semanticdb versions does not allow for Metals to specify the semanticdb definition now :sigh:

So is this #2401 causing our 4.4.6 to be overwritten by the SemanticdbPlugin value, 4.4.0?

Yeah, I think we cannot differentiate between the default and the a version set by the user. What about selecting the newest version? Similar to other dependencies?

@ckipp01
Copy link
Member

ckipp01 commented Jan 18, 2021

It seems the change to semanticdb versions does not allow for Metals to specify the semanticdb definition now :sigh:

So is this #2401 causing our 4.4.6 to be overwritten by the SemanticdbPlugin value, 4.4.0?

Yeah, I think we cannot differentiate between the default and the a version set by the user. What about selecting the newest version? Similar to other dependencies?

Yea we can do that, but if we select the newest we sort of have the inverse problem, where if someone is trying to set 4.4.0 they won't be able to since we'll just choose the one we provide since it's newer? Is that ok? I can see that being really confusing to a user... sometimes the version I set works, whereas other times it gets overridden.

@tgodzik
Copy link
Contributor Author

tgodzik commented Jan 18, 2021

It seems the change to semanticdb versions does not allow for Metals to specify the semanticdb definition now :sigh:

So is this #2401 causing our 4.4.6 to be overwritten by the SemanticdbPlugin value, 4.4.0?

Yeah, I think we cannot differentiate between the default and the a version set by the user. What about selecting the newest version? Similar to other dependencies?

Yea we can do that, but if we select the newest we sort of have the inverse problem, where if someone is trying to set 4.4.0 they won't be able to since we'll just choose the one we provide since it's newer? Is that ok?

I think so, we wouldn't want the users to use an older version, which might have some issues still. Although, I am actually unable to fix the error. It always tries to download 4.4.0/

@ckipp01
Copy link
Member

ckipp01 commented Jan 18, 2021

It seems the change to semanticdb versions does not allow for Metals to specify the semanticdb definition now :sigh:

So is this #2401 causing our 4.4.6 to be overwritten by the SemanticdbPlugin value, 4.4.0?

Yeah, I think we cannot differentiate between the default and the a version set by the user. What about selecting the newest version? Similar to other dependencies?

Yea we can do that, but if we select the newest we sort of have the inverse problem, where if someone is trying to set 4.4.0 they won't be able to since we'll just choose the one we provide since it's newer? Is that ok?

I think so, we wouldn't want the users to use an older version, which might have some issues still. Although, I am actually unable to fix the error. It always tries to download 4.4.0/

Alright, #2406 seems to fix it.

EDIT: ugh, I should have branched off this to test it, not main. Give me a sec to try that.

@ckipp01
Copy link
Member

ckipp01 commented Jan 18, 2021

Alright, the change I added on top in here #2407 seems to do what we want.


override lazy val projectSettings: Seq[Def.Setting[_]] = Seq(
semanticdbCompilerPlugin := {
("org.scalameta" % "semanticdb-scalac" % semanticdbVersion.value)
.cross(CrossVersion.full)
if (supportedScala2Versions.contains(scalaVersion.value))
Copy link
Contributor Author

@tgodzik tgodzik Jan 18, 2021

Choose a reason for hiding this comment

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

@ckipp01 what about this? I think this might have been the actual problem, we should not set semanticdbCompilerPlugin if we don't currently support the given scala version. If a user had the Metals plugin and semanticdbEnabled := true then we would have replaced the original without actually needing to do it. So it would break user's builds even though Metals does not support the given version.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, that makes sense 👍🏼 . So if it's not in our supported versions, we just default to what they want. The only problem (and I don't know how to get around) is that for some reason if someone wants to bump the semanticdb version while using a Scala version that we do support, they can't.

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 think it's fine, we update the semanticdb version often enough. There should be no actual need to do it manually. Besides, if the user modifies the version we cannot know if it actually supports the given Scala version. Metals should be a source of truth here the same as with Bloop.

@tgodzik tgodzik enabled auto-merge January 18, 2021 19:49
@tgodzik tgodzik merged commit d932719 into scalameta:main Jan 18, 2021
@tgodzik tgodzik deleted the update-scala-212 branch January 18, 2021 20:55
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.

Current snapshots are throwing exceptions and not working.
2 participants