martinklepsch / tenzing

⚡️ Clojurescript application template using Boot
Eclipse Public License 1.0
404 stars 39 forks source link

WARNING: unable to produce boot.properties file #47

Open sonwh98 opened 8 years ago

sonwh98 commented 8 years ago

here is the shell output:

sto@obi:~/workspace$ lein new tenzing foobar
Generating fresh 'lein new' tenzing project.
WARNING: unable to produce boot.properties file.
crisptrutski commented 8 years ago

The boot.properties file is generated using boot itself, can you try the following:

boot -V BOOT_CLOJURE_VERSION="1.7.0" boot -V

Perhaps you don't have boot installed yet?

sonwh98 commented 8 years ago

I do have boot installed:

sto@obi:~/workspace$ boot -V
#http://boot-clj.com
#Tue Dec 22 17:23:03 EST 2015
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.5.2

perhaps when the shell is executed boot is not in the path? I installed boot in /usr/local/bin

sonwh98 commented 8 years ago

BTW, thanks to all the contributors for this template! great place to start for someone migrating from lein

crisptrutski commented 8 years ago

Damn, was hoping it was something super simple :wink:

Perhaps try this from boot repl to get an idea of what the error is:

(require '[clojure.java.shell :as sh])
(sh/sh "boot" "-V" :env {:BOOT_CLOJURE_VERSION "1.7.0"})

The path explanation doesn't seem to fit, this would be inherited from your shell, which you've demonstrated to have boot.

sonwh98 commented 8 years ago

@crisptrutski thanks for the tip.

boot.user=> (sh/sh "boot" "-V" :env {:BOOT_CLOJURE_VERSION "1.7.0"})
{:exit 127, :out "", :err "/usr/local/bin/boot: line 6: exec: java: not found\n"}

It seems java isn't in the PATH of boot. Reading the docs of clojure.java.shell, it seems providing an :env map overrides the environmental of the current user.

without the :env param, it was able to find java and executed fine

boot.user=> (sh/sh "boot" "-V" )
{:exit 0, :out "#http://boot-clj.com\n#Fri Dec 25 20:02:29 EST 2015\nBOOT_CLOJURE_NAME=org.clojure/clojure\nBOOT_CLOJURE_VERSION=1.7.0\nBOOT_VERSION=2.5.2\n", :err ""}
crisptrutski commented 8 years ago

@martinklepsch perhaps we should remove this env variable, since 1.7.0 is the default now anyway

crisptrutski commented 8 years ago

@sonwh98 do you any suggestions to make this more robust?

sonwh98 commented 8 years ago

The template works fine without the boot.properties so why not just remove it?

crisptrutski commented 8 years ago

It was created because 1.6.0 was still popular at the time but wasn't supported, probably could survive without it now. Creating a boot.properties file is still best practice though...

Perhaps attempt to create it, and on failure just issue a warning line saying unable to create, and showing the command.