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

unhelpful error when TASTy version is not compatible #18427

Closed
som-snytt opened this issue Aug 21, 2023 · 3 comments · Fixed by #18828
Closed

unhelpful error when TASTy version is not compatible #18427

som-snytt opened this issue Aug 21, 2023 · 3 comments · Fixed by #18828
Assignees
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc area:tasty-format issues relating to TASTy as a portable standard better-errors Issues concerned with improving confusing/unhelpful diagnostic messages itype:bug

Comments

@som-snytt
Copy link
Contributor

Compiler version

3.x

Minimized code

Use cats-effect 3.5 or 3.4 with Scala 3.0.

Output

[info] Setting Scala version to 3.0.2 on 1 projects.
[info] Reapplying settings...
[info] ...
[error] error while loading $throws$package$,
[error] class file scala/runtime/$throws$package.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
[error] TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 2}
[error]
[error] This TASTy file was produced by a more recent, forwards incompatible release.
[error] To read this TASTy file, please upgrade your tooling.
[error] The TASTy file was produced by Scala 3.2.2-bin-nonbootstrapped.
[error] error while loading package$,
[error] class file cats/package.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
[error] TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 2}

Expectation

It would be helpful if the error message linked to the currently canonical explanation, which is currently the blog at https://www.scala-lang.org/blog/2022/08/17/long-term-compatibility-plans.html

Even better would be instructions that said plainly that the artifact is not "broken" but I must upgrade the compiler to some version V.

I understand, to some extent, how class files work.

This directive is surprisingly ambiguous:

[error] To read this TASTy file, please upgrade your tooling.

You mean my compiler version or something that produced the jar file or what?

Wikipedia lists how class file format versions are associated with spec versions, but nothing tells me what tool understands 28.2 tasty.

Noticed at:

https://discord.com/channels/632150470000902164/632628489719382036/1142924560325423246

Although I was specifically testing Scala x Cats versions, it's easy to imagine someone has been happily using Scala 3.n and then wants to try Lib m.p and it breaks obscurely.

@som-snytt som-snytt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 21, 2023
@bishabosha
Copy link
Member

there's an attempt at a better message here: #17411

@nicolasstucki nicolasstucki added area:tasty-format issues relating to TASTy as a portable standard area:reporting Error reporting including formatting, implicit suggestions, etc and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 21, 2023
@bishabosha bishabosha added the better-errors Issues concerned with improving confusing/unhelpful diagnostic messages label Oct 10, 2023
@bishabosha bishabosha changed the title Broken tasty message is not entirely explanatory unhelpful error when TASTy version is not compatible Oct 10, 2023
@odersky
Copy link
Contributor

odersky commented Oct 29, 2023

@bishabosha No action on #17411 since May. Can you take it over, maybe?

@bishabosha
Copy link
Member

I can do it

bishabosha added a commit that referenced this issue Nov 3, 2023
…ion of header unpickler (#18828)

fixes #18427

Adds configuration ability to `TastyHeaderUnpickler`, why? `tasty-core`
is intended to be a generic library, so for its error messages to
suddenly assume the consumer is a scala compiler would be a breaking
change, so we instead by default use a generic configuration (the old
"tooling" style) and allow to plug-in a "scala compiler" configuration

Also the configuration allows us to easily test the content of error
messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc area:tasty-format issues relating to TASTy as a portable standard better-errors Issues concerned with improving confusing/unhelpful diagnostic messages itype:bug
Projects
None yet
4 participants