From 7fd92085738162b7e0b99ae94fe3e4e60f8ff699 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 9 Sep 2024 16:09:05 +0800 Subject: [PATCH 1/9] Update .mill-version --- .mill-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mill-version b/.mill-version index bd0119f9..17efad1a 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.11.12 +0.12.0-RC1 From f997915fa2326222c41fac3fe5f2a086048720d0 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 9 Sep 2024 16:49:40 +0800 Subject: [PATCH 2/9] . --- mill | 6 ++++-- os/test/src-jvm/ExampleTests.scala | 2 +- os/test/src-jvm/OpTestsJvmOnly.scala | 4 ++-- os/test/src-jvm/ProcessPipelineTests.scala | 2 +- os/test/src/OpTests.scala | 2 +- os/test/src/SubprocessTests.scala | 8 ++++++-- os/test/src/TestUtil.scala | 2 +- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/mill b/mill index cb1ee32f..d03a045c 100755 --- a/mill +++ b/mill @@ -7,7 +7,7 @@ set -e if [ -z "${DEFAULT_MILL_VERSION}" ] ; then - DEFAULT_MILL_VERSION=0.11.0 + DEFAULT_MILL_VERSION=0.11.12 fi if [ -z "$MILL_VERSION" ] ; then @@ -53,7 +53,9 @@ if [ -z "$MILL_MAIN_CLI" ] ; then fi MILL_FIRST_ARG="" -if [ "$1" = "--bsp" ] || [ "$1" = "-i" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then + + # first arg is a long flag for "--interactive" or starts with "-i" +if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then # Need to preserve the first position of those listed options MILL_FIRST_ARG=$1 shift diff --git a/os/test/src-jvm/ExampleTests.scala b/os/test/src-jvm/ExampleTests.scala index fbb2335e..247590f2 100644 --- a/os/test/src-jvm/ExampleTests.scala +++ b/os/test/src-jvm/ExampleTests.scala @@ -254,7 +254,7 @@ object ExampleTests extends TestSuite { } test("findWc") { - val wd = os.pwd / "os" / "test" / "resources" / "test" + val wd = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" // find . -name '*.txt' | xargs wc -l val lines = os.walk(wd) diff --git a/os/test/src-jvm/OpTestsJvmOnly.scala b/os/test/src-jvm/OpTestsJvmOnly.scala index f5c950bb..320663c8 100644 --- a/os/test/src-jvm/OpTestsJvmOnly.scala +++ b/os/test/src-jvm/OpTestsJvmOnly.scala @@ -10,7 +10,7 @@ import java.nio.charset.Charset object OpTestsJvmOnly extends TestSuite { val tests = Tests { - val res = os.pwd / "os" / "test" / "resources" / "test" + val res = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" val testFolder = os.pwd / "out" / "scratch" / "test" test("lsRecPermissions") { if (Unix()) { @@ -74,7 +74,7 @@ object OpTestsJvmOnly extends TestSuite { // Not sure why this doesn't work on native test("redirectSubprocessInheritedOutput") { if (Unix()) { // relies on bash scripts that don't run on windows - val scriptFolder = os.pwd / "os" / "test" / "resources" / "test" + val scriptFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" val lines = collection.mutable.Buffer.empty[String] os.Inherit.out.withValue(os.ProcessOutput.Readlines(lines.append(_))) { // Redirected diff --git a/os/test/src-jvm/ProcessPipelineTests.scala b/os/test/src-jvm/ProcessPipelineTests.scala index bfeb6326..b3218caa 100644 --- a/os/test/src-jvm/ProcessPipelineTests.scala +++ b/os/test/src-jvm/ProcessPipelineTests.scala @@ -9,7 +9,7 @@ import TestUtil.prep import scala.util.Try object ProcessPipelineTests extends TestSuite { - val scriptFolder = pwd / "os" / "test" / "resources" / "scripts" + val scriptFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "scripts" lazy val scalaHome = sys.env("SCALA_HOME") diff --git a/os/test/src/OpTests.scala b/os/test/src/OpTests.scala index 46238f12..addc1bb7 100644 --- a/os/test/src/OpTests.scala +++ b/os/test/src/OpTests.scala @@ -10,7 +10,7 @@ import java.nio.charset.Charset object OpTests extends TestSuite { val tests = Tests { - val res = os.pwd / "os" / "test" / "resources" / "test" + val res = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" test("ls") - assert( os.list(res).toSet == Set( res / "folder1", diff --git a/os/test/src/SubprocessTests.scala b/os/test/src/SubprocessTests.scala index 0a240ba2..2cd09869 100644 --- a/os/test/src/SubprocessTests.scala +++ b/os/test/src/SubprocessTests.scala @@ -9,7 +9,7 @@ import utest._ import scala.collection.mutable object SubprocessTests extends TestSuite { - val scriptFolder = pwd / "os" / "test" / "resources" / "test" + val scriptFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" val lsCmd = if (scala.util.Properties.isWin) "dir" else "ls" @@ -38,6 +38,8 @@ object SubprocessTests extends TestSuite { } } test("chained") { + proc("git", "init").call() + os.write.over(os.pwd / "Readme.adoc", "hello") assert( proc("git", "init").call().out.text().contains("Reinitialized existing Git repository"), proc("git", "init").call().out.text().contains("Reinitialized existing Git repository"), @@ -46,6 +48,8 @@ object SubprocessTests extends TestSuite { } test("basicList") { val files = List("Readme.adoc", "build.sc") + os.write.over(os.pwd / "Readme.adoc", "hello") + os.write.over(os.pwd / "build.sc", "world") val output = TestUtil.proc(lsCmd, files).call().out.text() assert(files.forall(output.contains)) } @@ -193,7 +197,7 @@ object SubprocessTests extends TestSuite { } test("jarTf") { // This was the original repro for the multi-chunk concurrency bugs - val jarFile = os.pwd / "os" / "test" / "resources" / "misc" / "out.jar" + val jarFile = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "misc" / "out.jar" assert(TestUtil.eqIgnoreNewlineStyle( os.proc("jar", "-tf", jarFile).call().out.text(), """META-INF/MANIFEST.MF diff --git a/os/test/src/TestUtil.scala b/os/test/src/TestUtil.scala index 49eec2f7..884cd3bc 100644 --- a/os/test/src/TestUtil.scala +++ b/os/test/src/TestUtil.scala @@ -57,7 +57,7 @@ object TestUtil { } ) - val original = Paths.get("os", "test", "resources", "test") + val original = Paths.get(sys.env("MILL_TEST_RESOURCE_FOLDER"), "test") Files.walkFileTree( original, new SimpleFileVisitor[Path]() { From 56f2fb47bc43a5d4cbc965c249b416b8b591e8e6 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 9 Sep 2024 16:52:08 +0800 Subject: [PATCH 3/9] . --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae478a5e..bf89bf53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,10 @@ name: ci on: push: + branches: + - master + tags: + - '*' pull_request: branches: - main From 697cd1a7fcce5d7a29b0dcbe53ce56807d8ef2bd Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 9 Sep 2024 17:05:08 +0800 Subject: [PATCH 4/9] . --- build.sc | 4 +++- os/test/src/TestUtil.scala | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sc b/build.sc index de9903f2..ad820e5e 100644 --- a/build.sc +++ b/build.sc @@ -87,7 +87,8 @@ trait OsLibModule // we check the textual output of system commands and expect it in english def forkEnv = super.forkEnv() ++ Map( "LC_ALL" -> "C", - "TEST_SUBPROCESS_ENV" -> "value" + "TEST_SUBPROCESS_ENV" -> "value", + "OS_TEST_RESOURCE_FOLDER" -> os.jvm(crossValue).test.resources().head.path.toString ) } } @@ -177,6 +178,7 @@ object os extends Module { def ivyDeps = Agg(Deps.jna) object test extends ScalaTests with OsLibTestModule { def moduleDeps = super.moduleDeps ++ Seq(os.jvm().test) + } } } diff --git a/os/test/src/TestUtil.scala b/os/test/src/TestUtil.scala index 884cd3bc..e65a7a79 100644 --- a/os/test/src/TestUtil.scala +++ b/os/test/src/TestUtil.scala @@ -57,7 +57,7 @@ object TestUtil { } ) - val original = Paths.get(sys.env("MILL_TEST_RESOURCE_FOLDER"), "test") + val original = Paths.get(sys.env("OS_TEST_RESOURCE_FOLDER"), "test") Files.walkFileTree( original, new SimpleFileVisitor[Path]() { From cdb403877cd61b4fafeff0f124ea5acd4c84a3d7 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 9 Sep 2024 17:35:52 +0800 Subject: [PATCH 5/9] . --- os/test/src-jvm/ExampleTests.scala | 2 +- os/test/src-jvm/OpTestsJvmOnly.scala | 4 ++-- os/test/src-jvm/ProcessPipelineTests.scala | 2 +- os/test/src/OpTests.scala | 2 +- os/test/src/SubprocessTests.scala | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/os/test/src-jvm/ExampleTests.scala b/os/test/src-jvm/ExampleTests.scala index 247590f2..577a4fc3 100644 --- a/os/test/src-jvm/ExampleTests.scala +++ b/os/test/src-jvm/ExampleTests.scala @@ -254,7 +254,7 @@ object ExampleTests extends TestSuite { } test("findWc") { - val wd = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" + val wd = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "test" // find . -name '*.txt' | xargs wc -l val lines = os.walk(wd) diff --git a/os/test/src-jvm/OpTestsJvmOnly.scala b/os/test/src-jvm/OpTestsJvmOnly.scala index 320663c8..59d50f44 100644 --- a/os/test/src-jvm/OpTestsJvmOnly.scala +++ b/os/test/src-jvm/OpTestsJvmOnly.scala @@ -10,7 +10,7 @@ import java.nio.charset.Charset object OpTestsJvmOnly extends TestSuite { val tests = Tests { - val res = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" + val res = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "test" val testFolder = os.pwd / "out" / "scratch" / "test" test("lsRecPermissions") { if (Unix()) { @@ -74,7 +74,7 @@ object OpTestsJvmOnly extends TestSuite { // Not sure why this doesn't work on native test("redirectSubprocessInheritedOutput") { if (Unix()) { // relies on bash scripts that don't run on windows - val scriptFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" + val scriptFolder = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "test" val lines = collection.mutable.Buffer.empty[String] os.Inherit.out.withValue(os.ProcessOutput.Readlines(lines.append(_))) { // Redirected diff --git a/os/test/src-jvm/ProcessPipelineTests.scala b/os/test/src-jvm/ProcessPipelineTests.scala index b3218caa..389fcfc8 100644 --- a/os/test/src-jvm/ProcessPipelineTests.scala +++ b/os/test/src-jvm/ProcessPipelineTests.scala @@ -9,7 +9,7 @@ import TestUtil.prep import scala.util.Try object ProcessPipelineTests extends TestSuite { - val scriptFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "scripts" + val scriptFolder = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "scripts" lazy val scalaHome = sys.env("SCALA_HOME") diff --git a/os/test/src/OpTests.scala b/os/test/src/OpTests.scala index addc1bb7..fd370563 100644 --- a/os/test/src/OpTests.scala +++ b/os/test/src/OpTests.scala @@ -10,7 +10,7 @@ import java.nio.charset.Charset object OpTests extends TestSuite { val tests = Tests { - val res = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" + val res = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "test" test("ls") - assert( os.list(res).toSet == Set( res / "folder1", diff --git a/os/test/src/SubprocessTests.scala b/os/test/src/SubprocessTests.scala index 2cd09869..b8a2c63c 100644 --- a/os/test/src/SubprocessTests.scala +++ b/os/test/src/SubprocessTests.scala @@ -9,7 +9,7 @@ import utest._ import scala.collection.mutable object SubprocessTests extends TestSuite { - val scriptFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "test" + val scriptFolder = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "test" val lsCmd = if (scala.util.Properties.isWin) "dir" else "ls" @@ -197,7 +197,7 @@ object SubprocessTests extends TestSuite { } test("jarTf") { // This was the original repro for the multi-chunk concurrency bugs - val jarFile = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "misc" / "out.jar" + val jarFile = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "misc" / "out.jar" assert(TestUtil.eqIgnoreNewlineStyle( os.proc("jar", "-tf", jarFile).call().out.text(), """META-INF/MANIFEST.MF From f0f1960b3aa674ce5479a011c59081961450f5b4 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Fri, 4 Oct 2024 20:24:06 +0800 Subject: [PATCH 6/9] Update .mill-version --- .mill-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mill-version b/.mill-version index 17efad1a..570985f0 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.0-RC1 +0.12.0-RC3 From acb78f05ba012e5afa7fe59fe62018ace7fa530a Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Tue, 22 Oct 2024 07:25:04 +0800 Subject: [PATCH 7/9] Update .mill-version --- .mill-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mill-version b/.mill-version index 570985f0..53cf705c 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.0-RC3 +0.12.0-RC3-102-b8217f From 0ce0d389627a6be7867ceb1002eb1d030ed812e7 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Tue, 22 Oct 2024 07:39:51 +0800 Subject: [PATCH 8/9] . --- os/test/src/OpTests.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/test/src/OpTests.scala b/os/test/src/OpTests.scala index 433d960f..132ecbe8 100644 --- a/os/test/src/OpTests.scala +++ b/os/test/src/OpTests.scala @@ -10,7 +10,7 @@ import java.nio.charset.Charset object OpTests extends TestSuite { val tests = Tests { - val res = os.pwd / "os/test/resources/test" + val res = os.Path(sys.env("OS_TEST_RESOURCE_FOLDER")) / "test" test("ls") - assert( os.list(res).toSet == Set( res / "folder1", From 948a89b8d7c5cb8c70dba34a70e8abac3926da62 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 24 Oct 2024 07:26:42 +0800 Subject: [PATCH 9/9] Update .mill-version --- .mill-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mill-version b/.mill-version index 53cf705c..ac454c6a 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.0-RC3-102-b8217f +0.12.0