Fork me on GitHub
#lambdaisland
<
2024-02-28
>
geraldodev23:02:03

I have a deps.edn that have logback-classic and slf4j as dependencies but I had no logback.xml , so launchpad ran in debug mode, and I could see that it starts many watchers, including directories starting with . like .clj-kondo .idea .git . Is that desirable ?

plexus06:03:43

That seems odd. Can you share a repro or at least copy the output?

geraldodev12:03:04

@U07FP7QJ0 was the output good evidence ?

plexus08:03:42

So I do think this is actually expected, see this message:

DEBUG io.methvin.watcher.DirectoryWatcher - Assuming ExtendedWatchEventModifier.FILE_TREE is not supported
Linux does not support watching directories recursively, so the watcher lib we use sets up watchers for all subdirectories. We don't really need that, would be worth looking into how to turn that off for efficiency, but it's not a problem as such.

geraldodev09:03:56

I think not entering node_modules would be good and dot directories would be good.

plexus09:03:49

This is fundamentally the issue: https://github.com/gmethvin/directory-watcher/issues/54 . We use nextjournal.beholder for the watcher, which uses io.methvin/directory-watcher, which doesn't have a good mechanism for non-recursively watching directories.

plexus09:03:14

So there probably are ways to solve this, the linked issue hints at a way to call specific methods through reflection, but that might mean opening up specific modules in a post java-9 world. Or we look at other watcher solutions, or implement something ourselves (so replicate what io.methvin/directory-watcher does). But doing it cross platform is a pain (which is why we use this lib), and it seems it's not actually solvable on mac os. So, this might be something that will only gets fixed if a community contribution comes through that fixes it.