Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4560: Explicitly redirect JS envs outputs to System.{out,err}. #4595

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Nov 17, 2021

When running in server mode, sbt installs alternative streams for System.out and System.err. However, those alternatives are not guaranteed to be used when launching JSEnvs with inheritOut and inheritErr set to true. In particular, a JSEnv that spawns separate processes with the inheritIO mode will bypass redirections set up with System.set{Out,Err}.

We now explicitly redirect the outputs of JS envs to System.out and System.err, so that they always take the alternative streams set up by sbt into account.


Resubmission of #4580 with a squashed commit.

…,err}.

When running in server mode, sbt installs alternative streams for
`System.out` and `System.err`. However, those alternatives are not
guaranteed to be used when launching JSEnvs with `inheritOut` and
`inheritErr` set to `true`. In particular, a JSEnv that spawns
separate processes with the inheritIO mode will bypass
redirections set up with `System.set{Out,Err}`.

We now explicitly redirect the outputs of JS envs to `System.out`
and `System.err`, so that they always take the alternative streams
set up by sbt into account.
@sjrd sjrd merged commit ae48670 into scala-js:master Nov 17, 2021
@sjrd sjrd deleted the redirect-jsenvs-to-system-out-err branch November 17, 2021 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants