Skip to content

Commit

Permalink
do not use UnstableIO for subprocess (in e.g. Pkg.test) (#3823)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Mar 5, 2024
1 parent 48eea8d commit 0d9aa51
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ..Artifacts: ensure_artifact_installed, artifact_names, extract_all_hashe
artifact_exists, select_downloadable_artifacts
using Base.BinaryPlatforms
import ...Pkg
import ...Pkg: pkg_server, Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE
import ...Pkg: pkg_server, Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE, UnstableIO
import ...Pkg: UPDATED_REGISTRY_THIS_SESSION, RESPECT_SYSIMAGE_VERSIONS, should_autoprecompile

#########
Expand Down Expand Up @@ -2044,8 +2044,12 @@ end

# Handles the interrupting of a subprocess gracefully to avoid orphaning
function subprocess_handler(cmd::Cmd, ctx, sandbox_ctx, error_msg::String)
stdout = sandbox_ctx.io
stderr = stderr_f()
stdout isa UnstableIO && (stdout = stdout.io)
stderr isa UnstableIO && (stderr = stderr.io)
@debug "Running command" cmd
p = run(pipeline(ignorestatus(cmd), stdout = sandbox_ctx.io, stderr = stderr_f()), wait = false)
p = run(pipeline(ignorestatus(cmd); stdout, stderr), wait = false)
interrupted = false
try
wait(p)
Expand Down

0 comments on commit 0d9aa51

Please sign in to comment.