Fork me on GitHub
#boot
<
2016-11-10
>
micha03:11:22

@kenny that's done at the maven layer, it caches snapshots for 24 hours

kenny03:11:21

@micha is there a way to force snapshot checking?

micha03:11:45

you can override that in the :repositories setting by adding :update :always to the repository vector

micha03:11:58

or you can add this to your build.boot before you call set-env!:

micha03:11:12

(boot.pod/with-eval-worker
  (boot.aether/set-update! :always))

micha03:11:31

it's not an exact science with maven though

micha03:11:13

if all else fails you can delete the snapshot from your local ~/.m2/repositories/

kenny03:11:44

By the repository vector, do you mean [mygroup/name “0.1.0-SNAPSHOT” :update :always]?

micha03:11:15

no, the :repositories key in the env, where you configure the maven repos boot will use to get deps from

micha03:11:21

you can see it if you do boot show -e

micha03:11:28

and look for :repositories

micha03:11:43

you will see the default ones there if you havent set them yourself in set-env!

micha03:11:33

:repositories
 [["clojars" {:url ""}]
  ["maven-central" {:url ""}]]

micha03:11:38

that's the default

kenny03:11:47

Where does the :update :always go?

micha03:11:51

you can do this:

micha03:11:20

(set-env!
 :repositories
 [["clojars" {:url "" :update :always}]
  ["maven-central" {:url ""}]])

micha03:11:53

or globally override with this

micha03:11:01

(boot.pod/with-eval-worker
  (boot.aether/set-update! :always))

kenny03:11:02

And that causes boot (maven) to fetch snapshot updates every time you run boot?

kenny03:11:11

Only snapshots?

micha03:11:19

it means it looks for new snapshots each time

micha03:11:27

snapshots are a special case

micha03:11:33

usually versions are immutable

micha03:11:41

so it either has them in the cache or not

micha03:11:01

once it's in the cache it can get the jar from there without needing to consult remote repositories

micha03:11:31

it can be extremely slow if you needed to check every dependency every time with the remote repo

micha03:11:41

so maven assumes the dependencies are immutable

micha03:11:49

with snapshots it caches them for 24 hours

micha03:11:55

unless you do the thing

micha03:11:04

then it checks every time

micha03:11:19

but it's still not an exact science like i said

kenny03:11:26

Can you specify which deps you want it to update every time?

micha03:11:27

sometimes it doesn't see the newest thing

kenny03:11:46

So the only option for :update is :always?

micha03:11:31

the other possiblities can be found in the pomegranate repo

micha03:11:34

in aether.clj

micha03:11:47

:daily is the default

micha03:11:09

you can also do :never

kenny03:11:08

Okay got it. We’ve been having this problem lately where SNAPSHOT versions from our S3 maven repo are overriding a locally built SNAPSHOT (e.g. boot pom jar install). This can cause some seriously confusing results 😛

kenny03:11:18

Often the only solution is to delete the “infected” part of our local maven and install the artifact again

micha03:11:23

yeah that's why i avoid snapshots now

micha03:11:35

i tried making boot snapshots

micha03:11:45

but it never worked properly

micha03:11:00

especially when doing like you said, developing locally

kenny03:11:32

Do you have a replacement for SNAPSHOT? -alpha or something? It seems like some sort of suffix is necessary to denote that a build is not final and probably unstable.

micha03:11:52

yeah alpha is good, or rc

kenny03:11:10

That makes sense to me. The snapshot thing always has been a little hairy - as you said, best to just avoid it

micha03:11:22

yeah it's a little too fancy

micha03:11:37

i've been eliminating anything fancy one by one

micha03:11:48

feel much better now 🙂

alandipert03:11:24

version ranges, another thing to avoid

alandipert03:11:50

particularly because don't play nice when you do the alpha/`rc ` thing

kenny03:11:57

Oh yeah totally. Never really liked that anyways. Builds should be consistent and having version ranges opens up room for inconsistency.

kenny04:11:54

@micha Last week you said you were going to try and cut a new release of boot. Any progress on that? 🙂 I really want https://github.com/boot-clj/boot/issues/471. It’s still plaguing me 😩

