Skip to content

Commit 2cfebd9

Browse files
authored
Fix build failures (#64)
Fixing 3 issues: (1) SpawningSubProcessTests::"spawn callback" has a race condition that causes occasional failures. It should use SubProcess#join instead of SubProcess#waitFor in order to guarantee that all stdout and stderr from the subprocess is handled. (2) Scala3 compilation fails when passing the "-release" flag to the compiler (3) There is no macOS-11.0 support in GitHub Actions Commits: * use SubProcess#join instead in SubProcess#waitFor in spwan callback test * don't specify the scalac -release flag for Scala3 * [os.watch] Darwin doesn't generate callbacks for updates to hard links * Removed macos-11.0 from github workflow Why? because it fails to start. Pull request: #64 Co-authored-by: Ahmed Gheith <[email protected]>
1 parent ae68921 commit 2cfebd9

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
strategy:
66
fail-fast: false
77
matrix:
8-
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest, macos-11.0]
8+
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest]
99
java-version: [1.8, 11]
1010

1111
runs-on: ${{ matrix.os }}

build.sc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ trait OsModule extends OsLibModule{
136136
def ivyDeps = Agg(
137137
ivy"com.lihaoyi::geny::0.6.5"
138138
)
139-
def scalacOptions = Seq("-release", "8")
139+
//def scalacOptions = Seq("-release", "8")
140+
def scalacOptions = T{ if (scalaVersion().startsWith("3")) Seq() else Seq("-release", "8") }
140141
}
141142

142143
trait WatchModule extends OsLibModule{

os/test/src-jvm/SpawningSubprocessesTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ object SpawningSubprocessesTests extends TestSuite {
134134
val output: mutable.Buffer[String] = mutable.Buffer()
135135
val sub = os.proc("echo", "output")
136136
.spawn(stdout = ProcessOutput((bytes, count) => output += new String(bytes, 0, count)))
137-
val finished = sub.waitFor(5000)
137+
val finished = sub.join(5000)
138138
sub.wrapped.getOutputStream().flush()
139139
assert(finished)
140140
assert(sub.exitCode() == 0)

os/watch/test/src/WatchTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ object WatchTests extends TestSuite{
120120
case "Linux" => Set(os.sub / "newlink3")
121121
case "Mac OS X" =>
122122
Set(
123-
os.sub / "newlink3",
123+
//os.sub / "newlink3",
124124
os.sub / "folder3" / "nestedA",
125125
os.sub / "folder3" / "nestedA" / "a.txt",
126126
)

0 commit comments

Comments
 (0)