Fork me on GitHub
#boot
<
2015-09-11
>
cigitia00:09:33

https://gist.github.com/cigitia/80f164635a1d03762269 I keep running into OutOfMemoryErrors when I run any task that uses boot-cljs, and I’m not sure why. My project is pretty tiny. Is there some sort of state I need to clear in between builds?

alandipert00:09:26

@cigitia: you appear to be on java 7, you might be able to alleviate these problems with JVM options - https://github.com/boot-clj/boot/wiki/JVM-Options#permgen-errors

alandipert00:09:39

a better way out is to upgrade to java 8 if you can

alandipert00:09:48

it's better in every way

alandipert00:09:35

@k-hen: glad to hear it's working - please don't hesitate to add your experiences/findings to the wiki

cigitia00:09:40

@alandipert: Ah, I see; thank you.

cigitia01:09:01

@alandipert: Installing and switching to Java 8 worked; thank you very much.

frankiesardo11:09:41

Can't seem to get .cljc files into my jar

frankiesardo11:09:00

(output-files fileset) returns empty set

frankiesardo11:09:52

actually it might be a problem not related to cljc files, my jars ignore clj files as well

alandipert11:09:53

@frankie: it sounds like you might want to use :resource-paths instead of :source-paths

frankiesardo11:09:23

I'm even downloading example projects (like bootlaces) and running build-jar. All jars are empty

alandipert11:09:47

one thing yuo can try is, in a directory without a build.boot, is boot -r some-directory-with-a-few-files jar

frankiesardo11:09:02

there you go, deleting .boot/cache solved it

alandipert11:09:04

drive it from the command line only with the simplest settings

alandipert11:09:23

ouch, weird! glad you figured it out... how did you know to do that?

frankiesardo11:09:42

didn't know, just tried a wild guess

frankiesardo11:09:13

I knew new versions introduced a cache and maybe that could be part of the problem

frankiesardo12:09:45

alandipert: I'm quite surprised I nonetheless have to use :resource-paths #{"src"} for jars. Why is that necessary? Even bootlaces seems to do so https://github.com/adzerk-oss/bootlaces/blob/master/build.boot#L2

frankiesardo12:09:34

I assumed "src" is source-paths and "resource" is resource-paths and jars merges the two together

alandipert12:09:35

it's unfortunate how weird it seems coming from lein, but the first thing to point out is that resource-paths in boot is a completely different thing than in lein

alandipert12:09:49

so hard to name things 😦

frankiesardo12:09:07

Can you shed some light on this please? simple_smile

alandipert12:09:16

sure. so first there is https://github.com/boot-clj/boot/wiki/Filesets which is worth a thorough read

alandipert12:09:34

but in a nutshell, the major difference between boot adn lein is that we have a value type for the filesystem

alandipert12:09:48

objects of this type are threaded through tasks like jar for every build

alandipert12:09:08

this is the 'fileset'

alandipert12:09:22

and it is more or less an anonymous git repo

alandipert12:09:48

to the extent that files can be efficiently added and removed from it (without copying) because we leverage content-addressed storage and structural sharing

alandipert12:09:22

so that's "part 1" of what hte fileset does

alandipert12:09:35

"part 2" is, a build tool's job is to transform files from input into output

alandipert12:09:48

in e.g. git, there isn't a git command to do this because git isn't a build tool

alandipert12:09:30

what we needed in boot was a way to mark files as either inputs or outputs. some way for the programmer to tell us which files were only needed during the build vs. would show up in the finalr artifact

alandipert12:09:38

java files are a good example of source files

alandipert12:09:02

as part of the build process they should not be outputted by default, only .class files should be

alandipert12:09:36

so, that's how we ended up at the idea that files in the fileset should have one of two roles, input or output

alandipert12:09:58

the primary API for deciding which role files start off with is resource-paths vs source-paths

alandipert12:09:04

source = input, resource = output

alandipert12:09:26

does that make sense?

frankiesardo12:09:56

Gotcha, yes, "part 1" of fileset was very clear to me, now "part 2" is clear as well

alandipert12:09:42

maybe we need a quick summary at the top of that page

frankiesardo12:09:06

