You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe what I am trying to do is a terrible idea, but it seems to demonstrate a strange bug in SBT or Ninja. SBT is "Scala Build Tool". I have a complex project where each part has its own build system (such as SBT) and I just want a higher level dependency description to tie them together. ("We need to rebuild this subproject only if that subproject changed.") I'm just trying different tools for this, and I tried Ninja with interesting results.
$ mkdir ninja-vs-sbt && cd ninja-vs-sbt
$ sbt about
[info] Set current project to ninja-vs-sbt (in build file:/home/darabos/ninja-vs-sbt/)
[info] This is sbt 0.13.11
[info] The current project is {file:/home/darabos/ninja-vs-sbt/}ninja-vs-sbt 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.6
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.6
$ ninja --version
1.7.1
$ cat <<EOF > build.ninja
rule sbt
command = sbt about
build x: sbt
EOF
$ ninja
[0/1] sbt about
It just hangs.
$ ps aux | grep sbt
darabos 21829 0.0 0.0 4508 752 pts/30 T 23:47 0:00 /bin/sh -c sbt about
darabos 21830 0.0 0.0 21416 3288 pts/30 T 23:47 0:00 bash /usr/bin/sbt about
darabos 21899 10.8 0.2 3716728 91712 pts/30 Tl 23:47 0:00 java -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxMetaspaceSize=256m -jar /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar about
$ kill -9 21829
The JVM starts, but I cannot connect to it with jstack to tell what it is up to. From strace it looks like it gets stuck after running stty:
After that it seems this SIGTTOU signal goes and stops all parent processes. (There are 21 more stopped by SIGTTOU lines for different PIDs.)
I decided to raise this issue with Ninja rather than SBT because SBT works fine when I run it normally. It works fine when I run it from a script, or when I redirect its inputs and outputs to /dev/null. It looks more like Ninja may put it in a sort of broken environment.
I see the same behavior on Ubuntu 16.04 and macOS 10.12.
The text was updated successfully, but these errors were encountered:
It looks like SBT does not deal well with SIGTTOU and it gets SIGTTOU because it uses JLine which wants to write to the controlling terminal even when it is not the active process. It can be reproduced without Ninja:
$ sbt about &
[1]+ Stopped sbt about
(Not the program is just stopped, not terminated. It finishes successfully if you fg, but otherwise hangs forever.)
There is a workaround:
sbt -Djline.terminal=jline.UnsupportedTerminal about &
I can just add this flag to any SBT command.
I guess I'll raise this issue with SBT. Sorry for the noise here! 😊
Maybe what I am trying to do is a terrible idea, but it seems to demonstrate a strange bug in SBT or Ninja. SBT is "Scala Build Tool". I have a complex project where each part has its own build system (such as SBT) and I just want a higher level dependency description to tie them together. ("We need to rebuild this subproject only if that subproject changed.") I'm just trying different tools for this, and I tried Ninja with interesting results.
It just hangs.
The JVM starts, but I cannot connect to it with
jstack
to tell what it is up to. Fromstrace
it looks like it gets stuck after runningstty
:After that it seems this
SIGTTOU
signal goes and stops all parent processes. (There are 21 morestopped by SIGTTOU
lines for different PIDs.)I decided to raise this issue with Ninja rather than SBT because SBT works fine when I run it normally. It works fine when I run it from a script, or when I redirect its inputs and outputs to
/dev/null
. It looks more like Ninja may put it in a sort of broken environment.I see the same behavior on Ubuntu 16.04 and macOS 10.12.
The text was updated successfully, but these errors were encountered: