lichess-org/lila-ws

macOS M1: Compilation Error

shubhamdhingra38 opened this issue · 2 comments

Apologies if this is something very basic, but I'm struggling with this as I'm not familar with scala.
I did make the change to exclude this line from build.sbt: -libraryDependencies += "org.reactivemongo" % "reactivemongo-shaded-native" % s"$reactivemongoVersion-$os-x86-64" but I still get this error on sbt run.

sbt:lila-ws> run
[info] compiling 62 Scala sources to /Users/dev/lila-ws/target/scala-3.1.2/classes ...
[error] -- Error: /Users/dev/lila-ws/src/main/scala/Fens.scala:71:9 --------------------
[error] 71 |        }.fold(watched) { position =>
[error]    |         ^
[error]    |         end of statement expected but '.' found
[error] -- [E007] Type Mismatch Error: /Users/dev/lila-ws/src/main/scala/Fens.scala:64:12 
[error] 64 |            for {
[error]    |            ^
[error]    |            Found:    Option[lila.ws.Position]
[error]    |            Required: lila.ws.Fens.Watched
[error] 65 |              uci <- Uci(uciS)
[error] 66 |              wc  <- wcS.toIntOption
[error] 67 |              bc  <- bcS.toIntOption
[error] 68 |            } yield Position(uci, FEN(fenS), Some(Clock(wc, bc)), turnColor)
[error] Explanation
[error] ===========
[error] 
[error] Tree: chess.format.Uci.apply(uciS).flatMap[lila.ws.Position](
[error]   {
[error]     def $anonfun(uci: chess.format.Uci): Option[lila.ws.Position] = 
[error]       augmentString(wcS).toIntOption.flatMap[lila.ws.Position](
[error]         {
[error]           def $anonfun(wc: Int): Option[lila.ws.Position] = 
[error]             augmentString(bcS).toIntOption.map[lila.ws.Position](
[error]               {
[error]                 def $anonfun(bc: Int): lila.ws.Position = 
[error]                   lila.ws.Position.apply(uci, chess.format.FEN.apply(fenS), 
[error]                     Some.apply[lila.ws.Clock](lila.ws.Clock.apply(wc, bc))
[error]                   , turnColor)
[error]                 closure($anonfun)
[error]               }
[error]             )
[error]           closure($anonfun)
[error]         }
[error]       )
[error]     closure($anonfun)
[error]   }
[error] )
[error] 
[error] I tried to show that
[error]   Option[lila.ws.Position]
[error] conforms to
[error]   lila.ws.Fens.Watched
[error] but the comparison trace ended with `false`:
[error]           
[error]   ==> Option[lila.ws.Position]  <:  lila.ws.Fens.Watched
[error]   <== Option[lila.ws.Position]  <:  lila.ws.Fens.Watched = false
[error] 
[error] The tests were made under a constraint with:
[error]  uninstantiated variables: B, B
[error]  constrained types: [B](f: chess.format.Uci => B): Option[B], 
[error]   [B](f: chess.format.Uci => B): Option[B]
[error]  bounds: 
[error]      B
[error]      B
[error]  ordering: 
[error] -- [E007] Type Mismatch Error: /Users/dev/lila-ws/src/main/scala/Fens.scala:69:40 
[error] 69 |          case MoveRegex(uciS, fenS) => Uci(uciS) map { Position(_, FEN(fenS), None, turnColor) }
[error]    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |                                      Found:    Option[lila.ws.Position]
[error]    |                                      Required: lila.ws.Fens.Watched
[error] Explanation
[error] ===========
[error] 
[error] Tree: chess.format.Uci.apply(uciS).map[lila.ws.Position](
[error]   {
[error]     {
[error]       def $anonfun(_$5: chess.format.Uci): lila.ws.Position = 
[error]         lila.ws.Position.apply(_$5, chess.format.FEN.apply(fenS), None, 
[error]           turnColor
[error]         )
[error]       closure($anonfun)
[error]     }
[error]   }
[error] )
[error] 
[error] I tried to show that
[error]   Option[lila.ws.Position]
[error] conforms to
[error]   lila.ws.Fens.Watched
[error] but the comparison trace ended with `false`:
[error]           
[error]   ==> Option[lila.ws.Position]  <:  lila.ws.Fens.Watched
[error]   <== Option[lila.ws.Position]  <:  lila.ws.Fens.Watched = false
[error] 
[error] The tests were made under a constraint with:
[error]  uninstantiated variables: B, B
[error]  constrained types: [B](f: chess.format.Uci => B): Option[B], 
[error]   [B](f: chess.format.Uci => B): Option[B]
[error]  bounds: 
[error]      B
[error]      B
[error]  ordering: 
[error] -- [E007] Type Mismatch Error: /Users/dev/lila-ws/src/main/scala/Fens.scala:70:40 
[error] 70 |          case _                     => None
[error]    |                                        ^^^^
[error]    |                                        Found:    None.type
[error]    |                                        Required: lila.ws.Fens.Watched
[error] Explanation
[error] ===========
[error] 
[error] Tree: None
[error] 
[error] I tried to show that
[error]   None.type
[error] conforms to
[error]   lila.ws.Fens.Watched
[error] but the comparison trace ended with `false`:
[error]           
[error]   ==> None.type  <:  lila.ws.Fens.Watched
[error]     ==> None  <:  lila.ws.Fens.Watched (left is approximated)
[error]     <== None  <:  lila.ws.Fens.Watched (left is approximated) = false
[error]   <== None.type  <:  lila.ws.Fens.Watched = false
[error] 
[error] The tests were made under a constraint with:
[error]  uninstantiated variables: B, B
[error]  constrained types: [B](f: chess.format.Uci => B): Option[B], 
[error]   [B](f: chess.format.Uci => B): Option[B]
[error]  bounds: 
[error]      B
[error]      B
[error]  ordering: 
[error] -- [E081] Type Error: /Users/dev/lila-ws/src/main/scala/SeenAtUpdate.scala:99:10 
[error] 99 |    ) map _.result[BSONDocument]
[error]    |          ^
[error]    |Missing parameter type
[error]    |
[error]    |I could not infer the type of the parameter _$6 of expanded function:
[error]    |_$6 => 
[error]    |  coll.findAndModify(selector = selector, 
[error]    |    modifier = coll.updateModifier(modifier)
[error]    |  , sort = None, fields = Some(fields), bypassDocumentValidation = false, 
[error]    |    writeConcern = WriteConcern.Default
[error]    |  , maxTime = None, collation = None, arrayFilters = Seq.empty) map 
[error]    |    _$6.result[BSONDocument].
[error] 5 errors found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 2 s, completed 22-May-2022, 3:13:29 am
fczs commented

I have the same issue on M1 / Monterey 12.1. The lila itself seems to work.

@fczs Yeah, I am on 12.2 myself.
I'll give this another shot after launching my Terminal through Rosetta, but not sure if that solves it. I'll probably be able to check on the weekend.