So something like .less files would be in "source" while .css would be in "resource", correct?

frankiesardo12:09:50

quick related question: if I have some boot build scripts that I want to move away from the build.boot file in a separate folder/file

frankiesardo12:09:05

what would be the best practice to include it in the build.boot file for the project?

alandipert12:09:46

they are scripts with tasks in them?

alandipert12:09:23

maybe the best thing to do is make a library and then require from the top-levle build.boot

alandipert12:09:08

note the :export-tasks metadata on the namespace

alandipert12:09:51

if boot_jasmin is in the source/resource-paths of the build.boot, or in a jar brought in a dependency, we can bring it into the build.boot with https://github.com/alandipert/boot-jasmin/blob/master/example/build.boot#L6

frankiesardo12:09:54

makes sense, I was think of creating a folder called "scripts" and adding it as a resource-paths with some boot tasks in it

frankiesardo12:09:10

and then I guess I need to disj "scripts" before building the jar

alandipert12:09:10

yeah, i suppose the thing to realize .boot is for expedience, but when you start to develop a library of build functions, it's good to move them to .clj files and keep your build.boot small

alandipert12:09:41

that's how bootlaces started, then after it was in a separate file we published as a separate ilibrary we can use from all our build.boot

frankiesardo12:09:25

cool thanks for your help alandipert

upgradingdave14:09:30

doh! second time I accidentally forked this, lol. I need to stop using emacs key shortcuts in github 😊

upgradingdave16:09:28

homer says “woohoo!” for success and “doh!” for failures 😉

upgradingdave16:09:06

boot speak :theme “homer”

alandipert17:09:52

protip: :theme "pillsbury"

alandipert17:09:02

the 'secret' theme

upgradingdave17:09:07

it was a tough decision whether to go with “mmm .. donuts” or “woohoo” simple_smile

upgradingdave17:09:36

yeah, nice, I saw that in one of your examples and that’s what got me down the trail with the homer thing, haha

boz20:09:44

Having trouble getting cider and boot repl to play nice.

boz20:09:52

boot repl starts like this

nREPL server started on port 60461 on host 127.0.0.1 - 
REPL-y 0.3.5, nREPL 0.2.8
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_40-b26
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from : [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=>
and cider-connect does this…
nREPL: Establishing direct connection to localhost:60461 ...
nREPL: Direct connection established
nrepl-log-message: Wrong number of arguments: (1 . 1), 0

boz20:09:48

I’ve just updated to the latest cider and configured ~/.boot/profile.boot as per the wiki

boz20:09:54

cider-20150911.253

boz20:09:30

boot.user=> boot.repl/*default-middleware*
#object[clojure.lang.Atom 0x1a9e7523 {:status :ready, :val [boot.from.io.aviso.nrepl/pretty-middleware cider.nrepl/cider-middleware]}]

boz20:09:27

does that all look right?

boz20:09:15

(Sorry if this should be a cider question .)

pandeiro20:09:44

did anyone ever figure out a way to get boot to download all a project's deps? it seems not possible yeah, because tasks can bring in their own deps?

pandeiro20:09:52

related: can i call a task that isn't defined or required in build.boot from the command line?

bsima20:09:52

@pandeiro yes, I think it's boot -d user/project my-task

alandipert20:09:03

e.g. boot -d alandipert/boot-jasmin jasmin -h

pandeiro20:09:36

thanks guys

pandeiro20:09:01

and if a task (comp ...)'s other tasks, just calling task -h won't fetch the deps of those comp'd tasks, right?

alandipert20:09:31

it might, it depends when the task gets deps

alandipert20:09:57

most tasks fire up pods in the 'constructor' function, so probably in most cases task -h does the trick

pandeiro21:09:34

sweet - being able to cache deps saves ~5min per circleci build

alandipert21:09:56

@boz: feels like more of an emacs debug thing, but not sure as i've never seen that before

pandeiro21:09:12

so something in my project is using ns-tracker 0.3.0 -- but i can't figure out what. is there a command that can help?

bsima21:09:45

boot show ?

pandeiro21:09:42

yeah doesn't show up in show -d or show -p -- some task is bringing it in

pandeiro21:09:47

maybe cljs?