Fork me on GitHub
#boot
<
2016-03-23
>
andrewboltachev00:03:49

@danielsz: Might you anyway try to rename ~/.m2? simple_smile

danielsz00:03:28

@andrewboltachev: I could, but it is wise to do that?

andrewboltachev00:03:46

To try just on one project

danielsz00:03:17

Still downloading jars simple_smile

danielsz00:03:47

Amazing how many jars are being downloaded with a fresh ~./m2

andrewboltachev00:03:11

Sure. And it's size should be good too. In the meantime you might learn about ~/.m2

micha00:03:21

i think this is caused by maven_metadata.xml file in your repo

micha00:03:40

sometimes just removing that is enough to fix the issue

danielsz00:03:02

@micha: Oh, that's useful info.

andrewboltachev00:03:15

@micha: So, isn't it (likely) ~/.m2 which is wrong?

micha00:03:25

that file is in .m2

micha00:03:35

so removing .m2 will also fix the problem

andrewboltachev00:03:52

but is worse, sure 😄

micha00:03:54

but each project has a metadata file

micha00:03:20

this is for the case where there are different maven repositories that have the same coordinate but the actual jar is different

micha00:03:39

like if foo/bar:1.2 in one repository is not the same as foo/bar:1.2 in the other

andrewboltachev00:03:42

Did lein install or some other "local" operation likely broke it?

micha00:03:54

so when you download or install a jar it remembers where the jar came from

micha00:03:11

so suppose you download foo/bar:1.2 from repo A

micha00:03:36

then in a different project you depend on foo/bar:1.2 but you don't have A in your set of repositories

micha00:03:43

that's when you start to get problems

micha00:03:06

i think snapshots can make these issues worse because they're sort of a special case

micha00:03:31

like the metadata isn't as rigorously maintained as with releases

micha00:03:20

i usually rm -rf just the dependency that is causing the problems in my .m2

andrewboltachev00:03:48

So it weren't wise to rename ~/.m2

micha00:03:30

you just download the jars again, it doesn't harm anything

danielsz00:03:04

This is all useful. @tcrawley just said in the Clojure channel that I'm hitting a Clojars issue

danielsz00:03:16

And that he'll deploy a fix tonight

danielsz00:03:55

Starting from a fresh ./m2 worked, but that was the nuclear option.

andrewboltachev00:03:06

Is it Java's "directory watch service" that backends Boot's watch task? I were using Boot as a tool to do TDD (or other hacking, really) in Clojure: I have own script to bootstrap the new project, where I would be able to call "boot dev", and then make changes to core.clj and other files, and what were in main fn would be executing. There's how: https://github.com/andrewboltachev/clojure-tdd-example/blob/master/build.boot#L45 Sometimes I were hearing it speaking twice. And I'm confused why. The thing now is that I've played with WatchSerivce and now using it successfully enough in my one project. I noticed that vim sends series of events when saving files, while e.g. gedit does so, but for temporary file. Solution that I've found is this: http://dpaste.com/01MZ82K Are you doing suchlike thing in Boot or might consider to do (to prevent "double operation")?

micha00:03:28

boot does have a "debouncing" loop

micha00:03:34

in the watcher code

micha00:03:41

it's set by default to 10ms

micha00:03:44

you can increase that

andrewboltachev00:03:55

I've seen that, yes

andrewboltachev00:03:04

So... it would be the same effect?

andrewboltachev00:03:26

i.e. when new event would appear, it will wait 10ms again for the next?

micha00:03:47

it uses a queue that it polls

micha00:03:19

it doesn't actually trigger any handlers until the polling timeout (10ms) is reached without anything new being put on the queue

micha00:03:33

every fsevent results in an item being added to this queue

andrewboltachev00:03:57

well, queue... is that Java object?

micha00:03:30

it's a LinkedBlockingQueue i think

andrewboltachev00:03:42

So LinkedBlockingQueue yes

andrewboltachev00:03:16

so queue is something of "organizational" nature, not about watching files for changes?

micha00:03:35

the queue is for the debouncing

micha00:03:59

if you have a thing that modifies a file every say 50ms though

