Fork me on GitHub
#boot
<
2017-02-23
>
qqq00:02:24

does (target ...) kill the directory before writing to it?

micha00:02:45

there is an option to disable that

micha00:02:59

(doc target) will show all the options

qqq00:02:27

months in, and I still don't use (doc ...) enough

qqq00:02:39

:no-clean bool

micha00:02:57

by default it does kill things, like rsync --delete

jrheard00:02:31

i’ve never used boot before, and feel like i must have done something wrong:

jrheard00:02:43

i’m on os x, installed boot via brew install boot-clj

jrheard00:02:07

when i run boot -h, it takes like eight seconds to complete, and looks like it spins up a separate windowed java program at some point, which tabs me out of my terminal window?

jrheard00:02:28

is this a common rookie misconfiguration mistake?

micha00:02:39

i've never heard that before

micha00:02:49

what do you get if you do java -version in a terminal?

jrheard00:02:01

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

micha00:02:00

what does head -6 $(which boot) produce?

mobileink00:02:21

boot startup is slow. get used to it, it's worth it.

jrheard00:02:31

#!/usr/bin/env bash declare -a "options=($BOOT_JVM_OPTIONS)" self="${BASH_SOURCE[0]}" selfdir="$(cd "$(dirname "${self}")" ; pwd)" selfpath="$selfdir/$(basename "$self")" exec ${BOOT_JAVA_COMMAND:-java} "${options[@]}" -Dboot.app.path="$selfpath" -jar "$0" "[email protected]"

jrheard00:02:50

