Dependency cycle error for cljc files that require macros from itself
When I try to load a namespace, that has a :require-macros dependency on "itself" I get a dependency cycle error.
For example in replicant.alias from Replicant:
(ns replicant.alias
(:require [clojure.walk :as walk]
[replicant.assert :as assert]
[replicant.core :as r]
[replicant.hiccup :as h]
[replicant.hiccup-headers :as hiccup])
#?(:cljs (:require-macros [replicant.alias])))
When I try to load it, or any namespace that depends on it I get:
This "require macros from itself"-pattern is valid in cljc files where the cljs "instance" of the namespace can require macros from the clj "instance" of the same namespace. It shouldn't be an error, as it's a common pattern when working with cljc files.
This is with Cursive built from 2025.1.1
I'm not sure when this error was introduced, but I do remember working with other code a while a go (maybe a year or so) that also had this "require macros from itself"-feature without it being an issue.
Yes Cursive should handle this, I'll try to look at this today.
I did fix a related bug in 2025.1.1 (#3026) but it looks like you're already on that version, right?
Yes, I'm on 2025.1.1 / 2025.1-251 That bug seems to be related but maybe not quite the same. 🤷
Sorry, it took me a little longer than expected, but I did look at this. Unfortunately, I can't reproduce it. I've run through some of the replicant examples including the alias ones, and it seems to work fine. Looking at your Cursive version, it looks like you might be running IntelliJ 2025.1.1, but Cursive 2025.1-251. You'll need Cursive 2025.1.1-251 for that bug fix. Sorry, these versions are a little complicated!
Ahh, so 2025.1-251 and 2025.1.1-251 aren't the same 😅 I upgraded Intellij and Cursive, with the eap build, to 2025.2-eap2-251. Now I don't get the error anymore. Thanks for looking in to it 🙏