Fork me on GitHub
#biff
<
2022-08-01
>
Jacob O'Bryant00:08:06

@tbrooke following up from this: https://clojurians.slack.com/archives/CG3AM2F7V/p1659306506310639 run this in an empty directory as a test, this should trigger the error:

$ touch foo
$ clj -Sdeps '{:deps {hawk/hawk {:mvn/version "0.2.11"}}}'
Clojure 1.11.1
user=> (require '[hawk.core :as hawk])
nil
user=> (hawk/watch! [{:paths ["foo"] :handler (fn [_ _] (println "hello"))}])
{:thread #object[java.lang.Thread 0x40368a46 "Thread[Thread-1,5,main]"], :watcher #object[sun.nio.fs.LinuxWatchService 0x7e9da981 "sun.nio.fs.LinuxWatchService@7e9da981"]}
user=>

Jacob O'Bryant02:08:35

(moving some messages over here that I accidentally posted to the xtdb thread first)

Jacob O'Bryant02:08:45

I just poked around a little. looks like hawk wraps https://github.com/gjoseph/BarbaryWatchService which has been retired. Hawk itself hasn't had a commit since 2016. I think I probably need to replace Hawk with something else, perhaps use a different java lib directly. Just made an issue: https://github.com/jacobobryant/biff/issues/122

Jacob O'Bryant02:08:28

in the mean time--you could comment out the biff/use-hawk line in the main clojure file in your project. Unfortunately that means saving files won't trigger a code reload, but you can eval (on-save @biff/system) (in the same file) from the repl instead. If you bind it that to a keyboard shortcut it might not be that bad.

Jacob O'Bryant22:08:41

@tbrooke I've just pushed a branch to Biff that replaces Hawk with a different library, Beholder. Can you try it out and see if it fixes the UnsatisfiedLinkError? • First, set your biff version to com.biffweb/biff {:git/url "" :sha "a515171e8e6566e4f08b97c6fcc5a72859799b6d"} in deps.edn. • Then edit your project to use hawk instead of beholder , as demonstrated here: https://github.com/jacobobryant/biff/commit/a515171e8e6566e4f08b97c6fcc5a72859799b6d (you'll need to edit config.edn though, not config.edn.TEMPLATE). • Then run the project and try saving some files If that works for you, I'll go ahead and push this to master. (Also if anyone else wants to test this out--especially if you're on mac--that'd be great)

tbrooke23:08:44

Works like a charm

👌 1
Jacob O'Bryant18:08:11

Not strictly related to Biff, but the second half of this post discusses my short term life plans, which include a small sprint on Platypub this week: https://blog.thesample.ai/p/report-2022-08-01/

🙂 2
Jacob O'Bryant22:08:41

@tbrooke I've just pushed a branch to Biff that replaces Hawk with a different library, Beholder. Can you try it out and see if it fixes the UnsatisfiedLinkError? • First, set your biff version to com.biffweb/biff {:git/url "" :sha "a515171e8e6566e4f08b97c6fcc5a72859799b6d"} in deps.edn. • Then edit your project to use hawk instead of beholder , as demonstrated here: https://github.com/jacobobryant/biff/commit/a515171e8e6566e4f08b97c6fcc5a72859799b6d (you'll need to edit config.edn though, not config.edn.TEMPLATE). • Then run the project and try saving some files If that works for you, I'll go ahead and push this to master. (Also if anyone else wants to test this out--especially if you're on mac--that'd be great)