Fork me on GitHub
#boot
<
2017-02-11
>
podviaznikov00:02:59

thank you, will check it out

kenny00:02:47

Is there a way to call set-env! without causing any side effects? I want to set the boot env and update certain values in my :dependencies before actually causing the call to aether. I realize I could just re-write the set-env! function but I'd like to reduce code duplication 🙂

richiardiandrea00:02:12

@kenny I am doing exactly that in lambone and in my data oriented approach https://gist.github.com/arichiardi/7e4c430ff4ead706392f22e77c85b16a

richiardiandrea00:02:23

I will have to make it available somewhere

kenny00:02:53

Well, that seems like it is avoiding the problem by creating a DSL - I'd think you'd effectively have to write your own version of set-env!.

richiardiandrea00:02:01

@kenny yep exacly, but I call set-env! only when the task is called in order to avoid multiple state changes

kenny00:02:53

Where is defedntask?

richiardiandrea00:02:47

yep I have it here, I have to put it somewhere, didn't have time to make order...probably this weekend I will PR bootlaces

richiardiandrea00:02:15

it's 4 macros and some specs

kenny00:02:35

Is the code for it pushed somewhere right now?

richiardiandrea00:02:55

no but let me send you a PM

kenny00:02:18

@richiardiandrea Out of curiosity, what was the primary motivation for making this? Was it because every call to set-env! could result in a side effect?

richiardiandrea00:02:39

no mainly reusability of the configuration

richiardiandrea00:02:03

I like the way you can manipulate that map

richiardiandrea00:02:22

and in complex projects it is cleaner imho

kenny00:02:31

Ah. It reminds me of that dependency grouping boot project someone wrote, only this takes it up a notch to include all of Boot's configuration.

kenny00:02:19

Why would someone use this over a library that has functions which call set-env! on the reused pieces? Won't creating a DSL result in the same problems you run into with lein?

richiardiandrea00:02:10

@kenny yes in a way and no in another, having declarative conf is not bad per se, what lein is failing at is pluggability

richiardiandrea00:02:55

boot has this covered pretty well, and with my defedntask you can now have a more declarative approach like lein

richiardiandrea00:02:27

also one of the biggest pain points with Cursive, for instance, is to know where to get the dep vector and paths

richiardiandrea00:02:55

in this case, you can pass the var containing the conf and Cursive can read from there

richiardiandrea00:02:33

all the above ^ will need abundant feedback from anybody interested in improving things a bit

kenny00:02:54

It certainly seems pretty cool!

kenny00:02:49

Do the tasks compose well? If the task options in the map are set via task-options! then that would affect the global state which may not be what you want when composing tasks.

richiardiandrea00:02:35

yep, that's transparent to my macro

richiardiandrea00:02:56

which is only re-organizing forms

richiardiandrea00:02:27

I mean task-options! can always be overridden iirc by tasks, but you would need it less, as your "default" options will end up being in a shared conf

kenny00:02:57

I'll mess around with it some. Thanks for sharing 🙂

alandipert00:02:27

@danielsz 🙇

vinnyataide03:02:47

why is my 1 file aleph http handler no file datomic db system taking 40 secs to boot in my clojure boot setup? and the process is taking 1gb of ram here's my task

