sbt temporary directories

1,098 views
Skip to first unread message

Nikolay Botev

unread,
Dec 3, 2011, 10:58:45 PM12/3/11
to simple-build-tool
I started using sbt recently, and I see tons of directories under my
USERHOME directory, like this:

c:/users/nikolay/sbt_xxxx

also there are all these sbt_XXXXXXXXXX.log files there.

None of these appears to be needed and I have been removing them.
After actively using sbt for a day or so though, I had 150+ sbt
directories in my home.

Is there a way to configure sbt to use a different (%TEMP%) directory
for its logging/transient data?

I googled a bit but could not find anything online. I also did read
through the entire getting started guide but I did not find any
mention of sbt temp directories and configuring them.

Thanks,
-Nikolay

Mark Harrah

unread,
Dec 4, 2011, 9:41:41 PM12/4/11
to simple-b...@googlegroups.com
Hi Nikolay,

On Sat, 3 Dec 2011 19:58:45 -0800 (PST)
Nikolay Botev <bono...@gmail.com> wrote:

> I started using sbt recently, and I see tons of directories under my
> USERHOME directory, like this:
>
> c:/users/nikolay/sbt_xxxx

sbt uses the standard temporary directory given by the java.io.tmpdir system property. I don't know why Java has your home directory as the temporary directory, but the java.io.tmpdir property is what you should look into.

-Mark

Nikolay Botev

unread,
Dec 5, 2011, 11:32:50 PM12/5/11
to simple-build-tool
Mark,

Thanks for the reply. I nailed the problem down to running sbt without
the TEMP or TMP environment variables set.

I run sbt on Windows from a cygwin bash shell and, for some reason,
neither TMP nor TEMP is set in cygwin. When neither TMP nor TEMP is
set, Java defaults java.io.tmpdir to my home directory.

The problem happens whether I use a bash script or batch file
launcher, as long as I am inside a cygwin bash shell.

I use a bash script, so I simply added the following to the java sbt
command:

-Djava.io.tmpdir="$LOCALAPPDATA\\Temp\\"

and life is good (the LOCALAPPDATA directory is present in cygwin).

While at it, another customization I had to do to get sbt running
within cygwin was to set the jline terminal to Unix explicitly as
described here http://stackoverflow.com/questions/8123949/sbt-cant-run-interactively-from-mintty-on-cygwin


Thanks,
-Nikolay

On Dec 4, 6:41 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> Hi Nikolay,
>
> On Sat, 3 Dec 2011 19:58:45 -0800 (PST)
>

Maxime Lévesque

unread,
Dec 6, 2011, 7:04:29 AM12/6/11
to simple-b...@googlegroups.com

In the spirit of "everything is a Setting", shouldn't this be a Setting ?

I found that in learning SBT, once I started to systematically translate questions like  :

  "How can I do X"

into

  "What is the sbt.Key of the setting that I need to override to achieve X"

things have become more pleasant.

ML

2011/12/5 Nikolay Botev <bono...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.


Reply all
Reply to author
Forward
0 new messages