Fork me on GitHub
#boot
<
2016-02-11
>
jethroksy02:02:54

@micha: re: https://github.com/boot-clj/boot/issues/409 just tried (yada "public") doesn't work

jethroksy02:02:25

has to be (yada "resources/public") or my :resource-paths has to be #{"resources/public"} which also affects the jar structure

jethroksy02:02:54

on the bright side 2.6.0-SNAPSHOT works on the most part

micha02:02:51

@jethroksy: in 2.6.0-SNAPSHOT the fileset no longer makes files read-only, as a workaround for the windows issues

jethroksy02:02:57

ran into an emacs issue where reload stops working

jethroksy02:02:04

Exception in thread "Thread-12" java.nio.file.NoSuchFileException: src/tob/.#handler.clj

micha02:02:10

but if you were running into issues beacuse of it on linux i think you may have worse problems now

jethroksy02:02:24

is there an equivalent of .gitignore for boot

micha02:02:30

because writing to any of those files will cause issues in the fileset

micha02:02:45

yes there is a file you can make, named .bootignore

micha02:02:52

with one java style regex per line

jethroksy02:02:23

ah but it doesn't propogate down sub dirs right?

jethroksy02:02:10

i remember some time ago the pattern matching was rather inflexible

micha02:02:41

any paths matching a regex will be ignored

jethroksy02:02:54

so it matches /.#foo.clj but might will not match /bar/.#foo.clj

micha02:02:00

these are fileset paths

micha02:02:12

well they're all relative paths for one thing

jethroksy02:02:35

I'll play around, see what I can do

micha02:02:49

foo\.jlj$
/bar\.clj$

micha02:02:02

that will ignore asdf/qwer-foo.clj

micha02:02:07

in the fileset

micha02:02:10

for example

micha02:02:23

or xzcv/qwer/bar.clj

micha02:02:32

but not bar.clj

jethroksy02:02:37

that's great!

jethroksy02:02:56

so to ignore *.#* it'd be

micha02:02:18

oh the emacs tempfiles

micha02:02:26

(?=^|/)\.#

jethroksy02:02:45

I'll make a note on the boot wiki

micha02:02:52

something like that

micha02:02:11

or maybe cleaner just split into 2 lines

micha02:02:30

^\.#
/\.#

jethroksy02:02:51

seems like only the latter is necessary?

micha02:02:12

if you have :source-paths #{"src"}

jethroksy02:02:18

^ is for multi line strings right

micha02:02:20

and there is a file named src/.#foop

micha02:02:40

the path boot will be applying the regex to is .#foop

micha02:02:06

