LonoCloud / lein-voom

Tool for generating artifacts versioned on the most recent git commit sha and commit time.
Eclipse Public License 2.0
97 stars 14 forks source link

Failure to `lein voom install` with Date.parse error #58

Open justinstoller opened 7 years ago

justinstoller commented 7 years ago

We have a new voom version we're trying to promote and are seeing failures with it. The stack trace:

java.lang.IllegalArgumentException: null
 at java.util.Date.parse (Date.java:617)
    java.util.Date.<init> (Date.java:274)
    leiningen.voom$get_voom_version.invokeStatic (voom.clj:132)
    leiningen.voom$get_voom_version.doInvoke (voom.clj:121)
    clojure.lang.RestFn.invoke (RestFn.java:439)
    leiningen.voom$get_project_version.invokeStatic (voom.clj:148)
    leiningen.voom$get_project_version.invoke (voom.clj:146)
    leiningen.voom$wrap.invokeStatic (voom.clj:900)
    leiningen.voom$wrap.doInvoke (voom.clj:884)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invokeStatic (core.clj:650)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.voom$install.invokeStatic (voom.clj:919)
    leiningen.voom$install.doInvoke (voom.clj:914)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.voom$voom.invokeStatic (voom.clj:1384)
    leiningen.voom$voom.doInvoke (voom.clj:1372)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    clojure.lang.Var.invoke (Var.java:383)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.core.main$partial_task$fn__5932.doInvoke (main.clj:272)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.core.main$apply_task.invokeStatic (main.clj:322)
    leiningen.core.main$apply_task.invoke (main.clj:308)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:328)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:324)
    leiningen.core.main$_main$fn__5998.invoke (main.clj:401)
    leiningen.core.main$_main.invokeStatic (main.clj:394)
    leiningen.core.main$_main.doInvoke (main.clj:391)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:383)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.main$main_opt.invokeStatic (main.clj:314)
    clojure.main$main_opt.invoke (main.clj:310)
    clojure.main$main.invokeStatic (main.clj:421)
    clojure.main$main.doInvoke (main.clj:384)
    clojure.lang.RestFn.invoke (RestFn.java:457)
    clojure.lang.Var.invoke (Var.java:394)
    clojure.lang.AFn.applyToHelper (AFn.java:165)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)

We are running 0.1.0-20140716_032004-g85e4c9b in Travis (a private project), but I've replicated this locally with the latest canonical release as well. Locally I'm running

git --version
git version 2.11.0 (Apple Git-81)

java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

Installing a local build of lein-voom I've inserted some print statements to show what lein-voom is seeing with the process:

Using 2G max heap since not set via PUPPETSERVER_HEAP_SIZE environment variable or user.puppetserver-heap-size in ~/.lein/profiles.clj file. Set to at least 5G for best performance during test runs.
"**********" "--pretty=%h,%cd" "*********"
"**********" "/Users/justin/Backup/code/work/server/pe-puppet-server-extensions/checkouts/puppet-server" "*********"
"*********" "3f87eb46,2017-08-15\n" "*********"
"****" "3f87eb46" "****" "2017-08-15" "***"
java.lang.IllegalArgumentException: null
 at java.util.Date.parse (Date.java:617)

Updating the code as I have done here: https://github.com/justinstoller/lein-voom/commit/5e6a4fd9c4557130c13ff03147cc57828410c772

seems to fix it for me locally, though I assume on older versions of Java and/or Git it will cause a regression? I'm not sure how it worked previously.

abrooks commented 7 years ago

Thanks for the bug report and the patch!

I'll take a look more closely and think about what this would mean for older versions. I'm inclined to say that time marches forwards and so should people's Java and Git versions but should probably at least consider what impact that might be.