Fork me on GitHub
#boot
<
2017-09-21
>
adamfrey14:09:43

has anyone been thinking about how the new tools.deps stuff could be integrated with boot? https://clojure.org/guides/deps_and_cli Specifically reading the cached classpath files to start a boot environment?

alandipert14:09:08

adamfrey no, but i just read that, but i can imagine a task that loads the file into core or into a pod for you

alandipert14:09:00

another extension point might be the set-env! multimethod... (set-env! :deps "deps.clj" ...)

adamfrey14:09:45

I found this, which could be a starting point: https://github.com/micha/boot-cp

alexmiller14:09:23

fyi, a lot of the details on the deps_and_cli page will be changing soon (general process still the same)

alexmiller15:09:55

while we have talked about ways to build classpaths that leverage pom.xml/project.clj as project descriptors, it’s a lot harder to deal with boot as there is no standard data definition of deps. So, I think it will require integration from the boot side if there is a desire to make use of tools.deps and deps.edn style deps.

adamfrey15:09:21

Alex, I was thinking that a boot task that would probably duplicate most of the logic in the clojure executable as it exists here: https://github.com/clojure/brew-install/blob/master/src/main/resources/clojure. So a project could have a deps.edn file and a build.boot file and if you wanted to run a boot task with a given classpath alias, my boot task would fetch the cached classpath or call clojure.tools.deps to create it

alexmiller15:09:17

so there’s really two pieces there - the classpath construction, which is certainly a place where you can invoke tools.deps.alpha

alexmiller15:09:34

and the other piece is the classpath caching, which is primarily in the domain of the script

alexmiller15:09:09

I certainly am all for building on the former - it exists for that purpose

alexmiller15:09:28

the latter should be considered implementation detail of the clojure script and I have plans to change how the caching is done (there are some known issues with it) so I would hesitate to recommend replicating that logic. That said, there is nothing preventing you from using any caching strategy you like.

adamfrey15:09:50

ok, that's good to know

adamfrey15:09:33

but from my perspective, it seems like boot and deps.edn files could exist in relative harmony like, tomorrow with some boot task. Whereas leiningen would need some support from either the Lein side or the clojure org side

richiardiandrea15:09:46

@alexmiller @adamfrey is classpath caching at the moment what yarn does with yarn.lock ? So a file to store resolved deps? Having worked on pomegranade in boot a bit (PR pending), I see no obstacle in calling tools.deps from inside boot.

alexmiller15:09:09

I don’t know anything about yarn

alexmiller15:09:27

it’s simply computing and caching the classpath string to avoid recomputing it if the deps haven’t changed

dominicm17:09:13

is it that expensive to calculate the classpath?

alexmiller17:09:25

it requires a) starting a JVM and b) potentially making many network calls to read artifact metadata and/or download artifacts. so, potentially yes.

dominicm17:09:06

ah, I was thinking from the perspective of boot or lein. a is given. b confuses me, is there additional metadata not kept in ~/.m2?

alexmiller17:09:15

.m2 is a cache so not everything is necessarily there

alexmiller17:09:40

and if you are using any SNAPSHOT versions, they will be re-requested, I think on a daily basis by default

seancorfield17:09:11

At World Singles, we already keep all our dependencies in deps.edn files but they're a slightly different format (just dependencies) and we combine them across multiple subprojects as needed. We'll have to rename our files to avoid confusion -- or convert them to the new format if it makes sense. Having a "built-in" way for Boot to load and use these new deps.edn files seems like a good idea.

seancorfield17:09:16

(we keep a version.properties file with the specific versions of all the dependencies we want and use that to modify the dependencies on the fly as we read our deps.edn files -- but I think the overrides/defaults mechanism in the new tooling would serve the same purpose)

alexmiller17:09:43

yeah, you should be able to use default-deps for exactly that

alandipert17:09:47

m2 is a cache, the source of truth is the .pom associated with an artifact on the repo server. when you request an artifact with maven, its .pom is processed, and the .poms for the artifacts it lists get downloaded also and so on

ag17:09:26

can someone explain to me in simple words diff. between with-pass-thru & with-pre-wrap & with-post-wrap. pls

martinklepsch17:09:48

@ag - with-pass-thru allows you to inspect the fileset but passes it on as-received - with-pre-wrap allows you to modify the fileset before the next task is called - with-post-wrap allows you to modify the fileset after the next task (+ tasks that task is calling) is called

ag18:09:06

so, I need to hold on to the fileset's temp-dir, the temp-dir where it puts compiled .js files (I want to catch its path and direct test-runner - Karma to run against files in that dir)?

ag18:09:24

how should I do that?

martinklepsch18:09:33

@ag why do you want the temp dir instead of using target?

ag18:09:22

hmmm... right, a) I thought it would be faster to run it against files in the fileset directly b) I'm having strange wacky problem with Karma, it doesn't seem to be picking up changes (its watch doesn't work as expected)

martinklepsch18:09:10

target should be reasonably fast

martinklepsch18:09:24

re: b) are you intending to run karma from boot?

ag18:09:47

@martinklepsch hold on, I think I found the issue.. my karma.conf has wrong stuff

msuess19:09:55

is there a way to set the cljs-test reporter from boot-cljs-test? I’m currently running my tests using orchestra and expound and would like to pprint the output. right now it’s quite scary as it prints the whole data structure with the nicely-formatted expound message as escaped string

ag21:09:31

does anyone have a working version of a workflow that integrates adzerk.boot-cljs with Karma server? I want a pipeline that: - runs cljs-build with a watch (that rebuilds whenever something changes in .cljs|.cljc|.clj - runs Karma server with a watch (that re-runs the tests whenever cljs-build emits new .js) - ideally it should be fast and immediately show if tests are breaking and I'm having troubles, for some reasons --single-run works fine, but having to keep Karma continuously to watch for changes doesn't seem to be working as expected. - first, I'm having to pipe cljs-build into target, and have karma.conf.js configured for that directory, I assume technically there's a way to run it against tmp dir in fileset (but that's an improvement and a gimmick) - second - as I said, it works correctly the first time, the consequential changes making Karma act very strange, it first reports that it executed 0 of n tests succesfully, then it would say it's disconnected, then it finally may or may not show the right message. Clearly it something to do with Karma and not boot. But I'm having trouble to configure things correctly. I've tried playing with all sorts of options in karma.conf - still doesn't work as I wanted

ag21:09:46

another problem is - I can't run karma server before it's done with building cljs, it throws an error, but also does not pick up changes later. I don't like that, I want to find a way to run it and not run tests until later