leiningen

2024-02-29T14:01:49.156279Z

Hi, everyone This is my project.clj file ... This code is deployed into production and working okay suddenly today when I tried to do lein do clean, uberjar it and run it in my local computer I keep getting this error (I will post the error in the thread) The problem goes away when I comment out the whole exclusions section but if I don't it keeps getting me the error where he cannot find some file (the namespaces in those dependencies present in the exclusions section) My leiningen version :

Leiningen 2.11.2 on Java 17.0.10 OpenJDK 64-Bit Server VM

2024-02-29T14:02:33.714839Z

Here's the error I'm getting :

{:clojure.main/message
 "Execution error (FileNotFoundException) at hermes.van-buren.baja.commons.pipeline/loading (pipeline.clj:1).\nCould not locate hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core__init.class, hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.clj or hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.\n",
 :clojure.main/triage
 {:clojure.error/class java.io.FileNotFoundException,
  :clojure.error/line 1,
  :clojure.error/cause
  "Could not locate hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core__init.class, hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.clj or hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.",
  :clojure.error/symbol hermes.van-buren.baja.commons.pipeline/loading,
  :clojure.error/source "pipeline.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.Compiler$CompilerException,
    :message "Syntax error macroexpanding at (pipeline.clj:1:1).",
    :data
    {:clojure.error/phase :execution,
     :clojure.error/line 1,
     :clojure.error/column 1,
     :clojure.error/source "pipeline.clj"},
    :at [clojure.lang.Compiler$InvokeExpr eval "Compiler.java" 3719]}
   {:type java.io.FileNotFoundException,
    :message
    "Could not locate hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core__init.class, hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.clj or hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.",
    :at [clojure.lang.RT load "RT.java" 462]}],
  :trace
  [[clojure.lang.RT load "RT.java" 462]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 619]
   [hermes.van_buren.baja.commons.pipeline$loading__6789__auto____11048
    invoke
    "pipeline.clj"
    1]
   [clojure.lang.AFn applyToHelper "AFn.java" 152]
   [clojure.lang.AFn applyTo "AFn.java" 144]
   [clojure.lang.Compiler$InvokeExpr eval "Compiler.java" 3714]
   [clojure.lang.Compiler compile1 "Compiler.java" 7748]
   [clojure.lang.Compiler compile1 "Compiler.java" 7738]
   [clojure.lang.Compiler compile "Compiler.java" 7815]
   [clojure.lang.RT compile "RT.java" 411]
   [clojure.lang.RT load "RT.java" 457]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$compile$fn__6913 invoke "core.clj" 6171]
   [clojure.core$compile invokeStatic "core.clj" 6171]
   [clojure.core$compile invoke "core.clj" 6163]
   [user$eval159$fn__168 invoke "form-init1589464848683234846.clj" 1]
   [user$eval159 invokeStatic "form-init1589464848683234846.clj" 1]
   [user$eval159 invoke "form-init1589464848683234846.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7184]
   [clojure.lang.Compiler eval "Compiler.java" 7184]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.Compiler loadFile "Compiler.java" 7591]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$init_opt invokeStatic "main.clj" 477]
   [clojure.main$init_opt invoke "main.clj" 477]
   [clojure.main$initialize invokeStatic "main.clj" 508]
   [clojure.main$null_opt invokeStatic "main.clj" 542]
   [clojure.main$null_opt invoke "main.clj" 539]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause
  "Could not locate hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core__init.class, hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.clj or hermes/lib/system/interfaces/m1/disruptor/slot/i_v3/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.",
  :phase :execution}}

2024-02-29T14:05:13.800709Z

I ran lein do clean multiple times and removed the whole ~/.m2 folder multiple times but it doesn't even try to fetch the dependencies in the exclusions ... If I commen out the exclusions section and try again it works fine ...

2024-03-26T13:04:29.167229Z

Sorry for the delay @hiredman I have defined the excluded library explicitly in the dependencies section. The reason the same dependency is in the :exclusions is so that other dependencies that may rely on older versions of this library does not overwrite it. That's how we used leiningen for a long time but just after updating to the last version I keep getting this error

2024-03-26T13:51:34.804549Z

Hi everyone, There has been a change in Leiningen :

2.11.0 / 2024-01-27

    Top-level :exclusions can now affect top-level :dependencies. (Juan Monetta)
We used the top-level :exclusions to avoid adding the exclusions for each dependency separately. How can we achieve that now (I couldn't find anything in the docs for this) ?

vemv 2024-03-26T13:56:11.147659Z

From the description, it doesn't sound to me like those are are incompatible goals. anyway @jpmonettas hangs in here, he might know? (Otherwise, slightly hard to get bleeding-edge support there as most maintainers don't hang in here)

2024-03-26T14:05:50.711859Z

yes, that should have said :exclusions now ALSO affects top-level :dependencies

2024-03-26T14:06:47.594099Z

so, top-level :exclusions just excludes more now

2024-03-26T14:16:05.300219Z

Thanks @vemv and @jpmonettas We used the top level :exclusions to exclude any shared dependencies that may cause conflict ... So there's no way to do that right now other than duplicate those for every dependency ?

:exclusions        [

                      hermes.lib.system.interfaces/m1

                      hermes.lib.system.components/m1

                      commons-logging

                      ch.qos.logback/logback-classic

                      com.fasterxml.jackson.core/jackson-core

                      com.fasterxml.jackson.dataformat/jackson-dataformat-yaml

                      com.fasterxml.jackson.core/jackson-databind

                      log4j

                      org.apache.logging.log4j/log4j

                      org.slf4j/slf4j-simple

                      org.slf4j/simple

                      org.slf4j/slf4j-jcl

                      org.slf4j/slf4j-nop

                      org.slf4j/slf4j-log4j12

                      org.slf4j/slf4j-log4j13

                      ]
Thanks a lot

2024-03-26T14:16:37.168969Z

yes, it will work exactly the same in that respect

2024-03-26T14:17:24.236299Z

but now you can also exclude a dependency you have directly added on your top level :dependencies vector

2024-03-26T14:19:43.115499Z

so, my commit there was Fix global :exclusions in profile not applying to root :dependencies

2024-03-26T14:21:02.565689Z

Ah thanks @jpmonettas... so in other words we were using :exclusions the wrong way and ... simply having a dependency in the :dependencies section automatically overrides any indirect deps with conflicting versions

2024-03-26T14:21:24.080039Z

yes

🙏 1
2024-03-26T14:21:51.693439Z

you can add a specific version at the top level to override the transitive ones

2024-03-26T14:24:12.764849Z

that commit fixes a case where you want in your personal profile to exclude something that was added on the project :dependency vector. Before the commit you could exclude things being retrieved transitively by your dependencies, but not the dependencies themselves

2024-03-26T14:28:11.080259Z

it is for a pretty niche use case, let's say you have your own version of a lib, installed under you own group name, that you use for dev (for whatever reason), so want a way on your profile to exclude a lib so you can add yours. You can't overwrite it with a bigger version because the group names are different

2024-03-26T14:29:16.616519Z

Thanks a lot @jpmonettas Yeah I know the use case exactly ... it so happens that I wanted exactly the same functionality while trying out Flow-Storm debugger ... but later on the change caused all our builds failed for repos that used to work for two solid years after updating the leiningen version

2024-03-26T14:29:44.604959Z

yeah, I introduced that commit specifically to support that in FlowStorm

👍 1
2024-03-03T20:08:18.079809Z

I mean, that makes sense, when you exclude stuff you get an error that it cannot find a namespace, and when you don't exclude stuff it finds the namespace