Skip to content

Conversation

hamzaremmal
Copy link
Member

@hamzaremmal hamzaremmal commented Oct 15, 2025

We should probably add a TASTY attribute in the bytecode too but as a first glance, it looks very annoying to compute in the plugin.

Closes #24161

@hamzaremmal hamzaremmal marked this pull request as ready for review October 15, 2025 04:43
@hamzaremmal hamzaremmal requested a review from sjrd October 15, 2025 04:44
@som-snytt
Copy link
Contributor

you intend to link 24161

@hamzaremmal
Copy link
Member Author

you intend to link 24161

Indeed, thanks for catching this

@sjrd
Copy link
Member

sjrd commented Oct 15, 2025

The CI is not happy:

java.lang.IllegalArgumentException: Unsupported class file major version 12590

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

as a first glance, it looks very annoying to compute in the plugin.

Is it? Since we can assume the .tasty file is well-formed and compiled by our version of the compiler, it should be rather straightforward:

  1. Skip 4x4 = 16 bytes (magic number, major v, minor v, experimental v)
  2. Read 4 bytes as toolVersionLength
  3. Skip toolVersionLength bytes
  4. Read 16 bytes as uuidBytes

}

/* Remove Scala 2 Pickles from Classfiles */
private def unpickler(bytes: Array[Byte]): Array[Byte] = {
Copy link
Member

Choose a reason for hiding this comment

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

This is a very confusing name, as the "unpickler" in the compiler is the thing that actually decodes things. Consider

Suggested change
private def unpickler(bytes: Array[Byte]): Array[Byte] = {
private def removeScala2Pickles(bytes: Array[Byte]): Array[Byte] = {

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.

actively remove the pickle annotations when "copying" the class files over from Scala 2

3 participants