borkdude09:11:38

How do I compile Java in a boot project?

dominicm09:11:06

There's a javac task, of the top of my head

borkdude10:11:43

when I do boot pom it outputs a pom.xml, but how do I persist that? I want to use it to edit some Java in my project by IntelliJ

borkdude11:11:14

something like this? boot pom -- target -d .

borkdude11:11:24

that was not a good idea..

mynomoto12:11:10

@borkdude probably the target task needs a more aggressive warning about removing what is in the destination path.

borkdude12:11:45

the output pom.xml only has the dependencies, it’s not what I can use for IntelliJ in this project. I’ll just write my own.

bhagany12:11:18

I’m seeing some behavior from boot that I can’t explain. I have a pretty simple build.boot - it defines one task that works. Just adding the dependency [circleci/clj-yaml "0.5.5" :scope “test”] to build.boot makes the task ceases to work. Specifically, the fileset mysteriously empties mid-task. Again, the only change is the addition of a dependency in set-env!. I’m not sure how to begin attacking this, and I would appreciate any insight. I can provide full details if that would be helpful, but I don’t want to flood the channel (like I did in #perun… sorry).

bhagany12:11:32

I should also probably mention that I just started using boot

dominicm13:11:12

@borkdude It might work if you do target --no-clean -d .

borkdude13:11:31

@dominicm thanks

micha14:11:13

@bhagany sure can you paste your build.boot in a snippet please?

micha14:11:54

@borkdude possibly something like

micha14:11:54

boot \
  pom \
  sift --include 'pom.xml$' \
  sift --move '(pom.xml)$:$1' \
  target --no-clean -d .

piotrek14:11:22

Hello, I have (I guess) a simple question: what is the preferred way to setup boot project with cljs using npm modules?

piotrek14:11:16

I saw boot-npm but it’s lacking documentation and it’s not clear for me if will “manage” npm deps for my cljs code (e.g. npm deps will be available on my cljs “classpath”)

piotrek14:11:25

Is there a boot project example or template showing a hello world cljs app targeted for node using npm deps?

bhagany14:11:36

@micha okay, thanks:

(set-env!
 :source-paths #{"src" "content"}
 :resource-paths #{"resources"}
 :dependencies '[[pandeiro/boot-http "0.7.0"]
                 [adzerk/boot-cljs "1.7.228-2" :scope "test"]
                 [adzerk/boot-reload "0.4.12" :scope "test"]
                 [hiccup "1.0.5"]
                 [perun "0.3.0" :scope "test"]
                 #_[circleci/clj-yaml "0.5.5" :scope "test"]
                 [org.pegdown/pegdown "1.6.0" :scope "test"]])

