This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-14
Channels
- # admin-announcements (1)
- # announcements (28)
- # babashka (9)
- # beginners (32)
- # biff (1)
- # calva (1)
- # clj-kondo (26)
- # clj-otel (52)
- # cljs-dev (2)
- # clojure (41)
- # clojure-europe (23)
- # clojure-korea (7)
- # clojure-nl (1)
- # clojure-norway (39)
- # clojure-uk (4)
- # community-development (10)
- # core-typed (9)
- # cursive (2)
- # datahike (8)
- # events (1)
- # helix (10)
- # kaocha (5)
- # malli (14)
- # missionary (4)
- # off-topic (42)
- # pedestal (1)
- # reagent (3)
- # releases (5)
- # shadow-cljs (33)
- # squint (18)
- # tools-build (8)
- # xtdb (17)
Hey y'all, any Rollbar users here? We've been using an in-house patched version https://github.com/circleci/rollcage for a while but it seems like the project is no longer maintained. Even the https://clojars.org/circleci/rollcage/versions/1.0.218 uses org.clojure/tools.logging 0.4.0
which has a number of CVEs including vulnerability to the log4j / log4shell exploit. Just wondering what Rollbar libraries folks out there are using. Thanks!
tools.logging has only a test dependency on log4j and does not have a vulnerability from that
i suspect the cheshire dep is the one that’s older and vulnerable. Clojure easily allows you to override transitive deps and the stable nature of the ecosystem means this usually works.
Good to know, thanks @U064X3EF3
We're using managed dependencies to override all the dependencies of rollcage in practice. I'll see what I can do about getting a version bump of rollcage with more up to date versions of its dependencies.
I just released https://clojars.org/circleci/rollcage/versions/1.0.241 with more up-to-date dependencies if that helps.
Is there a way to get notified when a particular namespace either interns or unmaps a var?
For context, I'm thinking about building a clerk-like dev tool that can watch a namespace and automatically update as you're developing at the repl.
I don't think so, since the mappings are kept in a PersistentMap referenced by an AtomicReference instead of an atom, which doesn't support watches
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Namespace.java#L25
Two solutions I can think of: • Use a modified version of Clojure • Monitor the values in a loop
Ok, that's more or less what I could gather. Thanks for the input!
One crazy idea is to create a subclass of Namespace that does support watches and replace the namespace instances I'm interested in with the subclass.
But @U2FRKM4TW’s idea to regularly poll is probably more straightforward.
interesting, but when do you replace it?
At dev time when I'm interested in tracking a namespace for changes.
oh, ok, I thought you needed something automatic
It does seem like it's possible to get notified when the list of *loaded-libs*
changes. I would be happy if I could just watch a specific namespace, but it seems like it wouldn't be that hard to extend it to automatically track new namespaces.
imagine a world where you can run fully reactive datalog queries against the state of your program, its vars, and namespaces
I think there was a project similar to what you're describing. I can certainly imagine such a world. I fail to imagine the use. :)
Another option is some sort of IDE middleware (eg. cider/nrepl middleware). The idea would be to parse forms sent for eval and do something when you find a def call.
with nrepl middleware you can have arbitrarily powerful features. Personally I wouldn't parse the evaled forms - instead I'd check the ns vars programatically. If they're not identical?
they changed
So just check the ns's mappings on every eval?
@U2FRKM4TW metazoa?
That seems pretty reasonable.
Seems very cheap/fast
cider-nrepl's track-state
middleware roughly works that way - it's re-performed on each eval-like op. There's some caching.
(you can grep ops-that-can-eval
in the cider-nrepl repo)
@UK0810AQ2 Never encountered it before, but looks interesting.
Yes, I get notified when a namespace either interns, unmaps, or a var changes so that I can update the UI.