This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-05
Channels
- # architecture (3)
- # aws (4)
- # beginners (100)
- # boot (14)
- # cider (59)
- # cljs-dev (1)
- # cljsrn (24)
- # clojure (53)
- # clojure-dev (58)
- # clojure-italy (2)
- # clojure-spec (1)
- # clojure-uk (25)
- # clojurescript (7)
- # cryogen (1)
- # cursive (1)
- # datomic (9)
- # dirac (9)
- # duct (3)
- # off-topic (52)
- # om-next (3)
- # onyx (42)
- # portkey (28)
- # re-frame (3)
- # reagent (11)
- # rum (3)
- # shadow-cljs (12)
- # specter (7)
- # tools-deps (18)
- # vim (1)
- # yada (4)
Hello guys
Could not transfer artifact cider:cider-nrepl:jar:0.16.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I'm having this error when I'm trying to use CIDER Repl on Emacs
Anyone knows why?
(defproject fun "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[cider/piggieback "0.3.1"]
[org.clojure/tools.nrepl "0.2.13"]]
:plugins [[cider/cider-nrepl "0.16.0"]])
my project.clj is like this
@simon Have you tried asking in #datomic ?
@d.ian.b what does lein version
say?
@seancorfield in emacs?
In a terminal window.
It looks like a TLS/SSL error so your Leiningen version might matter.
lein --version Could not find artifact cider:cider-nrepl:jar:0.16.0 in central (https://repo1.maven.org/maven2/) Could not transfer artifact cider:cider-nrepl:jar:0.16.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not transfer artifact cider:cider-nrepl:pom:0.16.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target This could be due to a typo in :dependencies, file system permissions, or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.
You'll need to run it outside your project folder.
lein version
(not lein --version
)
(although running lein version
inside your project folder probably shouldn't try to load the project.clj
I'd have thought)
╰─➤ lein version 1 ↵ Could not find artifact cider:cider-nrepl:jar:0.16.0 in central (https://repo1.maven.org/maven2/) Could not transfer artifact cider:cider-nrepl:jar:0.16.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not transfer artifact cider:cider-nrepl:pom:0.16.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target This could be due to a typo in :dependencies, file system permissions, or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.
Outside your project folder??
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater. Warning: refactor-nrepl middleware won't be activated due to missing dependencies. Leiningen 2.8.1 on Java 1.8.0_161 GraalVM 1.0.0-rc1
Hmm, 2.8.1 is very recent... but the GraalVM? I don't know if Clojure runs on that?
My friend @souenzzo is running on GraalVM
I think at this point I'd recommend asking in #leiningen -- this looks Leiningen-specific.
i think the middleware is the problem
I can load cider/cider-nrepl
just fine using clj
.
So the problem is not with the dependency.
Not sure what's bringing in pre-1.7 Clojure. That looks odd too.
the problem I think it's lein
I've tried to rm -rf .lein
on home
and start again
It was a global profile.clj on there
Thanks!
I'd like to flatten a nested map such that the 'path' leading to it is preserved. How would I do this? Example- Given {:a 1 :b {:c 3 :d 4 :e {:f 6 :g 7}}}
, I'd like somethink akin to [:a 1] [:b :c 3] [:b :d 4] [:b :e :f 6]
etc.
Might be helpful . They join the keys with a separator meanwhile you have to collect them in a vector. https://stackoverflow.com/questions/17901933/flattening-a-map-by-join-the-keys
question about repl-driven development: let’s say I have a file I’m working in that has a bunch of required namespaces and refers symbols from those namespaces. Is it possible to send forms from that file to the repl such that the repl understands all of that already? Or do I have to eval the whole file to do stuff like that?
@lee.justin.m You can evaluate individual forms that introduce new/updated def
s (or derived things like defn
s)
that's an editor integration thing, but I'd be seriously disappointed by any editor that did those things wrong (I know emacs cider, vim fireplace, and intellij cursive all handle it properly)
And all your editor really needs to do is ensure it does in-ns
before evaluating the code it is sending.
i’m using cursive. basically this arises when i want to experiment with a library like specter or plumatic schema and I’ve referred a bunch of symbols into the environment. then I want to iterate on some little function, but the repl doesn’t seem to understand any of those symbols
OK - are you evaluating forms in the file, or typing them into the repl?
if the latter, use in-ns (or even ns) - there may be an editor shortcut to make it do that for you based on the file as well
the repl tells you what namespace it is in at the prompt, and I wouldn't expect or even want an editor to change how namespace resolution works
I've always wanted to know - what's the difference between using in-ns
and ns
to switch to a ns?
yea okay this is working as expected. i must have been doing something strange before.
In ClojureScript using ns
can blow away any aliases. More here https://stackoverflow.com/questions/35709098/using-required-namespace-in-the-repl/35713553#35713553
got it
@joelsanchez ns and in-ns both create a namespace if it doesn't exist, but in-ns isn't a macro and does none of the standard initial bindings like refer-clojure
(or creating aliases...)
it was easier than I thought, the answer is "don't" 🙂
they are identical but for the ' for switching to a namespace that exists
(in jvm clojure)
when i send forms from the current file, the editor should be doing that in the ns of that file. so like when i re-def something by sending the form from the editor, it will happen in that file’s namespace. same with reloading the entire file (right?)
So maybe: Use ns
for creating a brand new namespace, with all of its import/require/use if you want those things, use in-ns
to switch between already-created namespaces?
if you ever end up in an uninitialized ns like created by an in-ns typo, you can escape by calling (clojure.core/refer-clojure)
@lee.justin.m If you use Cursive's Tools > REPL > Send ... commands, they evaluate that form in the same namespace as the file.
(The feedback you get is the that the Var printed has the right namespace, even though your REPL may be in a different one.)
@noisesmith that trick would've saved me quite a few times 😅
Wow, the implementation of in-ns is buried deep in Clojure/Java. Finding the source for it is not a one-step process.
since it is implemented in Java, not Clojure like most other stuff in clojure.core namespace is
@mfikes thanks: actually reading what ns the var is evaluated in has explained why i was confused. in cursive, hitting the cmd-shift-p hotkey doesn’t send the form in the current namespace. things started to work when i manually did a (in-ns 'whatever)
Here: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L238-L245
Not terribly important if you just want to use it -- I only looked at it because of the question of exactly what the difference between in-ns and ns is.
Wow, in Clojure, in-ns
truly is a strange beast. In ClojureScript it is a special form only understood (and implemented) by the REPL.
In Clojure/Java, the Clojure code implementing clojure.core and other built-in namespaces uses in-ns quite a lot. I have also seen it being used in a few other Clojure libraries in their source files, since it tripped up Eastwood analysis of those projects until Eastwood started behaving more like Clojure/Java did while analyzing such source code.
I consider at least some of the libraries using in-ns to be truly funky, yes 🙂
On the other hand, in ClojureScript, you can't take the value of in-ns
; it really only ephemerally exists for the REPL, which pulls it out of its hat
Hey, I’m going wrong somewhere wrt laziness, could you please help me figure out where?
Excuse ugly code, I’ve edited it to hell. Context: playing with Clojure in hackerrank, and it times out on a LONG list of integers as input (I think it contains 1…100,000).
(defn pentagonal-iterate [n]
(letfn
[(pent [[n x]] [(inc n) (+ 4 (* 3 (dec n)) x)])]
(second (nth (iterate pent [1 1]) (dec n)))))
(dorun
(->>
(line-seq (java.io.BufferedReader. *in*))
(drop 1)
(map (comp
println
pentagonal-iterate
#(Integer/parseInt %)))))
you pretty much never want (comp println ...) - println returns nil corrected - Original was right, I had it wrong
perhaps your comp args are backward
also, dorun over map with two args can be replaced with run! - you aren't actually using laziness here, just using something lazy and forcing it not to be
comp, dorun: that’s part of hackerrank weirdness, they only read stdin/stdout but not actually check any return of the above.
what I'm saying is (dorun (map ...)) can be replaced with (run! ...)
d'oh never mind, you are right
hmm... I don't know if that will help, I can't see what would actually be wrong here
> Exception in thread “main” java.lang.RuntimeException: Unable to resolve symbol: run! in this context
oh, they must be using an old clojure version
you could also use doseq, which just takes a body instead of a function