-
-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide Spanning Forest JSON debug info by default (#4136)
fixes #4125
- Loading branch information
Showing
54 changed files
with
298 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
= Multi-File Builds | ||
:page-aliases: Structuring_Large_Builds.adoc | ||
|
||
include::partial$gtag-config.adoc[] | ||
|
||
include::partial$example/large/multi/10-multi-file-builds.adoc[] | ||
|
||
== Helper Files | ||
|
||
include::partial$example/large/multi/11-helper-files.adoc[] | ||
|
||
== Legacy `.sc` extension | ||
|
||
include::partial$example/large/multi/12-helper-files-sc.adoc[] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
= Selective Execution | ||
|
||
include::partial$gtag-config.adoc[] | ||
|
||
|
||
include::partial$example/large/selective/9-selective-execution.adoc[] | ||
|
||
|
||
== Reproducibility and Determinism | ||
|
||
Selective execution relies on the inputs to your project being deterministic | ||
and reproducible, except for the code changes between the two versions, so that | ||
Mill can compare the state of the build inputs before and after and only run | ||
tasks downstream of those that changed. This is usually the case, but there are | ||
some subtleties to be aware of: | ||
|
||
- *Dynamic `Task.Input` to capture Git metadata must be disabled*, e.g. using | ||
https://github.com/lefou/mill-vcs-version[mill-vcs-version]. The easiest way to do | ||
this is to guard such dynamic inputs on an environment variable, such that | ||
in most scenarios it returns a constant `"SNAPSHOT"` string, and only when | ||
necessary do you pass in the environment variable to compute a real version (e.g. | ||
during publishing) | ||
|
||
```scala | ||
def myProjectVersion: T[String] = Task.Input { | ||
if (Task.env.contains("MY_PROJECT_STABLE_VERSION")) VcsVersion.calcVcsState(Task.log).format() | ||
else "SNAPSHOT" | ||
} | ||
``` | ||
|
||
- *The filesystem layout and position of the before/after codebases must be exactly | ||
the same*. This is not an issue when running `selective.prepare`/`selective.run` on | ||
the same folder on one machine, but if the two calls are run on separate machines | ||
you need to make sure the directory path is the same. | ||
|
||
- *You must use the same Operating System amd Filesystem*, as differences there will | ||
cause the filesystem signatures to change and thus spuriously trigger downstream tasks. | ||
e.g. you cannot run `selective.prepare` on a Windows machine and `selective.run` on Linux | ||
|
||
- *Filesystem permissions must be preserved before/after*. e.g. running `selective,run}` | ||
on different Github Actions machines sharing artifacts can cause issues as | ||
`upload-artifact`/`download-artifact` https://github.com/actions/download-artifact#permission-loss[does not preserve filesystem permissions]. | ||
If this is an issue, you can run `chmod -R . 777` before each of `selective.{prepare,run}` | ||
to ensure they have the exact same filesystem permissions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
package mill.codesig | ||
|
||
class Logger(logFolder: Option[os.Path]) { | ||
class Logger(mandatoryLogFolder: os.Path, logFolder: Option[os.Path]) { | ||
logFolder.foreach(os.remove.all(_)) | ||
os.remove.all(mandatoryLogFolder) | ||
private var count = 1 | ||
|
||
def log0[T: upickle.default.Writer]( | ||
p: os.Path, | ||
res: sourcecode.Text[T], | ||
prefix: String = "" | ||
): Unit = { | ||
os.write( | ||
p / s"$prefix${res.source}.json", | ||
upickle.default.stream(res.value, indent = 4), | ||
createFolders = true | ||
) | ||
count += 1 | ||
} | ||
def log[T: upickle.default.Writer](t: => sourcecode.Text[T], prefix: String = ""): Unit = { | ||
lazy val res = t | ||
logFolder.foreach { p => | ||
os.write( | ||
p / s"$count-$prefix${res.source}.json", | ||
upickle.default.stream(res.value, indent = 4), | ||
createFolders = true | ||
) | ||
count += 1 | ||
} | ||
logFolder.foreach(log0(_, t, s"$count-$prefix")) | ||
} | ||
def mandatoryLog[T: upickle.default.Writer]( | ||
t: => sourcecode.Text[T], | ||
prefix: String = "" | ||
): Unit = { | ||
log0(mandatoryLogFolder, t, prefix) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.