<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged add-libs</title>
<link>https://ask.clojure.org/index.php/tag/add-libs</link>
<description></description>
<item>
<title>add-libs fails when *print-length* is set in 1.12-alpha4</title>
<link>https://ask.clojure.org/index.php/13053/add-libs-fails-when-print-length-is-set-in-1-12-alpha4</link>
<description>&lt;p&gt;In version &lt;code&gt;1.12.0-alpha4&lt;/code&gt;, calling any of the clojure.repl.deps/add-libs related functions will fail when &lt;code&gt;*print-length*&lt;/code&gt; is set, ostensibly to a number small enough to abbreviate your project's &lt;code&gt;:deps&lt;/code&gt; when printing them.&lt;/p&gt;
&lt;p&gt;So to reproduce, create a new project with 10 deps in deps.edn then&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(set! *print-length* 5)
(add-libs '{my/lib {:mvn/version &quot;0.1&quot;}}) ;;fails

(set! *print-length* nil)
(add-libs '{my/lib {:mvn/version &quot;0.1&quot;}})  ;;now it works
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I believe this is due to &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/501348deb1e49736f3c49f2c177bcff947fe3a17/src/clj/clojure/tools/deps/interop.clj#L40&quot;&gt;this line&lt;/a&gt; in clojure.tools.deps.interop&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13053/add-libs-fails-when-print-length-is-set-in-1-12-alpha4</guid>
<pubDate>Sun, 02 Jul 2023 18:56:53 +0000</pubDate>
</item>
<item>
<title>Did TDEPS-187 break add-libs?</title>
<link>https://ask.clojure.org/index.php/10936/did-tdeps-187-break-add-libs</link>
<description>&lt;p&gt;TDEPS-187 changed &lt;code&gt;clojure.tools.deps.alpha/calc-basis&lt;/code&gt;, which now merges &lt;code&gt;argmaps&lt;/code&gt; after &lt;code&gt;{:libs libs}&lt;/code&gt; - &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.deps.alpha/commit/f6fd34bc0118fa09d85d17e69f2bd43c55443d05#diff-44962de9e3f059bc9f2882985c29b51ec5b55fc0c9710fdff00c2af211fce72f&quot;&gt;diff&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'm running on tools deps at &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.deps.alpha/commit/02809dbd41d4fe6e269ee67316d054a04bc70678&quot;&gt;this commit&lt;/a&gt;, and I'm unable to add libs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;clojure.tools.deps.alpha.repl/add-libs&lt;/code&gt; calls &lt;code&gt;calc-basis&lt;/code&gt; with &lt;code&gt;initial-basis&lt;/code&gt; as the second argument, which means the &lt;code&gt;:libs&lt;/code&gt; in initial basis replace those calculated by &lt;code&gt;calc-basis&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Switching the merge order to: &lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;clojure&lt;br&gt;
(merge master-edn cp argmaps {:libs libs})&lt;code&gt;
&lt;/code&gt;``&lt;/p&gt;
&lt;p&gt;enables me to add libs to the classpath.&lt;/p&gt;
&lt;p&gt;Is this a regression, or am I holding it wrong?&lt;/p&gt;
</description>
<category>REPL</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10936/did-tdeps-187-break-add-libs</guid>
<pubDate>Thu, 12 Aug 2021 14:02:38 +0000</pubDate>
</item>
</channel>
</rss>