Trying to run two commands in sequence, with redirected stdout + stderr using Base.pipeline, results in the second command's output being empty on MacOS 12.5.1 on a 2021 M1 Macbook Pro. This is an issue arises when using the M1-native version of Julia 1.8.1
MWE using 1.8.1, aarch64:
julia> module A
function f(command)
stdout = IOBuffer()
stderr = IOBuffer()
run(pipeline(command; stdout, stderr))
return String(take!(stdout))
end
function g()
result1 = f(`echo 123`)
result2 = f(`echo 456`)
return result1, result2
end
end
Main.A
julia> A.g()
("123\n", "")
Curiously, only redirecting stdout seems to be fine
julia> module A
function f(command)
stdout = IOBuffer()
stderr = IOBuffer()
run(pipeline(command; stdout, stderr))
return String(take!(stdout))
end
function g()
result1 = f(`echo 123`)
result2 = f(`echo 456`)
return result1, result2
end
end
Main.A
julia> A.g()
("123\n", "456\n")
Running on 1.8.1, x86-64 results in the correct output
julia> module A
function f(command)
stdout = IOBuffer()
stderr = IOBuffer()
run(pipeline(command; stdout, stderr))
return String(take!(stdout))
end
function g()
result1 = f(`echo 123`)
result2 = f(`echo 456`)
return result1, result2
end
end
Main.A
julia> A.g()
("123\n", "456\n")
Trying to run two commands in sequence, with redirected
stdout+stderrusingBase.pipeline, results in the second command's output being empty on MacOS 12.5.1 on a 2021 M1 Macbook Pro. This is an issue arises when using the M1-native version of Julia 1.8.1MWE using
1.8.1, aarch64:Curiously, only redirecting stdout seems to be fine
Running on
1.8.1, x86-64results in the correct output