Skip to content

Commit

Permalink
Fix and ignore binary compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lolgab committed Aug 29, 2024
1 parent f677c90 commit c7dc57f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ trait SafeDeps extends ScalaModule {
}

trait MiMaChecks extends Mima {
def mimaPreviousVersions = Seq("0.9.0", "0.9.1", "0.9.2", "0.9.3", "0.10.0")
def mimaPreviousVersions = Seq("0.9.0", "0.9.1", "0.9.2", "0.9.3", "0.10.0", "0.10.1", "0.10.2", "0.10.3", "0.10.4")
override def mimaBinaryIssueFilters: T[Seq[ProblemFilter]] = Seq(
ProblemFilter.exclude[ReversedMissingMethodProblem]("os.PathConvertible.isCustomFs"),
// this is fine, because ProcessLike is sealed (and its subclasses should be final)
ProblemFilter.exclude[ReversedMissingMethodProblem]("os.ProcessLike.joinPumperThreadsHook")
ProblemFilter.exclude[ReversedMissingMethodProblem]("os.ProcessLike.joinPumperThreadsHook"),
ProblemFilter.exclude[MissingTypesProblem]("os.proc$")
)
}

Expand Down
9 changes: 9 additions & 0 deletions os/src/ProcessOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,16 @@ case class proc(command: Shellable*) {
}

object proc {

/**
* The env passed by default to child processes
*/
val env = new scala.util.DynamicVariable[Map[String, String]](sys.env)

// TODO: Delete when in binary compatibity breaking window
def andThen[T](f: proc => T): Seq[Shellable] => T = s => f(apply(s))
// TODO: Delete when in binary compatibity breaking window
def compose[T](f: T => Seq[Shellable]): T => proc = t => apply(f(t))
}

/**
Expand Down
4 changes: 2 additions & 2 deletions os/test/src/SubprocessTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ object SubprocessTests extends TestSuite {
test("envWithValue") {
if (Unix()) {
def envValue() = os.proc("bash", "-c", "echo \"$TEST_ENV_FOO\"").call().out.lines().head

val before = envValue()
assert(before == "")

os.proc.env.withValue(Map("TEST_ENV_FOO" -> "bar")) {
val res = envValue()
assert(res == "bar")
Expand Down

0 comments on commit c7dc57f

Please sign in to comment.