(re-find #"/\.#" ".#foop") => nil

jethroksy02:02:46

can't I just match all, i.e discard the backslash

micha02:02:17

then you could have the file src/hi.#there

micha02:02:23

and it would be ignored, too

jethroksy02:02:55

shouldn't be a problem but I'll use the one you posted anyway

jethroksy02:02:09

thanks for explaining, I'll put up the example matches on boot wiki

micha02:02:15

awesome, thanks!

jethroksy02:02:23

regex is hard

micha02:02:26

i don't think the .bootignore is documented in the wiki anywhere yet

jethroksy02:02:19

it seems to have fixed all my problems with snapshot! simple_smile

micha02:02:43

can you link to a github repo with the yada stuff you're having problems with?

micha02:02:59

if i could see the setup maybe something will jump out

jethroksy02:02:43

sure, give me a moment (the repo is private)

micha02:02:56

or a minimal repro case would be ideal

jethroksy03:02:24

sent you a DM

alandipert04:02:40

apropos recent convo about producing standalone executables by various means, just put together https://github.com/alandipert/docker-mlton today

danielsz04:02:06

@alandipert: How do you enjoy writing in ML? Quite a different experience, no?

alandipert04:02:01

it's ok, clojure knowledge ported well enough to get going quickly

alandipert04:02:39

i like how weird it is, at the very least

alandipert04:02:29

also it's refreshing to make a program with no build tool or dependencies πŸ˜„

timothypratley05:02:38

sounds like assembly based on that description simple_smile

alandipert05:02:52

programming in asm can be fun too

alandipert05:02:57

basically, programming πŸ‘

timothypratley05:02:09

I think you mean "the most fun!" πŸ˜›

mobileink06:02:20

@micha: as it happens yesterday I added some .bootignore info at https://github.com/boot-clj/boot/wiki/Configuring-Boot

micha07:02:42

looks great

pesterhazy08:02:59

wow, https://github.com/boot-clj/boot/wiki/Configuring-Boot looks great, documentation has been improving a lot lately!

hugod14:02:06

@martinklepsch: fwiw, I fixed my cljs repl issue from yesterday by changing BOOT_CLOJURE_VERSION to 1.7.0. I’m surprised the repl isn’t using the project dependency for clojure.

mobileink14:02:49

Morning folks. FYI I created a page on Pipelines but have not linked to it from the Home page yet - it needs to be vetted by somebody who knows boot better than I do. If it passes muster, recommend that the link to it be placed just before the Tasks link - in my view the concept of a pipeline is really central to boot, even if pipelines are not first class objects. I explain my reasoning on the page, which is at https://github.com/boot-clj/boot/wiki/Pipelines

martinklepsch14:02:33

@hugod: that's a limitation given by the fact that Boot only uses a single JVM

martinklepsch14:02:51

@hugod: thanks for pinging back simple_smile will try to think of that next time

dominicm14:02:19

@martinklepsch: I think you can get round it by using pods.

dominicm14:02:49

I'm sure I've changed the clojure version in my pods when me & micha were figuring out isolated environments

martinklepsch14:02:25

@dominicm: ah yeah, that might be possible but with tasks like boot-cljs you can't easily override it except using BOOT_CLOJURE_VERSION (which is enough most of the time)

micha14:02:40

@hugod: boot doesn't know about your project depenedncies until clojure is already loaded

micha14:02:54

since boot is just running your build.boot which is itself a clojure program

micha14:02:00

so you have a chicken and egg problem

dominicm14:02:12

@martinklepsch: I have a fork of boot-cljs where you can run it in a pod, πŸ˜›

micha14:02:14

boot can't know which version to use to run your build.boot until it runs your build.boot

dominicm14:02:23

I think I opened a PR

micha14:02:32

this is why you need to have BOOT_CLOJURE_VERSION be the same as your project clojure dependency

hugod14:02:08

So is it recommended to have a project local boot.properties file specifying BOOT_CLOJURE_VERSION?

micha14:02:29

yes definitely

micha14:02:34

and boot version too

micha14:02:44

so you don't have any surprises

micha14:02:08

most important if you have unattended builds, like on a CI machine

micha14:02:42

i suppose boot should add a clojure dependency to your project automatically

hugod14:02:56

Thanks. It seems boot.properties hardly gets a mention in the readme.

micha14:02:00

you can always set-env! to remove it

mbertheau14:02:33

So I can't have a task test without getting the redefinition warning?

micha14:02:50

you can use ns-unmap

mbertheau14:02:12

Nice! Thanks simple_smile

micha14:02:34

it's just a clojure program! lisp can doit

mbertheau14:02:56

yeah, but there's no ns form at the top, that's why I was wondering simple_smile

micha14:02:06

the ns form is generated

micha14:02:13

you can do boot -vb and see it

micha14:02:19

the generated namespace

mbertheau14:02:07

That works, thanks simple_smile

micha14:02:23

there are comments delimiteing the places where your code meets generated code

dominicm14:02:02

@micha: oh. I wrote my code to read a file from /tmp/ when I couldn't figure out what was happening...

micha14:02:11

also good!

dominicm14:02:59

Tasks were one-lined. Very difficult to debug.

micha14:02:37

-vb helps there a bit

dominicm14:02:52

yeah? does it work with the stacktraces?

dominicm14:02:00

because that's where I was struggling

micha14:02:04

yes you just need to run your tasks with -v

micha14:02:16

so suppose you do boot -v foobar

micha14:02:20

and you get a stack trace

micha14:02:32

you can then do boot -vb |cat -n

micha14:02:39

and see the matching line numbers

micha14:02:02

actually you should do boot -vb foobar

micha14:02:12

to get the exact same generated code

micha14:02:26

just add -b to the thing that caused the error

dominicm14:02:51

That's really neat. Thanks simple_smile

hugod15:02:06

I give up trying to understand how to set the output directory for boot-cljs. I have no idea what the cljs.edn mentioned in boot-cljs #104 is supposed to look like.

hugod15:02:36

@micha thanks - I missed that (I just have a single build)

martinklepsch15:02:47

let's deprecate builds without .cljs.edn (and rework docs accordingly)

hugod15:02:00

Umm, looks like β€˜boot-react-native’ is overwriting the output options anyway

martinklepsch15:02:01

is it? couldn't see any indicators at a quick glance /cc @pesterhazy

pesterhazy15:02:47

@hugod, have you had a look at the sample app?

pesterhazy15:02:00

boot-react-native should not interfere with cljs compilation

richiardiandrea16:02:25

Guys do you have the boot logo in svg somewhere so that I can put in ona website?

alandipert16:02:20

@richiardiandrea: which website? just curious

richiardiandrea16:02:33

I am about to lauch a (small) consultancy company Clojure based, it is actually a "branch" of Scalac: https://github.com/Lambda-X

alandipert17:02:23

awesome! happy to add a "companies using boot" to http://boot-clj.com/ also if you wanna PR on https://github.com/boot-clj/boot-clj.github.io

martinklepsch17:02:20

@richiardiandrea: nice! congratulations on launching a business I guess simple_smile

alandipert17:02:12

man i really need to perun-ize http://boot-clj.com some day

alandipert17:02:29

so shameful it uses jekyll

martinklepsch17:02:44

cond-let β€” does such thing exist? simple_smile

alandipert17:02:30

oh yeah - i just made it a few weeks ago

alandipert17:02:52

(defmacro cond-let [& clauses]
  (when-let [[binding expr & clauses] (seq clauses)]
    `(if-let ~binding ~expr (cond-let [email protected]))))

alandipert17:02:22

using it together with clout to do simple http request matching

alandipert17:02:12

use like

(let [x 123]
  (cond-let
   [y (and (even? x) (inc x))]
   (println "x is even and x+1 = " y)
   [y (and (odd? x) (dec x))]
   (println "x is odd and x-1 = " y)))

micha17:02:52

nice macro

martinklepsch17:02:25

I thought of it more like this:

(cond-let y
  (thing foo) (println y)
  (thing bar) (slurp y))

martinklepsch17:02:00

but I guess they're pretty close simple_smile

martinklepsch17:02:23

also a let thing with let like binding vectors makes sense hehe

dominicm18:02:40

That doesn't look like a rhombus

dominicm18:02:46

It's a big straight

arijun18:02:22

I put a dependency on my build.boot, and when running in the repl it works fine, but when I try to run a file with that dependency it says "could not locate on classpath"

martinklepsch19:02:29

@arijun: how do you mean "running a file"?

arijun19:02:30

in cursive, right click and click run file

arijun19:02:07

but now I see it must be a cursive issue because cursive seems to explicitly set the classpath

arijun19:02:03

yeah I had to "Refresh Leiningen Projects" my bad

martinklepsch19:02:48

yeah, cursive does not work with boot by default yet

martinklepsch19:02:58

there's some stuff in the wiki about cursive if you're curious

arijun19:02:16

Yeah, I ran the lein-generate task and thought that would do it, didn't realize I also had to do something in cursive. Strange that there can't just be a watch on the project.clj file.

richiardiandrea21:02:16

guys if I do:

(comp (target)
        (cljs :compiler-options devel-options))
shouldn't I see the whole result of compiling my cljs website in target? js files included?

richiardiandrea21:02:45

I don't see core.out in target for instance

micha21:02:01

the target task can only emit files it can see in the fileset

micha21:02:19

if you put it before a task, it won't be able to see any files craeted by the task that comes after it

richiardiandrea21:02:33

ah crap, rookie mistake

micha21:02:47

the target task just takes a fileset from the previous task in the pipeline, looks inside to see which files need to be emitted, and it writes them to a directory

richiardiandrea21:02:43

so for serve is the same right, it should go after (cljs ...)

micha21:02:03

that one can go anywhere i think

micha21:02:13

because it's just for side effects (starting a web server)

micha21:02:30

i believe it uses a post-wrap style

micha21:02:45

it doesn't actually look in the fileset, just the classpath

richiardiandrea21:02:31

yes, so this one does not serve from fileset, undestood

richiardiandrea21:02:48

so I have to dump the compilation somewhere then serve from there

micha21:02:57

it should serve from the classpath

micha21:02:29

(serve :port 12345)

micha21:02:56

usually it Just Works (tm)

micha21:02:18

nobody knows what it does, but it works

micha21:02:32

the best kind

richiardiandrea21:02:16

in my case: ClojureScript could not load :main, did you forget to specify :asset-path? πŸ˜„

richiardiandrea21:02:36

but I thought I did not need that anymore πŸ˜„

micha21:02:53

yeah that's coming from the cljs compiler

richiardiandrea21:02:49

so I still need it even if I don't have a output-dir

richiardiandrea21:02:25

(def devel-options
  {:optimization :none
   :source-map-timestamp true})

micha21:02:39

i dunno, i always just load the js from a relative path, like "main.js"

micha21:02:53

the location of the js file is an implementation detail to me

micha21:02:16

i have a task that craetes the html file and the .cljs.edn file

micha21:02:26

so i just do cljs and the rest is automated

richiardiandrea21:02:34

oh well yes it that case ok πŸ˜„

micha21:02:45

the asset path business makes things complicated and i recommend avoiding it if you can

micha21:02:25

it's like when you do (require 'clojure.core) in clojure

micha21:02:31

there is no option to configure an asset path

micha21:02:46

because if there were then everything would be way more complicated

richiardiandrea21:02:46

mmm...I agree I'll see I can avoid it but tenzing does it and I am worried I need it too

micha21:02:59

because nothing could figure out where the source file is for a given namespace

micha21:02:39

the namespace 'clojure.core maps to the file clojure/core.clj on the classpath

micha21:02:42

and that's that.

micha21:02:55

we need to make web applications with the same kind of discipline

micha21:02:03

this is how we get out of the tarpit

micha21:02:21

locating the js file in a well defined location is the start

micha21:02:33

if you can't even do that then you're building on sand

richiardiandrea21:02:05

but it looks like I needed to have:

{:require  [lambdax-web.core]
 :compiler-options {:asset-path "lambdax_web/core.out"}}
or no honey

micha21:02:15

gross lol

richiardiandrea21:02:12

if i remove that, i don't see main.js served

richiardiandrea21:02:22

I lied, it is there and working fine πŸ˜„

seancorfield21:02:05

Are there active Boot communities outside of Slack? (just casually thinking about Slackpocalypse)

seancorfield21:02:34

The CIDER / refactor folks are very active on Gitter (around their respective GitHub project rooms).

richiardiandrea21:02:26

I guess when it happens we'll move too πŸ˜„

micha21:02:44

there is #bootclj on freenode

richiardiandrea21:02:21

@micha a question, is main.out always written in boot-cljs no big fat main.js ?

richiardiandrea21:02:56

command I tried: boot cljs -sO advanced -- target

naomarik21:02:27

so i guess condensed form of my question: how can i share a clojure macro in clojurescript with boot?

richiardiandrea21:02:04

nothing changes, clojure macro always go in clj files and needs to be included in source-paths

naomarik21:02:33

ahh i've tried this 😞 and i have (:require-macros [embed.svg :refer [embed-svg]]) in my ns

micha21:02:11

@richiardiandrea: you get a single file if you have the :optimizations option to boot-cljs as :simple, or :advanced

richiardiandrea21:02:36

yeah but I did exactly that: boot cljs -O advanced -- target

micha21:02:38

with :none you get the whole main.out thing

micha21:02:59

you should have everything in the one file

richiardiandrea21:02:07

if you try with a clean tanzing template you can see the same

micha21:02:08

with advanced optimiztions

micha21:02:14

did you look in the js?

micha21:02:26

there is still the main.out dir because you need that for source maps

micha21:02:35

you can use sift to get rid of it if you want

richiardiandrea21:02:57

oh, ok so I can delete it safely

micha21:02:13

your main.js file or whatever should be a big blob of js

micha21:02:21

unlike the main.js shim you get with :none

richiardiandrea21:02:25

thanks, maybe you can add it somewhere in the wiki, or tell where I will add it

micha21:02:36

the difference should be very visible if you look in the file

richiardiandrea21:02:48

yes I know how it generally is, that's why I was surprised to see the .out πŸ˜„

richiardiandrea21:02:01

I looked and you are right

micha21:02:08

the .out directory doesn't hurt anything in most cases

micha21:02:23

but sift can quickly do away with it

richiardiandrea21:02:08

well yes, but it is sane to write it somewhere imho, I can do it, I just don't know where is more appropriate

micha22:02:19

the boot-cljs wiki is probably the best place

naomarik22:02:02

strange thing happening too: when i refer to the clojure macro AND try to invoke in the clojurescript, i get an error in boot from a file that's no longer in my project No such namespace: alandipert.storage-atom

naomarik22:02:28

i've tried removing .boot/cache and everything in target/

naomarik22:02:00

is there another cache dir somewhere?

richiardiandrea22:02:22

mmm...not that I know of...but wait for the gurus πŸ˜„

micha22:02:01

@naomarik: the target dir is never looked at by boot ever

micha22:02:07

so nothing in there can affect a build

micha22:02:10

it's write-only

naomarik22:02:18

good to know simple_smile was trying to eliminate it as a possibilty

micha22:02:35

all other state is stored in ~/.boot/cache, but only truly immutable things are stored in there

micha22:02:42

never anything that could ever change

naomarik22:02:48

how would boot know about a file that is removed then?

naomarik22:02:58

and the error only comes up when i try to use this macro

naomarik22:02:01

when i remove the macro

micha22:02:02

because it doesn't try to make those kinds of optimizations

micha22:02:06

it looks every time

naomarik22:02:07

it compiles perfectly

micha22:02:21

that's because of the jvm state

micha22:02:34

once you compile something it will stay in memory

micha22:02:40

so macros are functions

micha22:02:50

the compiler can still call the function

naomarik22:02:15

so my setup is this: i have a clojure macro in src/embed/svg.clj and (:require-macros [embed.svg :refer [embed-svg]]) is a line in my clojurescript file. my build.boot has "src/clj" in the source-paths set

naomarik22:02:32

calling

(defn some-svg-component []
  (embed-svg "test.svg"))
will cause the strange error to occur

naomarik22:02:56

from the file that i have removed

naomarik22:02:00

a long time ago

micha22:02:20

boot show -f is your best bet

naomarik22:02:48

my setup looks fine though to get the macro working?

naomarik22:02:31

all the stuff i want is in boot show -f

micha22:02:45

you said you have the clj file in src/embed/svg.clj

micha22:02:58

but your source paths are "src/clj"

naomarik22:02:58

src/clj/embed/svg.clj

micha22:02:02

so something is wrong there

naomarik22:02:11

embed └── svg.clj

naomarik22:02:17

i get this as part of the output

micha22:02:30

so that's good?

micha22:02:56

it's highly unlikely that a stale file is in the classpath

micha22:02:07

since boot doesn't do that kind of caching anywhere

naomarik22:02:20

hmm so what can i do there?

micha22:02:29

you restarted the jvm right?

micha22:02:38

to clear old stuff out of memory

naomarik22:02:01

kill all java proceses?

naomarik22:02:03

my ps aux reveals massive classpath /usr/bin/java -classpath /Users/naomarik/Sites/.... (continues for like 15 lines

micha22:02:19

that's not boot

micha22:02:26

that is probably leiningen

naomarik22:02:41

how do i restart the jvm on osx?

micha22:02:57

press ctrl-c

naomarik22:02:05

so you're saying just restart boot

naomarik22:02:15

i've done that million times throughout this πŸ˜›

naomarik22:02:48

(:require-macros [embed.svg :refer [embed-svg]]) if i edit this line slightly to include the wrong path it will give me a sensible error

naomarik22:02:53

so i can infer that it IS finding this

naomarik22:02:12

invoking the macro though still gives me an error from the file that no longer exists

micha22:02:30

and you did a git grep for references to the old namespace?

naomarik22:02:31

the onlything in the macro file is this

(ns embed.svg
  (:require [pl.danieljanus.tagsoup :as ts]))

(defmacro embed-svg [svg-file]
  (let [hiccup (ts/parse-string (slurp svg-file))]
    `~hiccup))

micha22:02:04

it's definitely something in your source somewhere that's referencing the old file

micha22:02:10

or something

naomarik22:02:17

i did ag -a alandipert and got nothing

naomarik22:02:19

in my project

micha22:02:27

git grep alandipert

micha22:02:56

lol i bet he's getting alerted by slack right now

naomarik22:02:40

that returned nothing but at some point this started working

naomarik22:02:20

i may have been an idiot regarding this

naomarik22:02:34

test.svg (No such file or directory) this is what i like to see πŸ˜‰

naomarik22:02:36

sorry @micha for the silliness.. i'm using tmux and somehow i scrolled up in my terminal without tmux-scrolling... somehow the stack trace looks perfect with what the real output is and some old output

naomarik22:02:02

the continuity is perfect

micha22:02:03

hahaha it happens

naomarik22:02:08

you should see it lol

naomarik22:02:19

maybe should sleep at some point , 2:30 am here

naomarik22:02:27

night πŸ˜‰