@mobileink that’s not the response i was hoping for :’(

micha00:02:20

$ time boot -h > /dev/null
real    0m1.474s
user    0m2.996s
sys     0m0.136s

micha00:02:44

^^ that's more or less what you can expect for boot -h

micha00:02:06

@jrheard can you try boot -BPh please?

mobileink00:02:12

i sympathize. maybe there's a better way, but boot is so far beyond category that i'll take my lumps to use it.

micha00:02:22

does that still do the thing with the window opening?

jrheard00:02:36

i get a usage error when i try to do boot -BPh

cfleming00:02:52

@richiardiandrea Related, did I hear a rumour that you have a data-driven project definition boot task?

jrheard00:02:00

maybe the “usage error” is just the -h message successfully printing out, comparing

richiardiandrea00:02:19

@cfleming wow things are moving fast in this little town 😄

jrheard00:02:23

fwiw -

time boot -h > /dev/null

real	0m29.910s
user	1m16.969s
sys	0m2.930s

jrheard00:02:42

-BPh seems to run immediately and produce the same output as -h, no window opening

micha00:02:01

so now if you could do one more test

jrheard00:02:06

absolutely (thanks for the help btw 🙂 )

cfleming00:02:13

@richiardiandrea My spies are everywhere 🙂

richiardiandrea00:02:20

if people start liking the idea, for Cursive it will basically be as easy as passing a var

cfleming00:02:47

Looks nice, have you had much feedback on it?

richiardiandrea00:02:25

mixed feelings, it would actually help if it could end up in boot.core, maybe @U055HMK9L can give us his opinion given he's here 😉

richiardiandrea00:02:48

ok the mention here does not work

micha00:02:37

threads UI is weird

richiardiandrea00:02:50

looks like private but it is not 😄

cfleming00:02:44

So thinking about it, I’m not sure how much this gains me for Cursive.

cfleming00:02:16

Your example would be very easy to analyse, but in real projects those maps will be created programmatically

cfleming00:02:00

Either way, the user will have to provide a task which returns a data structure with that data to Cursive, for any non-trivial case.

richiardiandrea00:02:14

yeah that's also true

micha00:02:24

is that not a viable solution?

richiardiandrea00:02:52

maybe you could provide this macro as "cursive" macro and "force" the user to use it (or cursive won't support it)

cfleming00:02:05

Yes, it is, but there was concern in the main channel about having to modify the boot file for any project you want to open in Cursive.

micha00:02:25

is integration with cursive similar to the situation in the shell with programmable completion?

micha00:02:36

i am thinking about bash specifically

micha00:02:56

where you can configure completion functions that provide introspection capability

richiardiandrea00:02:01

it looks like the same kind of problem yes

cfleming00:02:58

Basically, I need to know the libraries and paths required by the project. The issue with boot as I see it is that to build up an environment of “everything you might want” I would have to execute all tasks.

micha00:02:25

and you need to know that before launching anything?

cfleming01:02:14

Something like Andrea’s solution makes it easier to structure your project so that all the data required by the different tasks is held is maps which could then be combined by some Cursive task into one

micha01:02:20

what if you generate the maps via intellij?

cfleming01:02:34

How would I do that?

micha01:02:52

like the build.boot could be generated maybe by some intellij/cursive plugin?

cfleming01:02:57

Sorry, missed the question - yes, I need to know that when the project is opened.

micha01:02:57

like the user would do it

micha01:02:11

maybe some kind of wizard

cfleming01:02:30

Yes, that would be easy. But I still need some solution for users who want to open arbitrary boot projects that may not be designed for Cursive.

cfleming01:02:40

Until everyone everywhere is using it, of course 🙂

micha01:02:47

ah, i see

micha01:02:13

it seems maybe reasonable to have some middle of the road approach, like bash completion maybe?

cfleming01:02:28

I can statically analyse quite a lot for basic projects, which I hope will get quite far.

micha01:02:42

i mean some library that helps you annotate your project so that cursive can know things

cfleming01:02:08

Yes, me providing a boot lib that people can include is a potential solution.

micha01:02:49

it's interesting to me because it forms a sort of api, and a framework for thinking about how to design the build stuff in a way that's compatible with cursive

cfleming01:02:07

I need to play with boot more to know how feasible all this is, and how non-intrusive it can be made for arbitrary projects.

cfleming01:02:13

Yes, it’s an interesting problem 🙂

micha01:02:18

because for me anyway it's difficult to imagine what cursive is trying to do

micha01:02:38

and how i might be impeding it

cfleming01:02:57

Here’s how this works. The issue is that IntelliJ works from source and other project artifacts, like jars that are used by the project.

cfleming01:02:16

In a Java project, all the source gets indexed, and the .class files from jars do as well.

seancorfield01:02:22

I suspect an additional complication would be that a single build.boot file can create a different classpath / environment for each task and can span multiple “projects”...

cfleming01:02:51

In Clojure it’s similar, but it’s complicated by various factors - most libs are source only, some are not, datomic has no source at all, etc.

seancorfield01:02:23

For example, at World Singles, we have “context” tasks that add different source directories and different dependencies to the environment, so we might start one app with boot some-context run and a different app with boot other-context run

cfleming01:02:26

@U04V70XH6 Yes, that’s another problem. In what is conceptually a multi-module project, there’s nothing in the boot file I can read that indicates that.

richiardiandrea01:02:43

exactly @U04V70XH6 that is why I quite liked the option of having a "descriptor"

cfleming01:02:01

So basically, for IntelliJ to index, it needs to know what to index - where the source is, what the dependent jars are, etc.

richiardiandrea01:02:03

that I can pass to my tasks...still does not solve every problem

seancorfield01:02:27

(my point is there’s likely no “perfect” solution for Boot / Cursive for the general case — so I think @richiardiandrea is going in a good direction: if you want Cursive support for your Boot project, you need to structure it a particular way)

cfleming01:02:59

Right, and I’ll do the best I can for projects which are not designed for Cursive

micha01:02:34

what about logging the events that cursive cares about and using that info to build a descriptor file

micha01:02:44

like for instance whenever a jar is added to the classpath

cfleming01:02:00

So instrumenting the boot tasks before running boot?

cfleming01:02:10

That’s a possibility, yes.

micha01:02:10

then you could run boot with a special option and it will emit that file

cfleming01:02:31

The problem is that it still needs to execute all tasks to get them all.

micha01:02:34

then you let cursive run it the same way ubt without the option

micha01:02:44

yes, but only once

richiardiandrea01:02:04

@U055HMK9L wouldn't it be similar to having a macro that generate a task from data?

seancorfield01:02:33

Executing tasks automatically is a bit dangerous tho’… what if a task performs some file system operation or deploys an artifact to a repository?

cfleming01:02:39

An additional problem is that if someone has a task which adds a jar to the classpath and then immediately uses that classpath to launch rockets, those rockets will be launched… right.

micha01:02:43

why would it be automatic?

micha01:02:59

the user would do it manually

seancorfield01:02:01

I thought @cfleming was talking about Cursive running the Boot file?

cfleming01:02:21

Right. They can’t really even open their project in any useful way without this information.

seancorfield01:02:23

based on this exchange: > cfleming [1 minute ago] The problem is that it still needs to execute all tasks to get them all. micha [1 minute ago] then you let cursive run it the same way ubt without the option

micha01:02:23

boot --some-option task1 task2 whatever > cursive-info.edn

seancorfield01:02:02

☝️:skin-tone-2: Yeah, it would have to be manual — Cursive could not automate that.

richiardiandrea01:02:06

I like the above ^ but we should probably instrument boot itself for it

micha01:02:28

right yeah boot would need to be instrumented to log things cursive is interested in

micha01:02:35

it would also log the command line

cfleming01:02:45

So the user would have to do that manually before opening a project in Cursive. That’s very different to the workflow of every other build system (in IntelliJ, say open project, select project.clj/gradle file/pom, and the project opens).

micha01:02:53

so cursive could see which boot pipeline is associated with the log info

cfleming01:02:01

It may be the only option, but it’s going to be weird for users.

micha01:02:16

the user could configure that perhaps

cfleming01:02:29

It also still relies on project authors making sure to not side-effect in tasks which supply project info.

micha01:02:38

and if the edn file is older than the build.boot file maybe cursive would run it to regenerate the edn file

richiardiandrea01:02:45

what if boot generates that file that then Cursive will find on the classpath

seancorfield01:02:57

Perhaps have metadata on tasks indicating what needs to be run by Cursive?

cfleming01:02:00

Much like making normal code reloadable, except that build tasks are expected to side effect all the time.

richiardiandrea01:02:19

which in any case it is true

cfleming01:02:25

Right, but users then still can’t open an arbitrary project.

seancorfield01:02:31

Then users can split a side-effecting task into two parts: task1 - build the environment; task2 - actually run something.

cfleming01:02:00

I do like the instrumentation idea, since that would save users having to write that task themselves.

seancorfield01:02:04

Yeah, but if Cursive requires certain classpath info etc, it can’t get it from a Boot file in general — only in very simple cases.

cfleming01:02:22

But boot files will still have to be written with Cursive in mind.

seancorfield01:02:50

For simple projects that have set-env! / merge-env! only at the top-level, you could mostly just load build.boot.

seancorfield01:02:10

For anything more complex, you need something Cursive-specific, right?

cfleming01:02:41

@U055HMK9L because I need to know which tasks to run, and those tasks have to be structured so that they don’t side effect when they’re just providing information.

micha01:02:57

why can't they side effect?

micha01:02:15

craeting files in temp dirs for instance is fine

seancorfield01:02:29

You can’t risk having Cursive run a task that happens to deploy an artifact to http://clojars.org for example.

cfleming01:02:39

Because the user will end up with their project being build, or rockets being fired, just so they can open their project.

micha01:02:56

launching nukes isn't something you'd sanely do when you're developing and noodling around in an IDE

cfleming01:02:08

Ok, deploying to clojars then.

micha01:02:21

right, why would that be in the pipeline?

seancorfield01:02:38

How would Cursive know what to run?

micha01:02:54

it would be told by the user

cfleming01:02:58

It will have to be, if that task adds project info (like adds deps or source dirs) before deploying.

micha01:02:18

maybe i am missing something

micha01:02:29

i am imagining people using cursive to hack on code

micha01:02:46

i do not expect part of hacking on code to involve deploying things to production

seancorfield01:02:49

Cursive has to figure out the classpath etc in order to do anything with the code

micha01:02:54

that sounds kind of crazy to me

cfleming01:02:59

Ok, imagine that I have a boot task which adds some deps to the classpath, builds something and then deploys it to clojars.

cfleming01:02:13

How could I introspect that in Cursive?

micha01:02:27

it wouldn't ever come up

cfleming01:02:29

I can’t ever get that classpath info without actually performing the deploy.

micha01:02:32

so you wouldn't need to

micha01:02:44

let's take a concrete example perhaps

micha01:02:55

let's say i am making a clojure program

richiardiandrea01:02:00

Adding classprth in deploy task is weird

richiardiandrea01:02:17

It should never happen

micha01:02:24

this program is going to consume a kinesis stream and update a dynamodb table

micha01:02:34

and i will be deploying an uberjar to ec2

cfleming01:02:39

I spend a lot of my time working around the weird things users do.

micha01:02:28

so let's imagine that we add an option to boot to obtain debug logs of events like jars added to classpath, etc

micha01:02:35

that is the -z option say

micha01:02:50

now i have a build.boot file

micha01:02:03

and i can hack on the project in vim for example by doing boot repl in a terminal

micha01:02:13

and vim fireplace can connect to the repl and stuff

seancorfield01:02:14

vim != Cursive

micha01:02:26

sure, indulge me 🙂

micha01:02:41

ok so now i want to use cursive instead of vim

seancorfield01:02:43

I think the problem here is @U055HMK9L doesn’t understand why Cursive is so different to other IDEs?

micha01:02:24

so i would do boot -z

micha01:02:39

because i don't need any other tasks to get my environment set up

micha01:02:48

i have all the things in set-env! etc

micha01:02:52

just by chance

micha01:02:09

actually sorry i do boot -z > info.edn

micha01:02:27

that produces a file that might look like:

micha01:02:01

{
  :command-line ["boot"]
  :jars-on-classpath [...]
...

cfleming01:02:04

Ok, accepting the part where the user has to do some manual thing to open a project, I’m with you

micha01:02:16

well, not necessarily

cfleming01:02:17

(I can automate that in simple cases)

micha01:02:25

what if there is a config option available

micha01:02:35

where the user types in the :command-line

micha01:02:47

then cursive can check the info.edn file

micha01:02:59

and see if its modtime is later than build.boot

micha01:02:08

if it isn't then cursive can run boot -z

cfleming01:02:43

Now I want you to build your uberjar, and in that uberjar I want a jar which is only required on EC2

seancorfield01:02:05

(because you’re using a mock for dev?)

micha01:02:08

how would cursive be involved there?

micha01:02:27

i'd do that on the command line boot build-uberjar deploy-ec2 or whatever

cfleming01:02:29

Because in your uberjar task, you’re adding something to the classpath.

cfleming01:02:51

If you don’t run that task in boot -z I don’t know about it.

micha01:02:59

cursive shouldn't be involved with uberjars

cfleming01:02:01

But if you do, you build an uberjar

cfleming01:02:17

But it has to be, if the task that creates them also does set-env!

cfleming01:02:57

Because otherwise I never know that that jar is on the classpath.

micha01:02:00

i mean if you don't need those jars that are added to the uberjar at dev time

cfleming01:02:13

Maybe I do, I don’t know.

micha01:02:17

if you needed them at dev time you'd add them in dev too, and not just when uberjaring

cfleming01:02:54

I’m willing to bet you a beer that when I add this we find a lot of projects that do that, or similar things.

cfleming01:02:38

I mean, whatever I do is going to involve a certain amount of “if you want this to work in Cursive, don’t do that"

cfleming01:02:56

Here’s another case.

cfleming01:02:27

When developing in CLJS, I often have a dev.core and a prod.core. I use dev when deving, and prod when prodding.

richiardiandrea01:02:28

In any case we are going to instrument tasks and you could warn if there is no meta :boot/cursive on it

richiardiandrea01:02:45

Sorry, reading 😀

cfleming01:02:51

So when developing, dev will be on my source path, but when uberjarring, prod will be.

cfleming01:02:06

I won’t see that prod source root.

micha01:02:27

yeah but how does it make sense to see both anyway?

micha01:02:48

presumably prod.cljs is just a shim that loads something that is shared

cfleming01:02:58

Yeah, but you’ll still want to edit it.

richiardiandrea01:02:46

Boot is probably saner in this way, I usually change task for dev and prod and keep deploy as unique just for pushing things out

micha01:02:15

ok this is what i would do:

cfleming01:02:33

I don’t seem to be able to paste images here.

richiardiandrea01:02:12

So I'd do boot cider dev --prod if I need to dev on prod

micha01:02:24

i mean i always use environment variables and have just core.cljs, so nevermind what i'd do

micha01:02:56

but how does it make sense to want to use an IDE to edit a file that cannot run in my computer?

cfleming01:02:21

I want to use my ide to edit prod.core - I mean I have to create it somehow.

seancorfield01:02:27

I’m often editing files that are intended to run only on CI/QA/production...

cfleming01:02:34

But I’ll never run that file on my machine.

micha01:02:01

but cursive can still edit files without needing to evaluate their code, right?

micha01:02:10

like just regular edit a file mode

cfleming01:02:47

They need to be under a source root to get language-specific functionality.

cfleming01:02:09

IntelliJ has to be able to index them, and it has to know where they are to do that.

micha01:02:09

i guess what i am thinking is why can't prod.cljs be on the classpath in both dev and uberjar

micha01:02:23

and dev.cljs

micha01:02:44

boot can select one as the entry point via a task

cfleming01:02:48

Maybe it can, but right now in a lot of CLJS projects it’s not.

micha01:02:57

doesn't seem an unreasonable requirement though

cfleming01:02:14

Maybe, I don’t know.

micha01:02:32

it seems easy to understand the requirement anyway

micha01:02:44

like cursive needs to be able to see all the things you will be editing

cfleming01:02:51

I think I’m going to try to implement something, and we’ll have to deal with problems as they occur. The instrumentation would undoubtedly be helpful though.

cfleming01:02:14

Right, and all the dependencies that all that code might need.

micha01:02:33

i think of it in terms of say CIDER or vim fireplace

seancorfield01:02:47

A concrete example from World Singles: we have a data migrations task that adds a new source folder to the classpath and a couple of additional JARs needed only by that task. We don’t want to drag that into the main project (because the data migrations task pulls in a huge number of namespaces etc). In order to edit the source files associated with data migration in Cursive, the IDE has to know about that source folder and those JARs in order to provide assistance.

cfleming01:02:51

IMO that’s a bad analogy - they’re very different.

micha01:02:57

like if you can launch a repl with all the things you will be editing available, then cursive will be good to go also

seancorfield01:02:12

Yeah, I think that’s your basic disconnect @U055HMK9L — Cursive works very differently.

micha01:02:29

i don't understand

cfleming01:02:34

@U04V70XH6 That’s a great example, thanks.

seancorfield01:02:41

Cursive does a huge amount of stuff without a REPL, right @cfleming ?

richiardiandrea01:02:41

Yes from what I understand Cursive does static analysys

richiardiandrea01:02:50

Even when the repl is off

cfleming01:02:05

That’s correct.

micha01:02:26

i don't see how @U04V70XH6 example is different

seancorfield01:02:29

It can do that with Leiningen projects because they are purely declarative (like ant/gradle etc).

richiardiandrea01:02:32

And then I'll pass the mic to you @cfleming sorry 😀

micha01:02:39

like if you want to access migrations stuff in the repl you need to have it on the classpath

micha01:02:48

which is precisely what i mean

cfleming01:02:02

It doesn’t need to be in a REPL for Cursive to work.

micha01:02:07

of course not

cfleming01:02:13

It does need to be under a source root I can find.

seancorfield01:02:16

Cursive would not be able to provide any Clojure-specific assistance if I edited those data migration source files and it did not know about the changes to the environment from that task.

micha01:02:16

but cursive has the same requirements as the repl does

micha01:02:23

the repl also needs to be able to find the things

seancorfield01:02:29

No, Cursive != REPL.

micha01:02:42

the repl needs to be able to compile code

cfleming01:02:43

And I can’t find that source root without running the task, which does tons of migration or whatever.

micha01:02:48

cursive needs to be able to analyze

micha01:02:50

seems same to me

cfleming01:02:10

The issue is that I can’t find out what the classpath is without executing the task.

micha01:02:23

right, i'm saying you should execute the task

micha01:02:32

not migrations, obviously

micha01:02:35

because that is pointless

cfleming01:02:40

That will migrate a ton of data, and might not even work outside prod.

micha01:02:52

yeah don't do that

richiardiandrea01:02:16

Trade-offs gents lol 😁

cfleming01:02:24

So this can be solved, by Sean splitting his task into two, one to create the data and one to do the work.

cfleming01:02:45

But my issue is that lots of people don’t do that right now, with code that is out in the wild.

cfleming01:02:50

Including Sean.

cfleming01:02:18

So right now, Cursive cannot work with his project unless he modifies it.

micha01:02:52

right, but it could be straightforward to make that modification

cfleming01:02:58

Which is probably ok in the case where whoever wants that to happen has some control over the project, but is not for some thing they downloaded off Github.

richiardiandrea01:02:01

In any case cursive does not work atm so it is maybe better to push a sane default (imho)

cfleming01:02:02

Sure, or not.

micha01:02:15

like the requirement "cursive must be able to see anything you want to edit on the classpath" seems pretty straightforward

micha01:02:38

so you can refactor into two tasks, one that manages the classpath perhaps

micha01:02:47

and the other that launches icbms

micha01:02:04

then you tell cursive about the tasks that modify classpath

cfleming01:02:05

Hopefully once I actually add the support, enough people will use Cursive to create pressure for that to happen in projects even when the authors don’t care about Cursive.

micha01:02:09

and it can run them

richiardiandrea01:02:48

It also seem an easier first approach to test the waters

micha01:02:56

yeah i don't think it would interfere with anything

cfleming01:02:04

And they could potentially be marked with metadata or whatever, or a list supplied to Cursive. It’s going to be weird for IntelliJ users who aren’t used to it, but they’ll get over it I guess.

micha01:02:05

like it wouldn't break anything

seancorfield01:02:15

The simplest approach — that doesn’t involve modifying Boot and wouldn’t require the user to run anything — would be to require that users add ^:boot/cursive or similar to tasks that they needed Cursive to run?

seancorfield01:02:41

That way the simplest projects should “just work” (load build.boot and look at the classpath / env / etc).

richiardiandrea01:02:57

Probably yes ^ then all those task will it the edn

micha01:02:05

making a task for cursive to invoke might be better

cfleming01:02:10

Yeah, or supply a list of tasks at project import, perhaps. That might be difficult in the case of a project you don’t understand.

micha01:02:13

a single one

seancorfield01:02:26

Anything else — with tasks that modify the classpath / env — would need some annotations on tasks to indicate they are safe to run: making it opt in from a user’s point of view.

micha01:02:29

so you don't need to have some weird way of ordering them etc

seancorfield01:02:40

Doing anything “automagically” is likely to be dangerous.

richiardiandrea01:02:22

Yes probably you are right Sean

seancorfield01:02:29

I don’t see any need to generate an external EDN file for this tho’?

cfleming01:02:53

It would just mean that I don’t have to run boot on every project open if nothing has changed.

seancorfield01:02:03

(as a project maintainer, I’d certainly be happy to split up any tasks that would be needed to satisfy Cursive)

seancorfield01:02:12

Ah, so a cache of metadata?

seancorfield01:02:41

But you could run it and inspect the classpath / env and write that metadata yourself from Cursive, right?

richiardiandrea01:02:42

Ah! That can be interesting for boot itself

cfleming01:02:02

@U04V70XH6 Sure, that would work too.

cfleming01:02:27

If boot -z just outputs to stdout I’ll capture that and store it.

cfleming01:02:57

@U055HMK9L does a boot -z sound like a good thing for boot in general? It seems like it to me.

micha01:02:41

yeah it could be

cfleming02:02:00

I’ll wait for that, then - I have plenty to do in the meantime.

micha02:02:40

if you could think about what kind of info you want logged

micha02:02:52

i can get something going

cfleming02:02:59

Here’s what I use from lein:

cfleming02:02:04

{:name           "single"
  :group          "single"
  :version        "0.1.0-SNAPSHOT"
  :dependencies   [{:artifact-id "clojure"
                    :classifier  "sources"
                    :file        "@repo/org/clojure/clojure/1.6.0/clojure-1.6.0-sources.jar"
                    :group-id    "org.clojure"
                    :scope       "compile"
                    :version     "1.6.0"}
                   {:group-id    "org.clojure"
                    :artifact-id "clojure"
                    :version     "1.6.0"
                    :file        "@repo/org/clojure/clojure/1.6.0/clojure-1.6.0.jar"
                    :scope       "compile"}]
  :repositories   {"central" {:snapshots false
                              :url       ""}
                   "clojars" {:url ""}}
  :deps-tree      {"org.clojure/clojure:1.6.0"         {}
                   "org.clojure/clojure:1.6.0:sources" {}}
  :source-paths   ["@/src"]
  :resource-paths ["@/dev-resources"
                   "@/resources"]
  :test-paths     ["@/test"]
  :compile-path   "@/target/classes"
  :target-path    "@/target"
  :aot            [test.main "namespaces.*"]}
 :profiles
 ["base" "debug" "default" "leiningen/default" "leiningen/test"
  "offline" "uberjar" "update" "user"]}

cfleming02:02:14

Wow, that’s big in a thread pane.

cfleming02:02:24

Basically - deps, source/test/resource paths, artifact details for all artifacts, repositories, dependency tree info if you have it (just for display, nice to have), compile output dirs, AOT info, CLJS info

cfleming02:02:33

Boot doesn’t have anything like profiles, right?

seancorfield02:02:49

You tend to do that via different pipelines of tasks 🙂

cfleming02:02:00

Right, that was what I figured.

cfleming02:02:12

The other interesting thing will be how to run a REPL

cfleming02:02:21

The boot REPL uses nREPL, right?

cfleming02:02:39

So if I start it up, do I supply a port to connect on?

cfleming02:02:47

Does it also use nREPL for CLJS?

seancorfield02:02:23

You can run boot repl -sp PORT wait I think… with the caveat that you might need additional tasks in there.

seancorfield02:02:27

(for comparison, ProtoREPL’s default is boot —no-colors dev repl —server wait so it expects you to have a dev task I think)

seancorfield02:02:00

And it gets the port from .nrepl-port (confirmed)

seancorfield02:02:07

-s is the alias for —server

seancorfield02:02:46

(end of work day for me — but I’ll be back online later if this thread continues!)

cfleming02:02:48

And everyone else, this was very useful

micha02:02:58

i am also around

micha02:02:07

will ruminate a bit

richiardiandrea02:02:20

Awesome on my side as well, following on buses and the final part at the dentist but it was worth it 😀

micha02:02:01

haha 👍

richiardiandrea02:02:20

@cfleming yes nRepl for both clj and cljs

seancorfield02:02:52

BTW, re: that code post looking huge in thread view -- if you click "All Threads" and expand the convo there, it's full-width and the code looks fine 🙂

cfleming02:02:47

So in that view I can see the thread full width, but can’t expand it to just look at this thread.

cfleming02:02:57

This UI makes me feel like my mother trying to use it.

cfleming02:02:56

ah, ok, got it

seancorfield03:02:38

I agree it's less than intuitive... I consider it a "1.0" version so I'll cut them some "slack"... 😆 ...

onetom15:02:14

awesome thread! 🙂 as @U0CLCL6T0 mentioned currently you can my little task which will generate an actual project.clj which is pretty much that .edn file boot -z would emit.

onetom15:02:25

reading the conversation i've noticed that there is some fundamental misunderstanding regarding what a user might want to do and what do they expect to happen.

onetom15:02:08

i think the most effective way to dissolve these misconceptions is to gather for a screen sharing session where we can show each other our workflows and see how those correlate

micha15:02:08

that sounds awesome 💯

onetom15:02:17

one good edge-case which highlights the fundamental differences between cider/fireplace vs cursive is editing the build.boot file itself, which is: 1. not on the class path, so you can't require it. 2. it's "not a valid .clj file" in that sense it doesn't start with an ns form 3. it has implicit dependencies (`boot.core`, boot.util, etc) besides clojure.core

onetom15:02:05

@U04V70XH6 @cfleming i think when micha said "it's the same problem what a REPL has" he meant: if you would want to get a REPL with the same environment your migration task has, BUT without actually running the migration itself, is exactly what Cursive might want to do.

onetom15:02:13

but it indeed sounded a little bit like he would assume "u must have a repl running anyway to make cursive work"

micha15:02:46

yeah i meant that getting a repl ready involves the same setup as getting cursive ready -- meaning that you need to have the things on the classpath etc to be able to compile them in the reql with require, just the same as you need them available to cursive on the classpath etc when it does its static analysis

micha15:02:15

with the repl you also have the build.boot issue

onetom15:02:32

and the same way we couldn't get a REPL into sean's migration task as it stands now

micha15:02:35

it's solved with (clojure.core/load-file "build.boot")

micha15:02:59

so i imagine there is some comparable facility in cursive for loading a file from the filesystem

micha15:02:04

for that special case

onetom15:02:18

yeah, i was using that a lot lately actually. would be good to highlight it somewhere in the getting started guide if it's not there yet...

cfleming19:02:37

Yes, understood.

cfleming19:02:17

I’m definitely down for a screen share to understand all this better, and in general it’s probably faster to discuss some of this.

cfleming19:02:44

I’m away today and Monday (it’s currently Friday here) but other than that any time next week is good.

dominicm19:02:26

An interesting question I have is: What of a task might load a couple of things, depending on others. It might be good to have metadata which can specify which dependencies this task might have, or point to a function for finding them.

richiardiandrea21:02:09

@U09LZR36F yeah I do that all the time, that is why I have created that macro above above

cfleming00:02:30

Although I think I may have just seen you talking about it here a while ago

micha00:02:57

$ (mkdir /tmp/zzz ; cd /tmp/zzz ; time boot -Ph > /dev/null)

jrheard00:02:24

Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.

real	0m3.093s
user	0m8.824s
sys	0m0.452s

micha00:02:41

that looks good, no window opening nonsense right?

micha00:02:19

ok cool, it looks like you have something in ~/.boot/profile.boot that is doing things

micha00:02:24

do you have that file?

jrheard00:02:25

aha, will take a look

jrheard00:02:35

nope, just boot.properties and cache/

jrheard00:02:51

maybe it’s the specific project whose directory i’m in?

jrheard00:02:57

source isn’t public unfortunately

micha00:02:59

$ (cd /tmp/zzz ; time boot -h > /dev/null)

micha00:02:03

can you do that one?

jrheard00:02:14

Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.

real	0m3.062s
user	0m8.810s
sys	0m0.492s

micha00:02:23

no window?

jrheard00:02:30

does that mean it’s definitely this project?

micha00:02:35

yeah i think so

jrheard00:02:41

gotcha, i’ll poke around then. thanks so much for your help!

micha00:02:47

one thing that i've found causes a window to open is um

micha00:02:54

webdriver

jrheard00:02:59

interesting, that’s entirely possible

micha00:02:59

i think that's what it's called

micha00:02:13

i remember using a headless browser that would do that

jrheard00:02:18

fwiw, when the separate application is started up, the os x menu bar just says “Boot” in the top-left

micha00:02:25

and it would take a long time to start up also

jrheard00:02:33

i’ll poke around and look for webdriver usage / bug the lead on this project

jrheard00:02:37

thanks for the tip 🙂

micha00:02:45

yeah i think webdriver was putting java in gui mode

jrheard00:02:51

that sounds extremely plausible

micha00:02:15

so one thing you can do is comment out many thing

micha00:02:23

like all your task definitions for example

micha00:02:27

in build.boot

micha00:02:45

because you just want to get to the point where boot -h acts normally

micha00:02:57

then you can bisect

micha00:02:17

i suspect the window is being opened as a side effect of requireing a namespace

jrheard00:02:38

smart, that sounds like definitely the right approach, will give that a shot!

bhagany02:02:22

huh, this happens to me when I use boot.test/runtests, I never really thought about it being a problem. It is kind of annoying, though

onetom14:02:20

yeah, i've experienced this java gui mode too. on macOS it has the side effect of a java logo appearing amongst the apps u see on the dock or the cmd-tab list.

micha14:02:47

is it related to webdriver do you think?

micha14:02:00

i feel like i ran into this and figured out a solution

micha14:02:06

but it was a long time ago

bhagany14:02:54

Yeah, that cmd-tab thing is how I noticed it at first too. I don't think mine is related to webdriver, but I'm sure it's something similar with another lib. I tried to narrow it down a bit last night, but didn't find anything conclusive.

onetom15:02:20

@bhagany the speak task also has that side effect

onetom15:02:49

because it's emittting sound...

favila18:02:11

What is the best approach to "patch" a file in a fileset

favila18:02:06

basically, I have a file in a fileset which (conceptually) I need to slurp, str/replace with a regex, and spit out again, replacing what was there

pesterhazy18:02:06

apply a .diff file?

favila18:02:40

I'd rather not have a separate diff file, but essentially

pesterhazy19:02:45

not sure about best practices though 🙂

richiardiandrea19:02:29

I think the pattern above is the most common one, write in a tmp-dir! the new content

richiardiandrea19:02:51

sifting out the old file

favila19:02:24

add-resource on top of an existing path is ok?

pesterhazy19:02:21

can't vouch for that, someone with more boot knowledge would have to answer

richiardiandrea19:02:35

@favila add-resource adds to the fileset abstraction, merging in case of conflict (don't remember off the top of my head the default one though)

richiardiandrea19:02:07

so you could use sift to exclude the file you want to remove and then add-resource won't have the conflict

richiardiandrea19:02:25

(if I understood the problem correctly :))

mobileink19:02:15

@favila if you do not need the original file in output, put it in :source-paths and you won't need to sift.

kenny19:02:02

Why should I use boot-figreload over boot-reload?

richiardiandrea19:02:42

@kenny it would give the same UI experience as figwheel

richiardiandrea19:02:51

(nothing more, nothing less)

kenny19:02:43

I used figwheel wayyyy back when we used lein, so I forget the difference in UI. Is there an example showing what I would gain with the figwheel UI?

richiardiandrea20:02:15

yep it is on the lein-figwheel website, yeah that sample works

kenny20:02:38

After running the example and skimming the lein-figwheel readme, I still can't see what I would be gaining in terms of the UI. boot-reload also has the heads up display.

richiardiandrea20:02:19

@kenny if you are ok with boot-reload why change it 🙂

kenny20:02:38

I was just curious if I was missing out on some awesome feature 🙂

richiardiandrea20:02:44

no well, figwheel does a bunch of things, at the moment only the client has been ported but it is probably easy now to even use the repl side of it

richiardiandrea20:02:52

as anything, if people will pick it, it will expand and we will share code with figwheel, in theory pushing in there instead in boot-reload for changes

richiardiandrea20:02:06

and things will grow in that direction

richiardiandrea20:02:40

if not, Deraen is actually doing a very good job with boot-reload so there will maybe no need to use figwheel whatsoever 😉

kenny20:02:03

Gotcha. Cool, thanks for the info @richiardiandrea 🙂

qqq20:02:37

I actually find that dirac has replaced my need for almost everything -- figwhell, devcards, brepl, etc ...

richiardiandrea20:02:31

yeah dirac is a good tool, the only thing is that I am too used to emacs 😄

qqq20:02:24

I'm using emacs + dirac

qqq20:02:44

@richiardiandrea : can you imagine how much overall emacs productivity you could generate if you turned 'dirac' into a repl that emacs could control?

richiardiandrea20:02:17

does dirac expose a cljs repl itself?

darwin20:02:45

you should be able to do something like this with emacs: https://github.com/binaryage/dirac/blob/master/docs/integration.md

darwin20:02:16

if emacs has at least one normal nREPL client implementation it should be possible without any changes on emacs side

richiardiandrea20:02:12

@darwin yes emacs only has 1 implementation, which is a nRepl 🙂

qqq20:02:12

@darwin , @richiardiandrea : how many pizzas would it take for the two of you to get emacs/dirac talking to each other?

richiardiandrea20:02:20

it probably already works

richiardiandrea20:02:46

the only thing is that you need to use inf-clojure probably

richiardiandrea20:02:06

I don't know/think that the cider middleware is supported

richiardiandrea20:02:36

however you could try to do boot cider dirac repl -s wait and see what happens 😄