micha00:03:03

you will get weird results

micha00:03:20

because boot won't react to any filesystem changes while it's building

micha00:03:29

meaning while the watch task is running the pipeline

micha00:03:50

so those changes will be processed as soon as the build finishes

micha00:03:56

it start on the next one right away

micha00:03:15

so for example if you modify a file, and then your editor does something 50ms later

micha00:03:20

that results in a file being changed

micha00:03:37

even though the build that the watch task will run might take 1000ms to complete

micha00:03:50

that change that happened after 50ms isn't seen by the watch task yet

micha00:03:03

then when the build finishes it triggers again

micha00:03:28

not sure if i'm being clear or not simple_smile

micha00:03:54

the go loop code you pasted above is doing the debouncing right?

andrewboltachev00:03:13

(sorry, I were away) yes

andrewboltachev01:03:21

Btw, as I see it now...

andrewboltachev01:03:36

it would be crazy enough for Boot to do it on core.async blocks

micha01:03:23

is there a bug in the LinkedBlockingQueue stuff in boot?

andrewboltachev01:03:43

i.e. much harder for users to make own tasks

andrewboltachev01:03:18

uhm, don't know, the only thing is that it used to speak more than once

andrewboltachev01:03:46

now speak is sometimes slient on success

andrewboltachev01:03:56

only on fail it produces sound

micha01:03:03

the sound is played from a different thread

andrewboltachev01:03:13

or on first success after fail

micha01:03:16

so that could be relevant

micha01:03:46

the speak task continues with the pipeline before the sound is actually finished playing

micha01:03:53

because it plays the sound in a future

micha01:03:08

so it's possible that boot could exit before the sound is played

micha01:03:17

or something else weird could happen

andrewboltachev01:03:39

well, I have it watching

andrewboltachev01:03:47

so nothing like exit is here

andrewboltachev01:03:38

where main might me as easy as "Hello, world!"

andrewboltachev01:03:27

when I change it to "Hello, Andrew!" I expect it to (1) make (exactly one) sound of success and (2) to print out the message and "Elapsed time" etc

micha01:03:53

and it doesn't do that?

micha01:03:04

it speaks twice?

micha01:03:19

and sometimes not at all?

andrewboltachev01:03:24

It used to speak twice. I suppose that 'cause of big files

micha01:03:10

does increasing the debouncing time help?

andrewboltachev01:03:14

ah, didn't try yet

andrewboltachev01:03:00

well, I were thinking you'll get idea of my core.async version

andrewboltachev01:03:25

it were actually first time me drawing time diagrams for programming simple_smile

andrewboltachev01:03:51

while designing it

andrewboltachev01:03:29

so, anyway, what's source of FS events? it's just polling it, right?

andrewboltachev01:03:41

i.e. no event source

andrewboltachev01:03:49

and again, I just wanted to learn about your solution to suchlike probem, and these little issues — I don't know if they're important

andrewboltachev01:03:12

'cause it's so exciting to learn others solutions

andrewboltachev01:03:52

one bad thing about me is that I used to hang on Hoplon channels for long time, but switched to Om now 😕

micha01:03:56

haha no worries

micha01:03:39

the event source is the fsevents API, via the java watchservice for windows and linux, and via a 3rd party implementation for OSX

micha01:03:49

boot always has its own filesystem watcher going, separate frh tasom the watch task

micha01:03:21

i mean "separate from the watch task"

andrewboltachev01:03:26

great thanks! I didn't even see that code yet (while hacking into Boot a bit). I'll review that later then. Time to go now...

johannjohann07:03:15

hallo hi hey--is there a way to add a directory to the resource path and have it not be watched on changes

micha13:03:19

@johanatan: no, not really

micha13:03:35

what is your use case?

martinklepsch13:03:07

node_modules 😛

micha13:03:49

how does node_modules trigger the watch task though?

micha13:03:02

if you do npm install you'd want the thing to rebuild, no?

micha13:03:24

otherwise the files in there wouldn't change i don't think

martinklepsch13:03:27

ah right, I was reading it as "and have no watchers on those dirs"