Tested pos/neg compilation of a simple hello world file, running said
file & a simple uTest test suite.
Uses things already downloaded in ~/.ivy2/cache, & shares ~/.sbt/boot
for the compiler-bridge component.
This is what it looks like now! 🎉
> sbtOn /s/t-sbtOn
[...]
[info] Running (fork) sbt.RunFromSourceMain /s/t-sbtOn
Listening for transport dt_socket at address: 5005
[warn] sbt version mismatch, current: 1.0.3, in build.properties: "1.1.0", use 'reboot' to use the new value.
[info] Loading settings from idea.sbt,global-plugins.sbt ...
[info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/1.0/plugins
[info] Updating ProjectRef(uri("file:/Users/dnw/.sbt/1.0/plugins/"), "global-plugins")...
[info] Done updating.
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /s/t-sbtOn/project
[info] Updating ProjectRef(uri("file:/s/t-sbtOn/project/"), "t-sbton-build")...
[info] Done updating.
[info] Loading settings from build.sbt ...
[info] Set current project to t (in build file:/s/t-sbtOn/)
[info] sbt server started at local:///Users/dnw/.sbt/1.0/server/2c27eaf4c750902a3a41/sock
> show baseDirectory
[info] /s/t-sbtOn
> exit
[info] shutting down server
[success] Total time: 34 s, completed 16-Jan-2018 14:37:32
> Exception in thread "Thread-17" java.io.IOException: Stream closed
at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
at java.io.OutputStream.write(OutputStream.java:116)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
at scala.sys.process.BasicIO$.$anonfun$input$1(BasicIO.scala:200)
at scala.sys.process.BasicIO$.$anonfun$input$1$adapted(BasicIO.scala:198)
at scala.sys.process.ProcessBuilderImpl$Simple.$anonfun$run$2(ProcessBuilderImpl.scala:75)
at scala.sys.process.ProcessImpl$Spawn$$anon$1.run(ProcessImpl.scala:23)
> show {.}/baseDirectory
[...]
[info] ThisBuild / baseDirectory
[info] /d/sbt
Apparently an empty comment line, meaning a single '#' on a line,
cannot be fed to scripted, which will complain with an odd error
message.
This commit tweaks the comments in the tests/fork-parallel file
so that there are no empty comment lines.
Fixes#3821
Initially I missed why #3821 was failing.
Looking at it again, the error message reads:
```
Caused by: java.lang.IllegalArgumentException: Interface (NGWin32NamedPipeLibrary) of library=kernel32 does not extend Library
at com.sun.jna.Native.loadLibrary(Native.java:566)
at sbt.internal.NGWin32NamedPipeLibrary.<clinit>(NGWin32NamedPipeLibrary.java:38)
... 7 more
```
Inside `Native.loadLibrary`, it requires the "library" interface to extend `com.sun.jna.Library`, which this adds.
There are just too many instances in which sbt's code relies on
the `lastModified`/`setLastModified` semantics, so instead of moving
to `get`/`setModifiedTime`, we use new IO calls that offer the new
timestamp precision, but retain the old semantics.
Previously I was seeing the error upon the first scripted test. I thought it was because Main was somehow not early enough. It might just be because scripted technically runs as part of the build.
Ref sbt/io#110
Fixes#3823
When you launch a second instance of sbt on a build, prior to this change it was displaying `java.io.IOException: sbt server is already running` on every command. This make it a bit less aggressive, and just display a warning once.
```
[warn] Is another instance of sbt is running on this build?
[warn] Running multiple instances is unsupported
```