Skip to content

Conversation

@jpmonettas
Copy link
Contributor

@jpmonettas jpmonettas commented Apr 22, 2024

Currently when a :classpath-override map is provided in deps.edn the overrides vector is being added as exclusions only to maven libraries.

So if we have a library, like in this case io.github.nubank/morse which includes a version of org.clojure/clojure, and
we are adding it as a git lib, like this :

{:aliases
 {:dev
  {:extra-deps
   :classpath-overrides {org.clojure/clojure nil} ;; swapping compilers
   {com.github.flow-storm/clojure {:mvn/version "1.11.2-4"}
    io.github.nubank/morse {:git/tag "v2023.10.06.02" :git/sha "88b5ff7"}}}}}

then the resulting classpath will include org.clojure/clojure even if we told it to exclude it.

This PR fixes this. Not sure how this affects the lein path of this tool.

@vemv
Copy link
Member

vemv commented Apr 22, 2024

Thanks much for the PR!

Not sure how this affects the lein path of this tool.

Not a concern, fortunately - Lein doesn't use this code and doesn't have the notion of classpath overrides.

Would you be able to expand the t.deps-specific test suite? It should be fairly easy.

Cheers - V

@jpmonettas jpmonettas force-pushed the fix-non-maven-libs-exclusions branch from bf952bf to 330063d Compare April 22, 2024 18:12
{:deps {io.github.nubank/morse {:git/tag "v2023.10.06.02" :git/sha "88b5ff7"}}
:aliases
;; let's swap the Clojure compiler by ClojureStorm
{:storm {:classpath-overrides {org.clojure/clojure nil} ;; for disabling the official compiler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer an additive change to not lose coverage, e.g. flowstorm2/deps.edn

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, np, but shouldn't that test cover both cases?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to rest assured - to me these are just data - very cheap to accrete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@jpmonettas jpmonettas force-pushed the fix-non-maven-libs-exclusions branch from 330063d to b1b59e0 Compare April 22, 2024 18:21
:local/root]))
;; use m (and not the select-keys result) to honor `:exclusions`:
[dep m])))
[dep (assoc m :exclusions classpath-overrides-vector)])))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment in L164 makes be believe m can have :exclusions - aren't we at risk of overriding them?

What about:

[dep (-> m
         (update :exclusions into classpath-overrides-vector)
         (update :exclusions vec))]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah, you are right. Done!

@jpmonettas jpmonettas force-pushed the fix-non-maven-libs-exclusions branch from b1b59e0 to 4dc83f9 Compare April 22, 2024 18:32
@vemv vemv merged commit 15bf557 into clojure-emacs:master Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants