Fork me on GitHub
#cursive
<
2023-10-05
>
imre12:10:02

Anyone else noticed all sorts of local git deps now showing up in the project tool window as modules? Example in thread

imre12:10:10

Relevant versions: IntelliJ IDEA 2023.3 EAP (Ultimate Edition) Build #IU-233.8264.8, built on September 28, 2023 Runtime version: 17.0.8.1+7-b1063.1 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 13.6 Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true editor.minimap.enabled=true Non-Bundled Plugins: com.cursiveclojure.cursive (1.13.1-eap5-2023.3) Kotlin: 233-1.9.0-release-358-IJ8264.8

imre12:10:57

@U0567Q30W is this intentional or is it some regression?

imre12:10:46

(this is a polylith project but I get the same with other, non-polylith projects as well)

imre12:10:05

I would like the old behavior back please 😅

imre12:10:06

I can manually delete the unneeded modules but they come back when I re-sync the deps project

devurandom21:10:20

I also noticed that in 2023.2.2 and to me it was helpful. I could directly edit namespaces in a dependency I had added with :local/root. A rough edge is if you have a :local/root dependency of the main project, but then switch branches of the dependency on a terminal and its deps.edn vanishes due to that. (Maybe it is enough to just delete the deps.edn of the dependency, but I did not try that.) Then the main project's editor window is completely broken (stops resolving anything) and can only be fixed if you know to go to the main project's deps.edn, edit it, click "import" in the popup, edit it back, click "import" again.

cfleming02:10:25

Definitely looks like a bug, I’ll get that fixed.

cfleming08:10:31

This is a little trickier than I hoped, deps which come from git but then have :local/root dependencies within the git repo seem to be what causes this problem, which is why I haven’t seen it before.

imre09:10:58

Cheers @U0567Q30W for looking into it. This is https://clojure.atlassian.net/browse/TDEPS-132 where you develop libraries in a monorepo, with some local/root connections between those libs, then reference one of them via git in another project. My team uses that technique extensively. One of the main annoying things about this bug is that all those modules become part of the test/production search scope, often with multiple instances (you can see in the screenshot that some libs appear multiple times loaded from different locations)

imre09:10:23

@U368JQA01 yeah that feels handy but I'd argue that you'd never want to edit across a git dep boundary as you'll mess up what's in gitlibs Following just chains of local roots and having them editable is something I could imagine liking.

cfleming09:10:32

Oh yeah, it’s definitely a bug that needs fixing, no argument here.

1
cfleming05:10:42

Fixed for the next release.

🙏 1
1
imre19:10:01

Thanks so much!

imre10:11:21

Hey @U0567Q30W I noticed a potentially related problem with 1.13.1-eap8-2023.3: I have an app that git-references libs in a monorepo and some of those libs local/root reference other libs in the same monorepo. I found that now those git-then-local libs • don't show up in the dependency browser • cannot be navigated to • aren't on the classpath when I try to launch a "use ide classpath" repl

cfleming20:11:58

Ok, I’ll check that case too.

❤️ 1
imre08:11:52

Have you managed to repro this one or should I try and create a case?

cfleming06:11:47

I haven’t tried, but I’ll try tomorrow and let you know if I can’t make it fail.

imre15:11:21

Hey Colin sorry for the nagging, is there any chance you managed to make progress on this? It's kind of starting to get in my way more and more frequently.

cfleming04:11:18

@U08BJGV6E So I’ve set this up and I can reproduce it. However, these deps not showing up seems to be exactly what was fixed in #2845, right? Is there a difference here that I’m missing?

cfleming04:11:10

If not, a repro repo showing the difference would be much appreciated, or a description so that I can modify my repro case.

imre08:11:21

I'll create a repro for you today

👍 1
cfleming08:11:17

Just to be clear, I think I have one (and I see what you’re seeing), but I’m not sure how the case is different to #2845.

cfleming08:11:30

But a repro would be useful to make sure we’re talking about the same thing.

imre08:11:16

so 2845 was about git->local deps being added as modules when they shouldn't be

imre08:11:50

my current problem is that with 2845 fixed, I'm now unable to navigate to git->local deps in IJ

imre08:11:59

they don't resolve in Cursive

cfleming08:11:13

Right, but I think that’s because that’s exactly the 2845 case.

cfleming08:11:40

