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

Drop manually shaded version of circe #271

Merged
merged 1 commit into from
Mar 12, 2021
Merged

Conversation

oyvindberg
Copy link
Collaborator

@oyvindberg oyvindberg commented Mar 12, 2021

Ok, so this PR is good news and bad news.

The good news is that this will enable publication to maven central (partially solving #262 ).

For the bad news, it'll break builds. Let's start with some...

... Background

Circe is an amazing json library, and it's used in this sbt plugin and many others. However, it's not binary compatible across versions, and earlier on it caused a lot of friction where adding the ST plugin to a build would break other plugins (using a different version of circe). Before I fixed it, binary incompatibility with older versions of circe was the number one issue with the sbt plugin.

My fix was to manually shade all the circe modules, see https://github.com/ScalablyTyped/circe and https://github.com/ScalablyTyped/circe-jackson . All these modules were published to Bintray along with the converter. Note that this was not done lightly, because it's obviously not a very nice thing to do. I spent much time on this, and no other methods seemed to work. I really have enjoyed developing plugins for sbt - it's a fantastic tool - but this single issue ruins the experience.

Publication to maven central

Now that bintray is going away we'll need a new solution here. The manually shaded version should not be published in its current form to maven central where it'll be for all eternity.

So now I'm reverting that fix. This means that 1.0.0-beta31 will be broken for some users until a new solution is found.

If you read this issue I guess it'll have broken your build.

Short term options for now:

  • remain on 1.0.0-beta30 for a while longer
  • generate your ST artifacts in a separate sbt project with the source generation plugin. These can then be published as completely independent libraries.
  • use the CLI tool to generate your artifacts, it doesn't suffer from this problem. Note that the publication part of the CLI tool also needs to be rewritten as part of Migration from bintray #262)
  • identify your plugins with conflicting versions of circe and disable them or choose older/newer versions with a circe compatible with 0.11

Permanent solutions on the ST side:

  • figure out how to shade dependencies
  • port ST to use another json library without this problem. Note in that case that it has to be a lenient parser, because we're parsing json manually written by javascript developers
  • rewrite the above-mentioned forked circe repos to use a new package and new maven coordinates and port ST to that

Even more permanent solutions on the sbt side:

  • gently give the sbt maintainers a hint that you'd like to see a permanent fix with a classloader per sbt plugin

… of circe.

Did this break your build? I'm sorry, but it's completely impossible for me to figure out how to get shading of dependencies working.

Feel 100% to submit a PR with any solution to this, I don't have time or patience
@oyvindberg oyvindberg merged commit 003ae7f into master Mar 12, 2021
@oyvindberg oyvindberg deleted the drop-manually-shaded-circe branch March 12, 2021 21:12
oyvindberg added a commit that referenced this pull request Apr 2, 2021
oyvindberg added a commit that referenced this pull request Apr 2, 2021
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.

1 participant