figwheel-main

figwheel-main http://figwheel.org
rgm 2020-07-07T00:38:41.426900Z

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

rgm 2020-07-07T00:40:30.428100Z

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.

rgm 2020-07-07T00:40:41.428300Z

result is no changes needed to figwheel.

bhauman 2020-07-07T00:41:44.428600Z

@rgm yeah that’s a good idea

bhauman 2020-07-07T00:43:10.428900Z

we might have to do this in figwheel

bhauman 2020-07-07T00:43:55.429700Z

if more folks make this change

rgm 2020-07-07T00:46:57.431600Z

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.

bhauman 2020-07-07T00:47:29.431900Z

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

rgm 2020-07-07T00:49:11.432300Z

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

rgm 2020-07-07T00:50:00.433300Z

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.

rgm 2020-07-07T00:54:26.434Z

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

rgm 2020-07-07T03:12:28.434800Z

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

rgm 2020-07-07T04:19:02.437800Z

@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.

1💯
bhauman 2020-07-07T14:33:16.438200Z

@rgm that’s a good point

bhauman 2020-07-07T14:33:35.438500Z

I’m not using big sur

bhauman 2020-07-07T14:35:10.439600Z

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

bhauman 2020-07-07T14:35:59.440Z

I should have made that connection myself

bhauman 2020-07-07T14:36:37.440600Z

@rgm thanks for taking time to look into this!

rgm 2020-07-07T14:47:58.441700Z

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

rgm 2020-07-07T14:48:29.442Z

(work smarter not harder etc. etc.)

2020-07-07T17:25:02.444200Z

@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…

bhauman 2020-07-07T19:06:24.444600Z

@folcon tell me more

bhauman 2020-07-07T19:07:08.445900Z

so the default output-to has / in it?

bhauman 2020-07-07T19:07:24.446400Z

that shouldn’t be happening at all

2020-07-07T19:08:04.447200Z

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?

bhauman 2020-07-07T19:08:22.447500Z

I use generic paths

2020-07-07T19:08:33.447900Z

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

bhauman 2020-07-07T19:08:44.448400Z

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

2020-07-07T19:09:00.449Z

ok, hmm. That should just work I think.

2020-07-07T19:09:20.449400Z

How do you call npx?

bhauman 2020-07-07T19:09:44.450100Z

with output-to

bhauman 2020-07-07T19:09:50.450500Z

I call it with output-to

2020-07-07T19:09:52.450600Z

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

2020-07-07T19:10:07.451100Z

even though it definitely is in wsl

2020-07-07T19:10:26.451700Z

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

bhauman 2020-07-07T19:10:35.452Z

it’s npx.exe right?

2020-07-07T19:11:29.452600Z

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

bhauman 2020-07-07T19:11:43.452800Z

mpx.cmd

bhauman 2020-07-07T19:11:58.453Z

well that’s a problem then

bhauman 2020-07-07T19:12:12.453300Z

because I’m detecting the os

bhauman 2020-07-07T19:12:26.453600Z

In the latest version

bhauman 2020-07-07T19:12:33.453900Z

you might not be running that code

2020-07-07T19:12:52.454400Z

which version is this? 0.2.8-snapshot?

bhauman 2020-07-07T19:13:32.454800Z

we’re on 0.2.10-SNAPSHOT

2020-07-07T19:15:28.455100Z

Cool, will try that

2020-07-07T19:29:32.456Z

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…