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

Update metaconfig-typesafe-config to 0.9.16 #1522

Conversation

scala-steward
Copy link
Contributor

Updates com.geirsson:metaconfig-typesafe-config from 0.9.15 to 0.9.16.
GitHub Release Notes - Version Diff

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.

Configure Scala Steward for your repository with a .scala-steward.conf file.

Have a fantastic day writing Scala!

Files still referring to the old version number

The following files still refer to the old version number (0.9.15).
You might want to review and update them manually.

CONTRIBUTING.md
Ignore future updates

Add this to your .scala-steward.conf file to ignore future updates of this dependency:

updates.ignore = [ { groupId = "com.geirsson", artifactId = "metaconfig-typesafe-config" } ]

labels: library-update, early-semver-minor, semver-spec-patch, old-version-remains, commit-count:1

@bjaglin bjaglin force-pushed the update/metaconfig-typesafe-config-0.9.16 branch from 5ce2119 to 364db76 Compare January 21, 2022 20:53
@bjaglin
Copy link
Collaborator

bjaglin commented Jan 21, 2022

[error] /home/runner/work/scalafix/scalafix/scalafix-rules/src/main/scala/scalafix/internal/rule/DisableSyntaxConfig.scala:112:12: value literal is not a member of object pprint.TPrint
[error]     TPrint.literal("List[Regex]")

Caused by https://github.com/com-lihaoyi/PPrint/pull/72/files#diff-492a668d78a78a50945e22826d563419a9c827b6164bca4bfedb3a7c4f66d551L17

It looks like c66f24d has no effect since https://github.com/scalacenter/scalafix/pull/907/files#diff-fa445c2f97a1bfb229caa4cd2fdc97cb9c243ddac155698a132bcbdb22970910R91

@bjaglin bjaglin force-pushed the update/metaconfig-typesafe-config-0.9.16 branch from 364db76 to f303fe7 Compare January 21, 2022 21:26
@bjaglin
Copy link
Collaborator

bjaglin commented Jan 21, 2022

[error] /home/runner/work/scalafix/scalafix/scalafix-cli/src/main/scala/scalafix/internal/v1/Args.scala:511:12: value make is not a member of object pprint.TPrint
[error]     TPrint.make[AbsolutePath](_ => "<path>")
[error]            ^
[error] /home/runner/work/scalafix/scalafix/scalafix-cli/src/main/scala/scalafix/internal/v1/Args.scala:513:12: value make is not a member of object pprint.TPrint
[error]     TPrint.make[PathMatcher](_ => "<glob>")
[error]            ^
[error] /home/runner/work/scalafix/scalafix/scalafix-cli/src/main/scala/scalafix/internal/v1/Args.scala:515:12: value make is not a member of object pprint.TPrint
[error]     TPrint.make[Conf](implicit cfg => TPrint.implicitly[ScalafixConfig].render)
[error]            ^
[error] /home/runner/work/scalafix/scalafix/scalafix-cli/src/main/scala/scalafix/internal/v1/Args.scala:520:12: value make is not a member of object pprint.TPrint
[error]     TPrint.make { implicit cfg =>
[error]            ^
[error] /home/runner/work/scalafix/scalafix/scalafix-cli/src/main/scala/scalafix/internal/v1/Args.scala:526:12: value make is not a member of object pprint.TPrint
[error]     TPrint.make { implicit cfg =>
[error]            ^
[error] 5 errors found

Caused by https://github.com/com-lihaoyi/PPrint/pull/72/files#diff-492a668d78a78a50945e22826d563419a9c827b6164bca4bfedb3a7c4f66d551L23

@tgodzik
Copy link
Contributor

tgodzik commented Jan 21, 2022

@bjaglin it should be possible to work around it similar to how I did it in mdoc: https://github.com/scalameta/mdoc/pull/603/files#diff-a8b31f6574d70bc4d9f927ba67d848b1161bceb085b9248a50f50338c70bfac7R304

This reverts commit c66f24d, which was
no longer used since 1547da5, and
no longer compiles with the metaconfig bump bringing
com-lihaoyi/PPrint#72
.
@bjaglin bjaglin force-pushed the update/metaconfig-typesafe-config-0.9.16 branch from f303fe7 to eb894c4 Compare January 22, 2022 20:42
pprint.TPrint (brough by metaconfig) has now 2 different signatures
because metaconfig is pinned for 2.11.

// scala 2.11
trait TPrint[T] {
  def render(implicit tpc: TPrintColors): String
}

// scala 2.12+
trait TPrint[T] {
  def render(implicit tpc: TPrintColors): fansi.Str
}
@bjaglin bjaglin force-pushed the update/metaconfig-typesafe-config-0.9.16 branch from eb894c4 to de374ad Compare January 22, 2022 21:37
@bjaglin
Copy link
Collaborator

bjaglin commented Jan 22, 2022

@tgodzik thanks for the pointer! It turned out to be a bit more convoluted because of

val metaconfigFor211V = "0.9.10" // metaconfig stops publishing for scala 2.11
but it looks like I found something that does not require specific scala-2.11 source files to compile.

However, there seems to be a bigger problem: the breaking changes in TPrint companion object from com-lihaoyi/PPrint#72 make it impossible to classload community rules compiled against the old one

[info] - fetch & load instance for Scala version 2.12 with external dependencies *** FAILED *** (839 milliseconds)
[info]   java.util.ServiceConfigurationError: scalafix.v1.Rule: Provider fix.SortImports could not be instantiated
[info]   at java.util.ServiceLoader.fail(ServiceLoader.java:232)
[info]   at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
[info]   at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
[info]   at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
[info]   at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
[info]   at scala.collection.convert.Wrappers$JIteratorWrapper.next(Wrappers.scala:46)
[info]   at scala.collection.Iterator.foreach(Iterator.scala:943)
[info]   at scala.collection.Iterator.foreach$(Iterator.scala:943)
[info]   at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[info]   at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:62)
[info]   ...
[info]   Cause: java.lang.NoSuchMethodError: pprint.TPrint$.lambda(Lscala/Function1;)Lpprint/TPrint;
[info]   at fix.SortImportsConfig$.<init>(SortImports.scala:19)
[info]   at fix.SortImportsConfig$.<clinit>(SortImports.scala)
[info]   at fix.SortImports.<init>(SortImports.scala:30)
[info]   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[info]   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[info]   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[info]   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[info]   at java.lang.Class.newInstance(Class.java:442)
[info]   at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
[info]   at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)

I'll follow-up in scalameta/metaconfig#151

@@ -24,7 +24,7 @@ object Dependencies {
val java8CompatV = "0.9.0"
val jgitV = "5.13.0.202109080827-r"
val metaconfigFor211V = "0.9.10" // metaconfig stops publishing for scala 2.11
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to publish scalafix for 2.11 though? Isn't metaconfig only needed for CLI/sbt ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Scalafix must be published in 2.11 for ExplicitResultTypes to work against 2.11 sources. This is something we can challenge though.

metaconfig is included in community rules projects via scalafix-core and is documented

$ cs resolve -t com.github.liancheng::organize-imports:0.6.0
└─ com.github.liancheng:organize-imports_2.13:0.6.0
   ├─ ch.epfl.scala:scalafix-core_2.13:0.9.31
   │  ├─ com.geirsson:metaconfig-typesafe-config_2.13:0.9.14
   │  │  ├─ com.geirsson:metaconfig-core_2.13:0.9.14

@bjaglin
Copy link
Collaborator

bjaglin commented Feb 9, 2022

Following up in #1530 seems that steward gets confused on which artifacts gets bumped) which should unblock the situation as discussed in scalameta/metaconfig#154 (comment).

@bjaglin bjaglin closed this Feb 9, 2022
@scala-steward scala-steward deleted the update/metaconfig-typesafe-config-0.9.16 branch February 10, 2022 10:21
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.

3 participants