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

Scala Steward not working in this repo? #45

Closed
SethTisue opened this issue Mar 29, 2023 · 12 comments · Fixed by #46 or #47
Closed

Scala Steward not working in this repo? #45

SethTisue opened this issue Mar 29, 2023 · 12 comments · Fixed by #46 or #47
Assignees

Comments

@SethTisue
Copy link
Member

on Discord, @tgodzik says

Hey all, it seems that there are a couple of repositories that are currently failing in the public Scala Steward instance. I tried making a list here VirtusLab/scala-steward-repos#98 though I wasn't able to go through everything myself and I am a bit low on time to do it. If your repository is on the list and you are missing updates do let me know. I can try to send you some debug information and we can try to figure it out together. Alternatively, you can set up a separate local Scala Steward and debug it yourself.

and for this repo in particular,

it seems we are getting:

java.io.IOException: 'sbt -Dsbt.color=false -Dsbt.log.noformat=true -Dsbt.supershell=false ;+ stewardDependencies;reload plugins;stewardDependencies' exited with code 1
[info] welcome to sbt 1.7.1 (Eclipse Adoptium Java 11.0.16.1)
[info] loading global plugins from /root/.sbt/1.0/plugins
[info] compiling 1 Scala source to /root/.sbt/1.0/plugins/target/scala-2.12/sbt-1.0/classes ...
[info] done compiling
[info] loading settings for project scala-dist-smoketest-build from plugins.sbt ...
[info] loading project definition from /opt/workspace/repos/scala/scala-dist-smoketest/project
[info] loading settings for project scala-dist-smoketest from build.sbt ...
[info] set current project to scala-dist-smoketest (in build file:/opt/workspace/repos/scala/scala-dist-smoketest/)
java.lang.IllegalArgumentException: Invalid comparator: 4faeb905e70fc36cd3b00d25d756400050efaa07
    at sbt.internal.librarymanagement.SemComparatorFunctions.parse(SemanticSelectorExtra.scala:208)
    at sbt.internal.librarymanagement.SemComparator$.apply(SemComparator.scala:54)
    at sbt.internal.librarymanagement.SemSelAndChunkFunctions.$anonfun$parse$2(SemanticSelectorExtra.scala:14)
    at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
    at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
    at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)

though that was a while ago when I downloaded the logs, but might be the same issue

@SethTisue SethTisue self-assigned this Mar 29, 2023
@fthomas
Copy link

fthomas commented Mar 29, 2023

This can be reproduced by evaluating anything in sbt with +:

sbt:scala-dist-smoketest> version
[info] 5738c3d1d14521d61c6a37ff17cd2c73896e1062
sbt:scala-dist-smoketest> 
sbt:scala-dist-smoketest> + version
java.lang.IllegalArgumentException: Invalid comparator: 5738c3d1d14521d61c6a37ff17cd2c73896e1062
	at sbt.internal.librarymanagement.SemComparatorFunctions.parse(SemanticSelectorExtra.scala:208)
	at sbt.internal.librarymanagement.SemComparator$.apply(SemComparator.scala:54)
	at sbt.internal.librarymanagement.SemSelAndChunkFunctions.$anonfun$parse$2(SemanticSelectorExtra.scala:14)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
	at scala.collection.TraversableLike.map(TraversableLike.scala:286)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
	at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:198)
	at sbt.internal.librarymanagement.SemSelAndChunkFunctions.parse(SemanticSelectorExtra.scala:14)
	at sbt.internal.librarymanagement.SemSelAndChunk$.apply(SemSelAndChunk.scala:30)
	at sbt.librarymanagement.SemanticSelector$.$anonfun$apply$2(SemanticSelector.scala:86)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
	at scala.collection.TraversableLike.map(TraversableLike.scala:286)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
	at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:198)
	at sbt.librarymanagement.SemanticSelector$.apply(SemanticSelector.scala:86)
	at sbt.Cross$.$anonfun$switchScalaVersion$19(Cross.scala:340)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
	at scala.collection.Iterator.foreach(Iterator.scala:943)
	at scala.collection.Iterator.foreach$(Iterator.scala:943)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
	at scala.collection.TraversableLike.map(TraversableLike.scala:286)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
	at sbt.Cross$.switchScalaVersion(Cross.scala:338)
	at sbt.Cross$.switchCommandImpl(Cross.scala:245)
	at sbt.Cross$.$anonfun$switchVersion$2(Cross.scala:242)
	at sbt.Command$.$anonfun$applyEffect$4(Command.scala:150)
	at sbt.Command$.$anonfun$applyEffect$2(Command.scala:145)
	at sbt.Command$.process(Command.scala:189)
	at sbt.MainLoop$.$anonfun$processCommand$5(MainLoop.scala:245)
	at scala.Option.getOrElse(Option.scala:189)
	at sbt.MainLoop$.process$1(MainLoop.scala:245)
	at sbt.MainLoop$.processCommand(MainLoop.scala:276)
	at sbt.MainLoop$.$anonfun$next$5(MainLoop.scala:163)
	at sbt.State$StateOpsImpl$.runCmd$1(State.scala:289)
	at sbt.State$StateOpsImpl$.process$extension(State.scala:325)
	at sbt.MainLoop$.$anonfun$next$4(MainLoop.scala:163)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
	at sbt.MainLoop$.next(MainLoop.scala:163)
	at sbt.MainLoop$.run(MainLoop.scala:144)
	at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:119)
	at sbt.io.Using.apply(Using.scala:27)
	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:112)
	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:66)
	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:51)
	at sbt.MainLoop$.runLogged(MainLoop.scala:42)
	at sbt.StandardMain$.runManaged(Main.scala:215)
	at sbt.xMain$.$anonfun$run$11(Main.scala:133)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at scala.Console$.withIn(Console.scala:230)
	at sbt.internal.util.Terminal$.withIn(Terminal.scala:577)
	at sbt.internal.util.Terminal$.$anonfun$withStreams$1(Terminal.scala:358)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at scala.Console$.withOut(Console.scala:167)
	at sbt.internal.util.Terminal$.$anonfun$withOut$2(Terminal.scala:567)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at scala.Console$.withErr(Console.scala:196)
	at sbt.internal.util.Terminal$.withOut(Terminal.scala:567)
	at sbt.internal.util.Terminal$.withStreams(Terminal.scala:358)
	at sbt.xMain$.withStreams$1(Main.scala:87)
	at sbt.xMain$.run(Main.scala:121)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at sbt.internal.XMainConfiguration.run(XMainConfiguration.java:57)
	at sbt.xMain.run(Main.scala:46)
	at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
	at xsbt.boot.Launch$.run(Launch.scala:149)
	at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
	at xsbt.boot.Launch$.launch(Launch.scala:159)
	at xsbt.boot.Launch$.apply(Launch.scala:44)
	at xsbt.boot.Launch$.apply(Launch.scala:21)
	at xsbt.boot.Boot$.runImpl(Boot.scala:78)
	at xsbt.boot.Boot$.run(Boot.scala:73)
	at xsbt.boot.Boot$.main(Boot.scala:21)
	at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.IllegalArgumentException: Invalid comparator: 5738c3d1d14521d61c6a37ff17cd2c73896e1062

Looks like an sbt bug to me.

@fthomas
Copy link

fthomas commented Mar 29, 2023

It works with sbt 1.6.0 and still fails with 1.8.2.

Update: This issue exists since sbt 1.7.0-RC2.

@SethTisue
Copy link
Member Author

SethTisue commented Apr 26, 2023

the problem is reproducible locally by doing:

  • curl -O -L 'https://raw.githubusercontent.com/scala-steward-org/sbt-plugin/main/modules/sbt-plugin-1_3_11/src/main/scala/org/scalasteward/sbt/plugin/StewardPlugin_1_3_11.scala'
  • mv StewardPlugin_1_3_11.scala plugins/
  • sbt +stewardDependencies

@SethTisue
Copy link
Member Author

SethTisue commented Apr 26, 2023

I thought switching from sbt-git to sbt-dynver might help, since the problem is with the automatically generated version key, but although changing plugins causes version to change, we hit the same issue:

java.lang.IllegalArgumentException: Invalid comparator: 2.11.4+91-93b1c2ac+20230426-1607

committing my changes locally simplifies the version number somewhat but it still fails:

java.lang.IllegalArgumentException: Invalid comparator: 2.11.4+93-6e3eb3af

@SethTisue
Copy link
Member Author

with sbt-dynver, ThisBuild / dynverSeparator := "-" (as per https://github.com/sbt/sbt-dynver#portable-version-strings) seems to fix it (the version number becomes e.g. 2.11.4-93-6e3eb3af). I'll PR that

@SethTisue
Copy link
Member Author

keeping the ticket open until we can verify that my PR actually fixed it

@SethTisue
Copy link
Member Author

SethTisue commented Apr 27, 2023

pushed a different fix. ditto on leaving this open for now

in addition to checking the next Steward run, I'll also need to check the next nightly run succeeds and is operating as expected

and then I should be extra careful when I release 2.13.11 within the next few weeks

@SethTisue
Copy link
Member Author

@SethTisue
Copy link
Member Author

I've submitted #48 with the idea that once sbt 1.9.0 final comes out, the Steward should send us the upgrade and if it doesn't something's still wrong

@SethTisue
Copy link
Member Author

SethTisue commented May 11, 2023

hmm, no sbt 1.9.0-RC2 upgrade PR from the Steward :-/

or just not yet...?

@som-snytt
Copy link

🤞

@xuwei-k
Copy link

xuwei-k commented May 13, 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
4 participants