Fork me on GitHub
#cider
<
2020-04-13
>
prikshet2114:04:47

I have the following build.boot file,

(set-env!
 :resource-paths #{"src"}
 :dependencies '[[me.raynes/conch "0.8.0"]
                 [boot.core :as boot]])
(task-options!
 pom {:project 'myapp
      :version "0.1.0"}
 jar {:manifest {"Foo" "bar"}})
following this documentation: https://github.com/boot-clj/boot/wiki/Cider-REPL However, upon doing cider-jack-in I get the error "refusing to run as root. set BOOT_AS_ROOT=yes to force.", and yet after doing export BOOT_AS_ROOT=yes, I get the same error. What's wrong?

bozhidar15:04:56

@prikshet21 Not sure about the boot error, but I can tell you really have to update nREPL and the CIDER related deps in build.boot.

bozhidar15:04:20

Also, make sure you’re using the latest stable Boot release.

prikshet2116:04:31

Yes, boot is 2.8.3. Well can you help with setting the environment variable that cider detects?

bozhidar16:04:48

@prikshet21 CIDER simply shells out to boot - it doesn’t do anything to modify the process’s environment.

bozhidar16:04:12

If you want to set some env variables from Emacs take a look here https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html

enn16:04:27

CIDER now seems to want to resolve .URIs and print the body when evaluating them at the REPL. Can this behavior be disabled?

dpsutton16:04:59

(setq cider-repl-use-content-types nil) i believe

dpsutton16:04:24

m-x cider-repl-toggle-content-types seems to be an interactive function to turn off

enn16:04:32

thank you

enn16:04:29

That fixed it. I'd lobby for this to be off by default ... it's really disruptive when testing any kind of URL-generating code

dpsutton16:04:43

i agree and have made the same argument

bozhidar17:04:06

Done. I just disabled this.

dpsutton17:04:55

i think its such a cool feature but comes with some security holes when not expecting it

prikshet2116:04:35

@bozhidar I was able to M-x setenv and I stopped getting that error. But now I get this error: java.lang.IllegalArgumentException: No value supplied for key: boot clojure.lang.ExceptionInfo: No value supplied for key: boot line: 5

prikshet2117:04:43

@bozhidar Attached is the full error.

prikshet2117:04:19

Could the error be because I changed the cider-boot-parameters according to that very old documentation?

prikshet2117:04:43

If that's the case, then I don't know how to get the default value back.

bozhidar17:04:00

Maybe. Not sure what you changed exactly.

prikshet2117:04:42

I did M-x customize-variable cider-boot-parameters

prikshet2117:04:57

and changed whatever the default value was to cider repl -s wait. I don't know what the default value was. Do you know what the default value of this variable is?

dpsutton17:04:23

"repl -s -b localhost wait"

dpsutton17:04:54

C-h v cider-boot-parameters should show current and original values

prikshet2117:04:16

Okay, so changing it to this still gives me the same error

dpsutton17:04:37

i'm not suggesting a fix. only pointing out the var's value

dpsutton17:04:01

i don't know how boot works but i see you have 4 year old cider and nrepl deps

prikshet2117:04:01

No I don't. I don't need that deftask cider to run the cider repl. It can be deleted and the repl should still run.

dpsutton17:04:55

can you start the repl from the command line without CIDER?

prikshet2117:04:57

actually that doesn't work either, i.e., boot repl, gives the same error

dpsutton17:04:07

then CIDER can't bandaid over that

prikshet2117:04:13

that boot.core :as boot dependency was causing this issue

prikshet2117:04:12

Is there a way I can change the init-ns in the boot repl like one does in lein with :repl-options {:init-ns foobar}?

prikshet2117:04:46

Like for example, I have this user.clj file that has a nice function (def go reloaded.repl/go) that starts the server

dpsutton17:04:50

i believe the others work because lein allows you to specify this. CIDER just invokes the build tooling for you. so if boot allows this then it should work

dpsutton17:04:02

user.clj should be loaded when you start

dpsutton17:04:14

so you you should be able to just call (go)

prikshet2117:04:16

No, it boot.user is loaded

prikshet2117:04:36

even when I change the repl's namespace, I still can't call (go)

prikshet2117:04:48

java.lang.RuntimeException: No such var: user/go

dpsutton17:04:02

oh. boot is cray cray.

dpsutton17:04:14

is user.clj on the classpath?

prikshet2117:04:36

user.clj is in dev/ . Does that mean that it should be in the :resource-paths #{"src" "dev"} in the boot config?

prikshet2117:04:50

that didn't work though

dpsutton17:04:07

i think you're just in a spot where you need boot help. try #boot? I've used boot twice 😕

prikshet2117:04:27

Seems pretty empty in there

dpsutton17:04:22

you could try #clojure then. but it seems to be just me in here and i have no idea how to help on this part of the problem