It’s just that sometimes it’s useful and sometimes it’s annoying, and I’m not sure how to distinguish those cases.

imre08:11:15

some versions ago, I used to be able to navigate to these without problems and without them showing up as modules

imre08:11:23

they were just sitting under libraries

imre08:11:12

one more hint that could help:

cfleming08:11:45

I see, so now they’re removed completely, and it would be useful to have them added as libraries?

cfleming08:11:01

I agree they should definitely appear in the project somehow.

imre08:11:15

yeah they are resolved by tools.deps and the cli without problems

cfleming08:11:19

Ok, I’ll look at that tomorrow now that I understand it better.

imre08:11:48

if I start a repl with "run with deps" then they are on the classpat

imre08:11:01

but if I start the repl with "run with IJ classpath" they are not there

cfleming08:11:09

Yes, that is definitely bad.

imre08:11:34

and I think that's closely related to them not being browseable in the editor

imre08:11:06

before 2485 became an issue, both navigation and IJ classpath worked all right

cfleming08:11:08

Yes, they’re not browsable because the 2845 fix removes them altogether, whereas it should add them as a lib.

1
cfleming08:11:36

That makes sense. Thanks Imre, I’ll get that fixed tomorrow with any luck, it should be in the next EAP.

imre08:11:04

Thanks very much!

cfleming03:11:17

Ok, I think this is working correctly now:

cfleming03:11:33

I have one more thing to fix, but it’ll be in the next EAP in a day or two.

🚀 1
imre17:11:14

Cheers Colin, this made those libs reappear under dependencies!

imre17:11:24

However, I'm still getting that strangeness I mentioned in my comment to the ticket #2861 about this:

imre17:11:50

This is from an internal project of ours:

; clojure -Srepro -Stree -A:test:dev 2>/dev/null | ag jsonista
          X metosin/jsonista 0.3.1 :older-version
        X metosin/jsonista 0.3.7 :older-version
  X metosin/jsonista 0.3.7 :superseded
  . metosin/jsonista 0.3.8 :newer-version
You can see that the cli will use 0.3.8 of jsonista, but Cursive shows both 0.3.7 and .8:

cfleming20:11:52

Ok, thanks Imre, I’ll look at this today.

cfleming07:11:05

I took a look at this today, and I can’t reproduce it. I used this deps.edn:

{:deps {viesti/timbre-json-appender {:mvn/version "0.2.11"}
        io.replikativ/datahike {:mvn/version "0.6.1554"}
        io.github.bsless/jsonista.streams {:mvn/version "0.0.2"}}}

cfleming07:11:13

I chose those deps from clojars because they rely on different versions of jsonista:

~/d/c/jsonista-conflict> clojure -Srepro -Stree | grep jsonista
  . metosin/jsonista 0.3.8
  X metosin/jsonista 0.3.7 :older-version
io.github.bsless/jsonista.streams 0.0.2
  X metosin/jsonista 0.3.6 :older-version

cfleming07:11:35

However Cursive syncs this fine, and only receives 0.3.8.

cfleming07:11:12

I also tried putting them in aliases:

{:deps {}
 :aliases {:one {:extra-deps {viesti/timbre-json-appender {:mvn/version "0.2.11"}}}
           :two {:extra-deps {io.replikativ/datahike {:mvn/version "0.6.1554"}}}
           :three {:extra-deps {io.github.bsless/jsonista.streams {:mvn/version "0.0.2"}}}}}

cfleming07:11:34

Same result:

~/d/c/jsonista-conflict (master)> clojure -Srepro -Stree -A:one:two:three | grep jsonista
  . metosin/jsonista 0.3.8
  X metosin/jsonista 0.3.7 :older-version
io.github.bsless/jsonista.streams 0.0.2
  X metosin/jsonista 0.3.6 :older-version

imre07:11:37

I'll try and create a minimal repro today. Some of thosr are pulled in via git+local deps on my case

cfleming07:11:46

Ok thanks, that would be great.

cfleming07:11:20

Git deps are kind of a pain to test, I wish they supported file:// urls.

imre11:11:57

All right, this was a pebkac it looks like - I have two modules in the workspace and the two of them pull in different versions of jsonista. Sorry for the bother and thanks again for the fix yesterday!

cfleming21:11:57

Oh great, glad it’s working!