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

Reduce 2.12 / 2.13 Jar size by using instance constructors #1158

Merged
merged 1 commit into from
May 9, 2021

Conversation

joroKr21
Copy link
Collaborator

@joroKr21 joroKr21 commented May 8, 2021

Generate less anonymous classes for implicit instances,
esp. for tuple and function instances which are code generated.

Note: this slightly increases the Jar size on 2.11 because it doesn't translate to LambdaMetaFactory

@joroKr21 joroKr21 self-assigned this May 8, 2021
@joroKr21 joroKr21 force-pushed the jar-size branch 11 times, most recently from 5426a00 to b9942d9 Compare May 8, 2021 22:44
@joroKr21 joroKr21 changed the title Reduce Jar size by using SAM conversions and instance constructors Reduce 2.12 / 2.13 Jar size by using instance constructors May 8, 2021
Generate less anonymous classes for implicit instances,
esp. for tuple and function instances which are code generated.
@joroKr21 joroKr21 requested a review from milessabin May 9, 2021 06:26
@joroKr21 joroKr21 merged commit 9d254a3 into milessabin:series/2.3 May 9, 2021
@joroKr21 joroKr21 deleted the jar-size branch May 9, 2021 11:54
Copy link
Owner

@milessabin milessabin left a comment

Choose a reason for hiding this comment

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

Retrospectively ... LGTM!

@catostrophe
Copy link

catostrophe commented May 11, 2021

@joroKr21 this probably breaks bincompat on 2.12 only

Moving Aux from the *Instances trait to the object led to:

[error] Symbol 'type shapeless.ops.FnFromProductInstances.Aux' is missing from the classpath.
[error] This symbol is required by 'value io.circe.generic.decoding.IncompleteDerivedDecoders.ffp'.

@joroKr21
Copy link
Collaborator Author

@catostrophe that is surprising to me - I thought type aliases are erased and moving them around doesn't break binary compatibility. Also MiMa didn't complain. So maybe something more going on. Will have to investigate ...

@catostrophe
Copy link

@joroKr21 It works on 2.13.5, but fails on 2.12.13
I hope the provided details are sufficient to reproduce the issue

@joroKr21
Copy link
Collaborator Author

I opened lightbend-labs/mima#627
The fix is obvious - we will have to move the type aliases back to the traits

@catostrophe
Copy link

catostrophe commented May 26, 2021

Oh no. The whole circe family has been released with shapeless 2.3.6. It just breaks in compiletime with 2.3.7.

@catostrophe
Copy link

@joroKr21 could you add a comment to 2.3.6 release notes that it shouldn't be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants