Fork me on GitHub
#boot
<
2016-08-30
>
alandipert03:08:55

we'd like to host a hangout on wed. at 1:30pm EST to discuss https://github.com/boot-clj/boot/issues/486

alandipert03:08:14

in particular micha and i have a rough plan to add a backward-compat exception/notification subsystem that we'd love feedback on

Chris Bidler03:08:44

I’m still having a strange problem with boot and gpg-agent on OS X that I am not having much (any) luck with on the googles - I have an agent set up to decrypt my ~/.lein/credentials.clj.gpg at need, and in ~/.boot/profile.boot I have the configure-repositories! impl from the wiki that used to work fine like two days ago

Chris Bidler03:08:57

now, however, when I fire up boot repl I get a stack trace about ‘Inappropriate ioctl for device’ until such time as I exercise the gpg-agent “directly” in a shell session. Then, at least until gpg-agent expires my “login”, boot repl works fine

Chris Bidler03:08:03

it used to be the case that when gpg-agent wanted my private key passphrase, boot was able to ask for it (even inside a CIDER repl session, much to the horror and inevitable M-x redraw-display of the emacs window)

Chris Bidler03:08:55

I moved some project dependencies around but afaik I didn’t touch anything directly involved with the gpg -> creds -> fetch deps pipeline so I am at something of a loss as to what to un-break

Chris Bidler03:08:16

anyone seen something like this or know what I’m doing wrong/failing to do?

micha03:08:31

first thing to check is does gpgp -d /path/to/encrypted/file.gpg work?

micha03:08:42

at the command line

micha03:08:53

if not then there are issues outside of boot that need to be fixed

Chris Bidler03:08:58

yeah it does, that’s in fact what I do to “warm up” the gpg passphrase cache

micha03:08:13

how long is your cache timeout?

Chris Bidler03:08:20

specifically gpg --quiet --batch --decrypt ~/.lein/credentials.clj.gpg

micha03:08:25

like when it fails do you get the prompt for passwords again?

Chris Bidler03:08:03

not within boot, but if I drop out of the repl/kill my emacs session and issue that command again, I get prompted again, and then I’m good for however long my cache timeout is

Chris Bidler03:08:18

less than an hour, long enough that it’s annoying to lose my place hehe

micha03:08:21

it could be the way you configure it to ask for passphrases

micha03:08:25

(the agent)

micha03:08:33

there are different mechanisms

micha03:08:55

it could be that the one your agent is using needs a terminal or something

micha03:08:11

and emacs isn't providing what it needs

micha03:08:12

pinentry-program is the thing to google maybe

Chris Bidler03:08:21

well, to be clear, this shows up running boot repl in a session where the gpg agent hasn’t gotten the passphrase yet just at the terminal

Chris Bidler03:08:29

doesn’t have to be in emacs

Chris Bidler03:08:01

but I will look at pinentry-program; maybe I can get something better than the ncurses-y ugliness I have now

micha03:08:16

there is an alternative, i don't know if i mentioned it

micha03:08:32

i make a file with env vars in it, and encrypt that

micha03:08:59

export FOO_USER=omgme
export FOO_PASSWORD=omgsecret

micha03:08:17

then if i save that at like ~/.stuff/secret.sh.gpg

micha03:08:38

i can do eval "$(gpg -d ~/.stuff/secret.sh.gpg)" in my shell

micha03:08:54

then my credentials setter upper just reads env vars

micha03:08:34

eliminates the agent from my workflow

Chris Bidler03:08:17

hm, that’s a good trick

Chris Bidler03:08:57

I got my more-gears-and-dust way working too though - turns out that there is a GUI pinentry client in homebrew, it’s just not the default

Chris Bidler03:08:25

so now I get a nice popup and presumably don’t break my emacs window, though I’ve only tested so far with boot repl in the terminal

Chris Bidler03:08:49

pinentry-program was the right hash key for Google, led me right to some github docs

Chris Bidler03:08:58

so again, I am in your debt.

micha03:08:30

awesome! 👍

micha03:08:49

i spent a while fixing that agent stuff in ubunto, and now i forgot what i did

flyboarder03:08:43

@alandipert: I'd attend the meeting :)

alandipert03:08:29

the basic idea is to add a field to the fileset that contains an atom that contains a vector, and when exceptions are throw or boot.util/{warn, error} are called things are added

alandipert03:08:52

then in the boot function we add a combinator that wraps tasks with machinery for propagating the "errorset"

alandipert03:08:33

i come dangerously close to forgetting about what we came up with

micha03:08:35

we should write it down before we forget

micha03:08:48

lol i was jus tthinking that

alandipert03:08:05

the atom thing was the final result but i don't remember much of our thinking that led us there

micha03:08:12

oh right, yeah

micha03:08:16

i remember now

alandipert03:08:36

i remember we got there because we want backward compat, so we'll have a macro/atom thing to capture stuff

alandipert03:08:44

then at the end of the task we tack on the things that happened

micha03:08:48

also each step in the pipeline needs its own atom

micha03:08:00

but that atom will contain the things from pervious steps

micha03:08:12

so it can add to them without mutating the preceeding steps environment

micha03:08:25

and then the final one percolates back with the returned fileset

micha03:08:06

ok yeah i think i remember now

alandipert03:08:10

do you remember why we needed the atom? and couldn't just add ot fileset

micha03:08:19

because you want to add to the log

alandipert03:08:22

like we definitely need the atom for the capture part

micha03:08:31

you can't create new filesets, because things need to keep references

micha03:08:45

you'd need to replace filesets with new ones, but the logger can't do that

micha03:08:57

so you need something mutable to act as a log that can be appended to

alandipert03:08:06

it's a write barrier kinda

alandipert03:08:14

like it needs to have the same semantics as logging

alandipert03:08:23

man that would have sucked so much if we forgot

micha03:08:35

haha it was a carefully constructed house of cards

micha03:08:48

a little breeze just blew by

micha03:08:32

luckily between both of our brains we can keep some things around

pesterhazy13:08:10

Anyone have an idea why visualvm might not work for me? If I call a fn from the repl, attach to the boot process and try the "profiling" tab, it says "0 methods instrumented" and doesn't return any results.

pesterhazy13:08:06

(not sure this is actually boot-related, but it might be)

Tim16:08:21

is cursive going to add native support for boot at some time or perhaps would they accept a PR to do so?

kenny17:08:04

@tmtwd He wants to add support for it but it is a pretty big change. No PRs because Cursive is closed source. The relevant issue is here: https://github.com/cursive-ide/cursive/issues/692

Chris Bidler18:08:58

here’s that man again, with another weird question - I’m running boot-logservice just inside a repl in boot.user, with two appenders configured: CONSOLE (what you’d expect) and SYSLOG_TLS that uses a third-party appender class to attempt to send logs to Papertrail. When I (log/debug “hi”) for example, my CONSOLE logger logs to my nrepl server window as you’d expect, but SYSLOG_TLS reports

WARN  boot.user - TCP logging test
TCPNetSyslog: DOWN (org.productivity.java.syslog4j.SyslogRuntimeException: java.net.ConnectException: Connection refused)
and tcpdump listening for the port it should be sending on records no traffic

Chris Bidler18:08:59

do I have to do something special to allow for code executing inside a pod “see out”? As usual, I have attempted to consult the oracle and come up mainly with docs I’ve already read which do not address this issue, or stackoverflow questions about unrelated things from 2012 or 2013

Chris Bidler18:08:05

also: I can telnet to the Papertrail host/port in question from a terminal just fine, and I do see data in tcpdump output from there

micha18:08:53

pods are only different classloader heirarchies

micha18:08:07

there shouldn't be any issues with networking

micha18:08:32

are you sure the logger is trying to send its packets to the right place?

Chris Bidler18:08:20

That is reassuring and tracks with my understanding of what a pod "is"

Chris Bidler18:08:38

But you never know! Could be a VM under there! 😄

micha18:08:44

with loggers though it's possible that the classpath is causing it to configure itself differently

micha18:08:11

those things do various kinds of unsavory sniffing around in the classpath

micha18:08:41

so if an errant config file ends up on the classpath, or something doesn't end up there, the logger configures itself differently

micha18:08:17

i recommend adjusting your /etc/hosts file to direct papertrail to localhost

micha18:08:26

and use nc to start a server you can see

micha18:08:50

then your program should try to connect to your netcat server

Chris Bidler19:08:02

I'm as sure as I can be, the host and port are actually in the logback.xml config of the appender, and I both dug out the actual XML boot-logservice emits and sent it to the appender author (who said it looked right) and also proved it was reading it by breaking my log-config def and seeing the class fail to load

micha19:08:13

but i suspect that it's not connecting to the right place, and you won't see anything with netcat

Chris Bidler19:08:33

Just hearing from the horse's mouth that pods don't have any networking necromancy tucked away under the hood is enough to satisfy me that it's a problem with the custom log appender

micha19:08:33

i mean connection refused means either papertrail is down or it's actually trying to connect to somewhere else

micha19:08:58

well it seems to 🙂

Chris Bidler19:08:01

I shall investigate non-boot components further

micha19:08:28

haha 👍

kenny22:08:21

Is there an easy way to get all of the task options in a map?

kenny22:08:17

Inside the task ^

kenny22:08:08

Something like?

(core/deftask my-task
  [f foo VAL str "a foo"]
  (println *task-options*))

kenny22:08:30

Ah, thanks

talios23:08:18

hola - quick question re: boot and deploying - https://github.com/boot-clj/boot/wiki/Repository-Credentials-and-Deploying doesn’t seem to mention anything about adding arbitrary additional files with different classifiers to nexus… any one got a quick pointer ( maven guy here, helping out coworker )

micha23:08:04

what are you wanting to do?

talios23:08:04

as part of the build, we generate RPM files which we want to also deploy to our internal nexus. under maven this is quite simple, and I also handle it inside our mojos. but can’t spot anything obvious for boot - I assume I need to modify some fileset list or something?

talios23:08:24

we tend to add the RPMS under a different classifier from the main artifact.

micha23:08:41

boot uses the Aether library, via Pomegranate

micha23:08:12

let me check one sec

talios23:08:59

looks like pomegranate’s install only handles jar files or the pom file.

micha23:08:22

the "artifact map" can handle other things, i believe

micha23:08:47

there is an example in boot code of doing this

micha23:08:59

looking for it

talios23:08:57

mmm, cool cool - I think I can work with that.

talios23:08:07

just assoc with my desired values.

micha23:08:08

i really don't have a good understanding of the Maven workflows

micha23:08:34

if you have ideas about how to make the built in tasks better that would be welcome

talios23:08:48

that’s a good pointer tho.

micha23:08:23

in boot that namespace is in a pod

micha23:08:28

in the "worker" pod

micha23:08:43

you can get to it with boot.pod/with-eval-worker

talios23:08:52

will do. been a while since I’ve delved into clojure itself, and have been asked to look at boot often ( i did clojure-maven-plugin back in the day ).

micha23:08:19

like

(boot.pod/with-eval-worker
  (require '[boot.aether :as aether])
  (aether/install ...

micha23:08:13

i'm really missing the high level understanding of how all these artifacts work in Maven

micha23:08:51

oh btw, if you want to have a repl in the worker pod you can get one: boot repl -P worker

talios23:08:55

nod I’ll work thru this with our clojure guy I’m helping, and if I can report back anything to improve docs, or just write up a blog post will do so.

micha23:08:21

that would be awesome, thanks