Skip to content

new TASTy header format - add experimental version and tooling version fields #11343

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

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented Feb 8, 2021

Here we adds fields for experimental and tooling versions.

  • ExperimentalVersion: Nat, when reading non-zero and
    we are non-zero, the file must be at same version.
    Otherwise if we are non-zero, the file must have
    zero experimental version, and must be of strictly
    lower minor version.
  • ToolingVersion: String, an arbitrary UTF-8 string
    that says the name+version of the tooling that
    produced the file. We could reinterpret to mean
    the "minimum" version required to read that file,
    but that would require more process to record that.

fixes #10375

@bishabosha
Copy link
Member Author

bishabosha commented Feb 8, 2021

This should be reformulated to again swap MinorVersion for (ScalaMajorVersion and ScalaMinorVersion) and include a string field for the compiler version, for error messages, as the compiler could be a fork, or another language.

@bishabosha bishabosha marked this pull request as draft February 8, 2021 15:05
@bishabosha bishabosha marked this pull request as ready for review February 10, 2021 12:30
@bishabosha bishabosha changed the title new TASTy header format - remove MinorVersion, add 3 new fields new TASTy header format - add experimental version and tooling version fields Feb 10, 2021
@bishabosha
Copy link
Member Author

bishabosha commented Feb 10, 2021

For reviewers, I need to know advice on what should be the contents of the "toolingVersion" field in the header, for example, should we record somewhere the "minimum" compiler version that is compatible with the current TASTy version (and expose it in dotty.tools.dotc.config.Properties), or always pickle the current compiler version.

Also, since #11167 we have been providing the option to return the fields in the header to the user, and we are generating new String objects to store the compiler version, should there be some caching? (note that we do not have access to the Names cache)

Here we adds fields for experimental and tooling versions.

- ExperimentalVersion: Nat, when reading non-zero and
  we are non-zero, the file must be at same version.
  Otherwise if we are non-zero, the file must have
  zero experimental version, and must be of strictly
  lower minor version.
- ToolingVersion: String, an arbitrary UTF-8 string
  that says the name+version of the tooling that
  produced the file. We could reinterpret to mean
  the "minimum" version required to read that file,
  but that would require more process to record that.
@bishabosha bishabosha requested a review from sjrd February 11, 2021 13:44
sjrd
sjrd previously approved these changes Feb 11, 2021
@bishabosha
Copy link
Member Author

A fun representation of what is implemented:
Screenshot 2021-02-11 at 17 42 57

@bishabosha bishabosha merged commit 0273336 into scala:master Feb 12, 2021
@bishabosha bishabosha deleted the tasty-version-scheme branch February 12, 2021 18:37
@Kordyjan Kordyjan modified the milestones: 3.0.0-RC1, 3.0.0 Aug 2, 2023
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.

TASTy format versioning scheme
5 participants