From 6ffb4108e7b9df83a2a07e7e1d2d7b11eba3f82e Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Fri, 24 Aug 2018 13:06:16 -0700 Subject: [PATCH] Set swoval.tmpdir property on startup This change makes the temporary shared library that is created by the swoval file-tree-views library to be extracted into the sbt global base directory rather than the temp file. This way if there is a leak of shared libraries, they can easily be found in ~/.sbt rather than in, say, /tmp (or the osx/windows equivalent location). The extracted shared library objects will be in the path ~/.sbt/swoval-jni. There is a shutdown hook that removes them as well as a garbage collection process that runs in the background whenever the swoval library is loaded, so these shouldn't leak uncontrollably. --- main/src/main/scala/sbt/internal/Load.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/main/src/main/scala/sbt/internal/Load.scala b/main/src/main/scala/sbt/internal/Load.scala index afa0125f4..cf62b1fc6 100755 --- a/main/src/main/scala/sbt/internal/Load.scala +++ b/main/src/main/scala/sbt/internal/Load.scala @@ -113,6 +113,7 @@ private[sbt] object Load { val delegates = defaultDelegates val pluginMgmt = PluginManagement(loader) val inject = InjectSettings(injectGlobal(state), Nil, const(Nil)) + System.setProperty("swoval.tmpdir", System.getProperty("swoval.tmpdir", globalBase.toString)) LoadBuildConfiguration( stagingDirectory, classpath,