Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Deprecate scala.sys.process.ProcessBuilder symbolic methods #11133
This was originally reported by @smarter
referenced this issue
Oct 4, 2018
I'm unsure about the value and timing of these changes.
I'm not sure it's desirable to change the API around so drastically before it becomes a separate, community-maintained module. I think it might be more desirable to leave the API alone in the meantime, for stability, especially this late in the 2.13 cycle.
Normally making a module proceeds first by modularizing it and doing a release without changing much, then once a backwards-compatible 1.0 release has been published and the independence of the module is established, consider changing things around for 1.1 or 2.0 or ...
I'm also not sure there would be a consensus — either before or after the move to a module — on deprecating the symbolic methods. (
I perhaps shouldn't have slapped "help wanted" on this without being clear that I think some discussion is needed.
in other sys.process-related news, https://twitter.com/li_haoyi/status/1059650646616363008
FWIW, Ammonite's filesystem/subprocess module has been extracted into a standalone, less-idiosyncratic library OS-Lib. OS-Lib's subprocess handling is heavily inspired by the Python subprocess API, and is both reasonably concise and operator-free:
// Start a long-lived python process which you can communicate with val sub = os.proc("python", "-u", "-c", "while True: print(eval(raw_input()))") .spawn(cwd = wd) // Sending some text to the subprocess sub.stdin.write("1 + 2") sub.stdin.writeLine("+ 4") sub.stdin.flush() sub.stdout.readLine() ==> "7" // Sending some bytes to the subprocess sub.stdin.write("1 * 2".getBytes) sub.stdin.write("* 4\n".getBytes) sub.stdin.flush() sub.stdout.read() ==> '8'.toByte sub.destroy() // You can chain multiple subprocess' stdin/stdout together val curl = os.proc("curl", "-L" , "https://git.io/fpfTs").spawn(stderr = os.Inherit) val gzip = os.proc("gzip", "-n").spawn(stdin = curl.stdout) val sha = os.proc("shasum", "-a", "256").spawn(stdin = gzip.stdout) sha.stdout.trim ==> "acc142175fa520a1cb2be5b97cbbe9bea092e8bba3fe2e95afa645615908229e -"