(deftask dev []
   (comp
     (environ :env {:http-port "3000"
                    :db-uri    "datomic:"})
     (watch)
     (system :sys #'dev-system :auto true :files ["handler.clj"])
     (cider)
     (cljs-repl)
     (reload)
     (speak)
     (cljs :source-map true
           :compiler-options {:parallel-build true
                              :compiler-stats true})
     (target)))

vinnyataide03:02:22

the cider task is to boot cider nrepl so I can refactor while in nrepl

richiardiandrea03:02:31

The cider middleware takes a lot of time to bootstrap, also maybe you don't need target at the end unless you want to dump the fileset

twashing05:02:55

For boot-cljs, how does one write a file to an alternate location, by just passing in cimpoler opts (like :output-dir)? https://github.com/clojure/clojurescript/wiki/Compiler-Options#output-dir

twashing05:02:04

I want to avaoid having extraneous <file>.cljs.edn files lying around. https://github.com/boot-clj/boot-cljs/wiki/Usage#multiple-builds

fossifoo14:02:40

i think my trouble after upgrading cljs to .473 are rather related to boot(-reload/-cljs/-???) than cljs itself

fossifoo14:02:18

my boot-http/serve doesn't serve "app.js" anymore when i update from .293

fossifoo14:02:01

i have an resources/js/app.cljs.edn, but i'm not even sure any more how/why it worked before 😄

pesterhazy14:02:46

does it say compiling js/app.js?

pesterhazy14:02:57

you could look at boot -v to see if the file gets generated

pesterhazy14:02:18

or try boot cljs target, which writes to a directory so you can inspect yourself

fossifoo14:02:57

i think it's not even compiling it to the temp dir

fossifoo14:02:13

CLJS options:
{:asset-path "js/app.out",
 :output-dir
 "/home/fossi/.boot/cache/tmp/home/fossi/projects/tassenfinder/f05/np8ovp/js/app.out",
 :output-to
 "/home/fossi/.boot/cache/tmp/home/fossi/projects/tassenfinder/f05/np8ovp/js/app.js",
 :main boot.cljs.main1791}

fossifoo14:02:22

but that file doesn't exist

fossifoo14:02:40

and the "output-dir" is empty too (but exists)

pesterhazy14:02:34

there's also show -f to see what gets generated

juhoteperi14:02:40

current boot-cljs might have a bug in error reporting that will silently ignore some Cljs compilation errors

fossifoo14:02:01

ah, that would explain it

juhoteperi14:02:18

2.0.0-SNAPSHOT should fix those problems, but I have had some problems with it in work projects which is why I haven't yet released it

fossifoo14:02:37

still no error, but no files either

fossifoo14:02:51

boot-cljs-2.0.0-20170130.201811-2 was used

fossifoo14:02:52

so nice to be at this point in my toolchain again where i don't even know how basic things work XD

pesterhazy14:02:38

you could try running the cljs compiler manually

pesterhazy14:02:02

or try a minimum file to see if you can reproduce

fossifoo14:02:27

yeah. i just try to find out how that works 😄

juhoteperi14:02:54

I have tested 472 with Saapas project and it worked

pesterhazy14:02:21

maybe worth looking at boot show --pedantic

fossifoo14:02:40

ah, maybe clojure 1.8 doesn't get used

fossifoo14:02:27

seems like the only strange thing

fossifoo14:02:31

then again that is probably just in there because of taxi and cljc files

pesterhazy14:02:58

maybe try setting BOOT_VERSION?

pesterhazy14:02:08

ah no strike that

pesterhazy14:02:25

BOOT_CLOJURE_VERSION

fossifoo14:02:45

still the same if i pin it to 1.9.0-alpha14

fossifoo14:02:59

i'll try calling the compiler manually

pesterhazy14:02:33

you can even do that in a deftask

fossifoo14:02:03

okay, that works if i strip down all my dependencies

fossifoo14:02:21

now adding those back in will lead to a clusterfuck, so... 😕

fossifoo14:02:11

ah, but boot cljs on that same stripped core.cljs doesn't output a file either

fossifoo14:02:10

let me try remove/change my .edn my

pesterhazy14:02:17

can you post a minimal example?

pesterhazy14:02:23

also the sections in build.boot and cljs.edn may be relevant

fossifoo14:02:56

removing the .edn doesn't change anything (apart from the generated name for the temp file)

fossifoo14:02:09

but even boot cljs target doesn't put a main.js there

pesterhazy14:02:30

what if you use a super minimal core.cljs? like only the ns declaration

pesterhazy14:02:59

I mean does that work with boot-cljs?

fossifoo14:02:33

still nothing

fossifoo15:02:04

if i also empty resources dir, i get an empty "target" dir 😕

pesterhazy15:02:37

try boot -BP -s your_src_dir cljs target

pesterhazy15:02:20

you may also need to add the resource dir so it finds your edn.cljs file

fossifoo15:02:33

i even deleted that for now

fossifoo15:02:39

it's generating one

pesterhazy15:02:57

IMO better to have an explicit cljs.edn file

pesterhazy15:02:20

explicit > implicit

fossifoo15:02:35

ah, boot -d adzerk/boot-cljs:1.7.228-2 -BP -s foo cljs target spits out a main.js

pesterhazy15:02:08

cool and now see if it breaks with latest cljs

fossifoo15:02:48

still works

fossifoo15:02:56

now the fun begins -_-

fossifoo15:02:12

i'll take a coffee break 😄

pesterhazy15:02:32

let the caffeinated bisection begin

fossifoo16:02:35

okay, apparently the problem is caused by [io.replikativ/geheimnis "0.1.0"]

fossifoo16:02:14

okay, so maybe not a boot problem after all