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

Use ignoreErrors = true to make clean work on runBackground subprocesses on windows #4265

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ object Deps {
val junitInterface = ivy"com.github.sbt:junit-interface:0.13.3"
val commonsIo = ivy"commons-io:commons-io:2.18.0"
val log4j2Core = ivy"org.apache.logging.log4j:log4j-core:2.24.3"
val osLib = ivy"com.lihaoyi::os-lib:0.11.4-M2"
val osLib = ivy"com.lihaoyi::os-lib:0.11.4-M4"
val pprint = ivy"com.lihaoyi::pprint:0.9.0"
val mainargs = ivy"com.lihaoyi::mainargs:0.7.6"
val millModuledefsVersion = "0.11.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@ object RunBackgroundTests extends UtestIntegrationTestSuite {
eventually { probeLockAvailable(lock) }
}
test("clean") - integrationTest { tester =>
if (!mill.main.client.Util.isWindows) {
import tester._
val lock = os.temp()
val stop = os.temp()
os.remove(stop)
eval(("foo.runBackground", lock, stop))
eventually {
!probeLockAvailable(lock)
}
import tester._
val lock = os.temp()
val stop = os.temp()
os.remove(stop)
eval(("foo.runBackground", lock, stop))
eventually {
!probeLockAvailable(lock)
}

eval(("clean", "foo.runBackground"))
eventually {
probeLockAvailable(lock)
}
eval(("clean", "foo.runBackground"))
eventually {
probeLockAvailable(lock)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion main/src/mill/main/MainModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ trait MainModule extends BaseModule0 {

val existing = paths.filter(p => os.exists(p))
Target.log.debug(s"Cleaning ${existing.size} paths ...")
existing.foreach(os.remove.all)
existing.foreach(os.remove.all(_, ignoreErrors = true))
Result.Success(existing.map(PathRef(_)))
}
}
Expand Down
Loading