Fork me on GitHub
#figwheel-main
<
2020-07-07
>
rgm00:07:41

Update: Well, my current workaround is to just change :barbary in this line to :polling, pack up a new hawk JAR and use maven to stick in in my ~/.m2 dir. The effect is that I’m not using native Mac system events any more and so taking a battery hit, but at least the hot reloading performance is back to normal. https://github.com/wkf/hawk/blob/master/src/main/clojure/hawk/watcher.clj#L136

rgm00:07:30

wonder if it’s worth contributing some sort of PR adding a switch to hawk, if the barbary service fails then emit a warning and fall back to polling the fs.

rgm00:07:41

result is no changes needed to figwheel.

bhauman00:07:44

@rgm yeah that’s a good idea

bhauman00:07:10

we might have to do this in figwheel

bhauman00:07:55

if more folks make this change

rgm00:07:57

I guess we could catch a missing-Carbon throw, and try to explicitly fall back to a polling watcher. I could document my steps on the github issue though, since making a custom hawk jar with the right version will fix all my figwheel projects on the specific machine and buy some time.

bhauman00:07:29

can we just catch this in figwheel and restart with polling?

rgm00:07:11

I’ll look into it and PR it if I can.

rgm00:07:00

I’m a bit concerned jna -> barbary -> hawk could take a while to work through… was looking at last updates and they seem to have—to their credit—not needed to be touched in years.

rgm00:07:26

is it OK to catch the specific thrown exception, or should I try something more proactive like trying to check the Mac OS version?

rgm03:07:28

just in case anyone else is having trouble on macOS Big Sur betas, here’s how to monkey-patch the hawk file watcher to at least be able to get some work done https://github.com/bhauman/figwheel-main/issues/253#issuecomment-654572662

rgm04:07:02

@bhauman Here’s a first cut at dealing with the mac FS events. (I’m pretty sure I have some problems around over-catching exceptions, hence draft status). https://github.com/bhauman/figwheel-main/pull/254/files Now that I understand the mechanism better, maybe this problem could be best dealt with by expanding the documentation around https://figwheel.org/config-options.html#hawk-options a bit more. Falling back to polling feels like it could have some downsides but I’m having trouble articulating what they might be.

💯 3
bhauman14:07:16

@rgm that’s a good point

bhauman14:07:35

I’m not using big sur

bhauman14:07:10

So am I correct in understanding that if folks just switch their config to polling on Big Sur this isn’t an issue?

bhauman14:07:59

I should have made that connection myself

bhauman14:07:37

@rgm thanks for taking time to look into this!

rgm14:07:58

@bhauman yep, it looks like after all that the one-liner :hawk-options will take care of it.

rgm14:07:29

(work smarter not harder etc. etc.)

folcon17:07:02

@bhauman I think I found a windows bug? I’ve had the path for the bundling command using the wrong slashes for :output-to, ie \ instead of /. I’m not overriding it, so it’s using whatever figwheel has defined…

bhauman19:07:08

so the default output-to has / in it?

bhauman19:07:24

that shouldn’t be happening at all

folcon19:07:04

I’m trying to work out how it’s happening. So if I use cursive with the repl run configuration it happens, but if I use the terminal inside intellij it doesn’t… Are you doing some environmental detection to work out what paths to use?

bhauman19:07:22

I use generic paths

folcon19:07:33

This might be a cursive bug instead of a figwheel-main bug…

bhauman19:07:44

(io/file “target” “cljs-out” “etc”)

folcon19:07:00

ok, hmm. That should just work I think.

folcon19:07:20

How do you call npx?

bhauman19:07:44

with output-to

bhauman19:07:50

I call it with output-to

folcon19:07:52

It’s also failing to detect that under certain circumstances, ie saying that it isn’t installed…

folcon19:07:07

even though it definitely is in wsl

folcon19:07:26

I’m beginning to see why windows users find this hard…

bhauman19:07:35

it’s npx.exe right?

folcon19:07:29

Well it was, I’m having more success at the moment using linuxbrew, so it actually installs npx

bhauman19:07:58

well that’s a problem then

bhauman19:07:12

because I’m detecting the os

bhauman19:07:26

In the latest version

bhauman19:07:33

you might not be running that code

folcon19:07:52

which version is this? 0.2.8-snapshot?

bhauman19:07:32

we’re on 0.2.10-SNAPSHOT

folcon19:07:28

Cool, will try that

folcon19:07:32

Ok, so I believe that run configuration doesn’t use wsl, which is why it’s not working as I don’t think I set that up properly… however I can use it perfectly well by just calling the repl terminal version and then using nrepl to connect to it…