mill.daemon

package mill.daemon

Members list

Type members

Classlikes

class MillBuildBootstrap(topLevelProjectRoot: Path, output: Path, keepGoing: Boolean, imports: Seq[String], env: Map[String, String], ec: Option[ThreadPoolExecutor], tasksAndParams: Seq[String], prevCommandState: RunnerLauncherState, logger: Logger, requestedMetaLevel: Option[Int], allowPositionalCommandArgs: Boolean, systemExit: StopServer, streams0: SystemStreams, selectiveExecution: Boolean, offline: Boolean, useFileLocks: Boolean, runArtifacts: LauncherOutFiles, metaBuild: MetaBuildAccess, reporter: EvaluatorApi => Int => Option[CompileProblemReporter], metaBuildReporter: Int => Option[CompileProblemReporter] = ..., enableTicker: Boolean)

Logic around bootstrapping Mill, creating a MillBuildRootModule.BootstrapModule and compiling builds/meta-builds and classloading their RootModules so we can evaluate the requested tasks on the RootModule representing the user's build.mill file.

Logic around bootstrapping Mill, creating a MillBuildRootModule.BootstrapModule and compiling builds/meta-builds and classloading their RootModules so we can evaluate the requested tasks on the RootModule representing the user's build.mill file.

When Mill is run in daemon mode or with --watch, bootstrap state is cached in-memory across evaluations. The daemon-wide reusable bootstrap metadata lives in RunnerSharedState, while each launcher keeps its own evaluators and retained read leases in RunnerLauncherState.

When a subsequent evaluation happens, each meta-level attempts to re-use its corresponding cached frame to avoid unnecessary classloader recreation, worker churn, or re-evaluation. This should remain transparent to users while improving performance.

Attributes

Companion
object
Source
MillBuildBootstrap.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
class
Source
MillBuildBootstrap.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
class
Source
MillDaemonMain0.scala
Supertypes
class Object
trait Matchable
class Any
Self type
class MillDaemonMain0(daemonDir: Path, acceptTimeout: FiniteDuration, locks: Locks, outMode: OutFolderMode) extends MillDaemonServer

Attributes

Companion
object
Source
MillDaemonMain0.scala
Supertypes
class Server[DaemonServerData, Int]
class Object
trait Matchable
class Any
object MillMain0

Attributes

Source
MillMain0.scala
Supertypes
class Object
trait Matchable
class Any
Self type
MillMain0.type

Attributes

Source
MillNoDaemonMain0.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
MillScalaParserImpl.scala
Supertypes
class Object
trait Matchable
class Any
Self type
case class RunnerLauncherState(errorOpt: Option[String] = ..., buildFile: Option[String] = ..., bootstrapModuleOpt: Option[RootModule] = ..., buildFileWatch: Option[Watchable] = ..., metaFrames: List[MetaFrame] = ..., finalFrame: Option[FinalFrame] = ..., workspaceLocking: Option[LauncherLocking] = ..., runArtifacts: Option[LauncherOutFiles] = ..., fileLockLease: Option[AutoCloseable] = ...) extends Result, AutoCloseable

Per-launcher view of the current bootstrap/evaluation run.

Per-launcher view of the current bootstrap/evaluation run.

Holds launcher-owned resources that cannot be shared daemon-wide: active evaluators, retained meta-build read leases that pin the shared frames the launcher is using, the user-task evaluation, and the launcher session.

Attributes

Companion
object
Source
RunnerLauncherState.scala
Supertypes
trait Serializable
trait Serializable
trait Product
trait Equals
trait AutoCloseable
trait Result
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
RunnerLauncherState.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RunnerSharedState(frames: Map[Int, Frame] = ..., userFinalModuleWatched: Option[Seq[Watchable]] = ..., bootstrapWorkers: Map[String, (Int, Val, TaskApi[_])] = ...)

Daemon-wide bootstrap cache shared across concurrent launcher runs.

Daemon-wide bootstrap cache shared across concurrent launcher runs.

Each stored frame represents reusable metadata from one level of build.mill evaluation: watches, classloaders, code signatures, classpaths, and worker caches that are safe to share between launchers. A frame whose bootstrap succeeded carries a RunnerSharedState.Frame.Reusable payload (which now also owns the per-classloader worker cache, so worker lifetime tracks classloader lifetime); a failed frame still publishes its watches so callers can use them to invalidate.

Attributes

Companion
object
Source
RunnerSharedState.scala
Supertypes
trait Serializable
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
RunnerSharedState.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Source
RunnerSharedState.scala
Supertypes
class Object
trait Matchable
class Any
Self type
class SharedOutLockManager(fileLock: Lock, out: Path) extends AutoCloseable

Attributes

Source
SharedOutLockManager.scala
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
class TailManager(daemonDir: Path) extends AutoCloseable

Attributes

Source
TailManager.scala
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
class TeePrintStream(out1: PrintStream, out2: PrintStream) extends PrintStream

Attributes

Source
TeePrintStream.scala
Supertypes
class PrintStream
trait Appendable
class FilterOutputStream
class OutputStream
trait Flushable
trait Closeable
trait AutoCloseable
class Object
trait Matchable
class Any
Show all
object Watching

Logic around the "watch and wait" functionality in Mill: re-run on change, re-run when the user presses Enter, printing status messages, etc.

Logic around the "watch and wait" functionality in Mill: re-run on change, re-run when the user presses Enter, printing status messages, etc.

Attributes

Source
Watching.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Watching.type