(require '[adzerk.boot-cljs :refer [cljs]]
         '[pandeiro.boot-http :refer [serve]]
         '[adzerk.boot-reload :refer [reload]]
         '[io.perun :as p])

(deftask dev
  []
  (comp (serve :resource-root "public/")
        (watch)
        (p/markdown)
        (p/render :renderer 'nicerthantriton.core/dev-page)
        (reload :asset-path "/public")
        (cljs)
        (p/print-meta)))

bhagany14:11:07

this is the working version. Uncommenting the clj-yaml line makes it the not-working version.

bhagany14:11:39

when it doesn’t work, p/markdown sees a populated fileset, but p/render doesn't

micha14:11:29

@bhagany try boot show -p

micha14:11:40

with the clj-yaml dependency uncommented

micha14:11:45

and look for conflicts

micha14:11:32

you'll probably see some dependency conflict there

micha14:11:53

you may be able to update something or use :exclusions to get it to work

micha14:11:29

sometimes though the dependencies are simply incompatible

micha14:11:35

that's when you use a pod

micha14:11:15

but there are other yaml libraries out there, maybe try one of those

bhagany14:11:33

@micha okay, thank you for pointing me in a direction

bhagany14:11:11

boot show -p was instructive, this should get me where I need to be

micha14:11:32

also boot show -d might be helpful

micha14:11:46

and boot show -u sometimes too

bhagany14:11:52

perfect, thank you

micha14:11:01

boot show -h will show all the things

borkdude19:11:37

I’m compiling some Java code at the start of a task. This works fine. Also the imported code works fine from Clojure. But when I start developing, I see all sorts of Java error messages, about unresolved imports

borkdude19:11:47

Like this:

dre/infixsuggester/Term.java:3: error: package org.apache.lucene.search.suggest does not exist
import org.apache.lucene.search.suggest.Lookup;
I have no idea, because the code is already compiled and works fine...

alandipert19:11:40

i would make a cat task and use it like boot pom cat -f pom.xml > pom.xml

borkdude19:11:13

Any ideas on the weird java compilation problem? I think I’m going to move the Java code to a separate project

alandipert19:11:27

@borkdude what do you mean by "start developing?"

borkdude19:11:37

evaluating some code

borkdude19:11:10

If I know how to reproduce it, I’ll post it here.

alandipert19:11:10

cool. a separate project isn't a bad idea, java and repl don't mix esp. well by default

borkdude19:11:30

yes, and probably I could also install the project and reload it from the REPL..?

alandipert19:11:41

yeah - or do the checkouts thing

alandipert19:11:00

continuously recompile and install in another terminal, then use checkouts from your application to bring it in

alandipert19:11:14

not sure if that makes the repl aspect better or worse though

alandipert19:11:17

see boot -h... it's a way to depend on a locally installed project in an automatically-refreshing way

alandipert19:11:23

to serve the case of working on an app and a library at the same time

alandipert19:11:19

he reloads the clj nses after adding new classes to classpath, maybe that's the missing piece in boot world

micha19:11:50

one issue with java classes is that you can't reload them, as far as i know

micha19:11:08

you can reload clojure namespaces only because the classes are gensym

alandipert19:11:25

yeah i thought it required hooking up 'instrumentation' like jrebel, but he's doing it somehow, don't know if his approach is lein specific or what

micha19:11:03

interesting

alandipert19:11:47

aha, i see a bunch of javastar code in there

alandipert19:11:01

wow that file is filled with incredible clj hacks

micha19:11:03

seems like that could be adjusted to work in boot

micha19:11:23

remove all the file watching and all that

richiardiandrea19:11:47

wow did not know about virgil, I might need that soon actually

alandipert20:11:54

yeah i think it can

alandipert20:11:10

the code is mostly the same as our javac, as both are derived from javastar

alandipert20:11:22

just need to add the modify-the-classcache trick

alandipert20:11:39

and add the ns reloading thing, maybe optionally

micha20:11:41

why is ns reloading combined with java compiling?

alandipert20:11:10

i think because import

alandipert20:11:19

if the import code doesn't run again, the clj classloader serves stale class entries

alandipert20:11:01

altho, i'm not sure if that's material, or just to suppress warnings, or what

lwhorton20:11:26

Does boot have any equivalent to the existing private repos on s3 via s3-wagon for gcloud?

lwhorton20:11:46

i.e. I’m not using AWS and I want to push/pull from some artifact server hosted on a gcloud compute instance, and in trying to figure out which to use (artifactory, nexus, etc) I wanted to see what/if boot already supports.

alandipert21:11:25

@lwhorton https://clojars.org/gcloud-wagon-private looks promising, never seen it used with boot tho. or used gcloud

alandipert21:11:49

'gcloud wagon' is the google fu

lwhorton23:11:39

thanks @alandipert ill take a look

ag23:11:48

hey… guys… how do I run a task that includes cljs compilation and then (start-repl) AFTER it’s done compiling? so if I do this (boot (dev)(start-repl)) it seems to be “choking up”. If I wrap dev into a future like this:

(deftask start []
  (future (boot (dev)))
  identity)
and the run (boot (start)(start-repl) - it tries to jump into repl prematurely. So how do I do it?

ag23:11:21

hint: I’m trying to set CIDER’s cider-cljs-lein-repl so when jack-in-clojurescript it would create a correct repl (not default/useless via Rhino)