scala-steward-org / scala-steward

:robot: A bot that helps you keep your projects up-to-date
Apache License 2.0
1.14k stars 496 forks source link

Cannot run program "mill" #2803

Closed ckipp01 closed 1 year ago

ckipp01 commented 1 year ago

I've noticed that in the public instance of Steward a handful of Mill projects haven't been getting updates. I wasn't able to access the logs in the public instance, but today I set up Scala Steward for the Scala Center org and the one repo over there that uses Mill, bloop-config, failed during the run, which makes me think this is what is hindering the other repos as well. The error is:

  2022-11-29 13:29:11,935 DEBUG Write /home/runner/scala-steward/workspace/repos/scalacenter/bloop-config/scala-steward.sc
  2022-11-29 13:29:11,935 DEBUG Execute "SBT_OPTS=-Xmx2048m -Xss8m -XX:MaxMetaspaceSize=512m" mill -i -p /home/runner/scala-steward/workspace/repos/scalacenter/bloop-config/scala-steward.sc show org.scalasteward.mill.plugin.StewardPlugin/extractDeps
  2022-11-29 13:29:11,939 DEBUG Write /home/runner/scala-steward/workspace/store/refresh_error/v1/github/scalacenter/bloop-config/refresh_error.json
  2022-11-29 13:29:11,946 ERROR Steward scalacenter/bloop-config failed
  java.io.IOException: Cannot run program "mill" (in directory "/home/runner/scala-steward/workspace/repos/scalacenter/bloop-config"): error=2, No such file or directory
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at org.scalasteward.core.io.process$.$anonfun$createProcess$1(process.scala:78)
    at delay @ org.scalasteward.core.io.process$.createProcess(process.scala:71)
    at flatMap @ org.scalasteward.core.io.process$.slurp(process.scala:43)
    at delay @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.$anonfun$debug$4(Slf4jLoggerInternal.scala:83)
    at delay @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.isDebugEnabled(Slf4jLoggerInternal.scala:65)
    at ifM$extension @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.info(Slf4jLoggerInternal.scala:91)
    at delay @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.$anonfun$debug$4(Slf4jLoggerInternal.scala:83)
  Caused by: java.io.IOException: error=2, No such file or directory
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at org.scalasteward.core.io.process$.$anonfun$createProcess$1(process.scala:78)
    at cats.effect.IOFiber.runLoop(IOFiber.scala:401)
    at cats.effect.IOFiber.asyncContinueSuccessfulR(IOFiber.scala:1322)
    at cats.effect.IOFiber.run(IOFiber.scala:119)
    at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:585)
  2022-11-29 13:29:11,948 INFO  ──────────── Total time: Steward scalacenter/bloop-config: 607ms ────────────

And you can see the logs for this here. Any idea why this isn't able to find mill?

fthomas commented 1 year ago

Maybe mill isn't installed or not in the PATH?

ckipp01 commented 1 year ago

Maybe mill isn't installed or not in the PATH?

Wait if you're running https://github.com/scala-steward-org/scala-steward-action do you need to ensure your build tool is installed globally? I sort of just figured Steward made sure of that then running. If the former, then is that documented somewhere?

fthomas commented 1 year ago

Yes, I think so. Scala Steward does not install any build tools it tries to run.

ckipp01 commented 1 year ago

Yes, I think so. Scala Steward does not install any build tools tries to run.

Huh, tomorrow I'll try again with Mill installed, but is there a reason for this? Mainly, would you accept a pr in the steward action to just setup Mill? I'm assuming the fact that this works for sbt users is because the ubuntu image just has sbt installed, when in reality I always assumed Steward just made sure these things were here.

fthomas commented 1 year ago

but is there a reason for this?

If you mean Scala Steward the JVM program, then the answer is that it is easier to not deal with installing third-party software from a running JVM process. The Docker image produced in this repo installs a bunch of third-party software (including Mill) though.

The Scala Steward GitHub Action does not use the Docker image but installs Scala Steward via Coursier which does not automatically also installs Mill or any other of its dependencies. A PR for setting up Mill in the Scala Steward GitHub Action sounds sensible to me, but I'm no expert wrt GH Actions.

ckipp01 commented 1 year ago

A PR for setting up Mill in the Scala Steward GitHub Action sounds sensible to me, but I'm no expert wrt GH Actions.

Cool, I'll go ahead and close this and try to send in a PR to the steward action to ensure it's installed.