10000 Tweaking by alexarchambault · Pull Request #1105 · VirtusLab/scala-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tweaking #1105

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

Merged
merged 5 commits into from
Jun 20, 2022
Merged

Tweaking #1105

merged 5 commits into from
Jun 20, 2022

Conversation

alexarchambault
Copy link
Contributor
@alexarchambault alexarchambault commented Jun 14, 2022

This PR:

  • tweaks minor things in the build (ensuring the test modules get the same scalac options as other modules, then passing -feature to them and address its warnings)
  • makes the Bloop server output redirection to a file more robust (trying to have stdout and stderr not hinder each other…)

@alexarchambault alexarchambault force-pushed the tweaking branch 2 times, most recently from 7611e15 to 1edb246 Compare June 14, 2022 14:23
@alexarchambault alexarchambault force-pushed the tweaking branch 3 times, most recently from a7ea7e9 to fdfc518 Compare June 15, 2022 17:05
Previously, we were calling redirectOutput / redirectError to redirect
the Bloop output to a (single) file. But the resulting output file
seemed to contain truncated lines, or to be missing some output. Same
with redirectErrorStream(true). My guess is that the JVM was opening the
output file twice (once for stdout, once for stderr), and writing to the
two file descriptors at the same time was a problem.

With these changes, we start the Bloop server via a shell script, and
make it do "> output-file 2>&1". The shell handles redirecting both
stdout and stderr to the same file better it seems, opening the file
only once under-the-hood I think.

Rather than doing this via a shell script, we could try to do the same
as what the shell does, by calling ourselves system calls to open the
output file (open), duplicating it (dup2?), then fork / exec. That's
more cumbersome (we'd likely have to rely on JNI, or JNA + GraalVM API,
to have it work both from the JVM and the native launcher), so we should
probably do it only if ever using the shell ends up being a problem IMO…
@alexarchambault alexarchambault merged commit 5baa3b2 into VirtusLab:main Jun 20, 2022
@alexarchambault alexarchambault deleted the tweaking branch June 20, 2022 16:47
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
0