Fork me on GitHub
#boot
<
2016-08-16
>
flyboarder01:08:40

Is anyone pushing to clojars from circle ci? Do you have signing working?

vikeri07:08:07

Can I exclude nested directories from :source-paths?

vikeri07:08:24

Say I want src but not src/ios

micha11:08:38

@vikeri you can use the sift task to remove files from the file set, or you can make a .bootignore file

vikeri11:08:52

@micha: There only seems to be an --add-source command and no --remove-source

vikeri11:08:06

Or wait, do I use a combination of —inlcude and —invert?

micha12:08:26

yep, that's the one @vikeri

stuarthalloway13:08:40

how do javac classes get on the classpath for subsequent use, e.g. if I need them compiled before I load Clojure files?

micha13:08:44

@stuarthalloway: the class files are added to the fileset

stuarthalloway13:08:20

and the fileset is automagically on the classpath for whatever I do next?

micha13:08:27

should be, yes

stuarthalloway13:08:47

Got it, thanks. if I am using boot just to copy files around (e.g. making an application distro zip) are all those files on the classpath too, even through they are not even Java-related?

micha13:08:12

which files?

micha13:08:41

files in the fileset with the "input" role will be on the classpath

micha13:08:52

that would be the resource-* and source-* ones

stuarthalloway13:08:38

ah, I guess this is where assets come in

micha13:08:44

but there are files in the fileset that do not have the input role, like the asset-* ones

stuarthalloway13:08:55

got it, thanks!

micha13:08:06

there is a table here

pesterhazy15:08:36

I thought that util/dbug should only be printed if I use boot -v my-task, but it looks to be printed even without -v

pesterhazy15:08:09

never mind, I was looking in the wrong place

micha16:08:30

@pesterhazy: that's correct though, util/dbug should only print when you have -v, is that not what you're seeing?

pesterhazy16:08:13

@micha, right it's working as expected, it's just that the same log messages was printed in multiple places

micha16:08:30

ah ok 👍

micha16:08:58

if you have colors enabled it should print the debug messages in cyan

micha16:08:18

different than regular printf or other log level messages

pesterhazy16:08:03

that never worked for me

pesterhazy16:08:46

in macos + iterm2 + solarized-light

micha16:08:07

huh that's not good

pesterhazy16:08:33

(deftask foo
  []
  (u/warn "Warn\n")
  (u/info "Info\n")
  (u/dbug "Debug\n"))

pesterhazy16:08:39

that's all black on my machine

micha16:08:40

i guess it does depend on how your terminal sets its color palette

pesterhazy16:08:04

thought Warn and Info are printed in bold

micha16:08:16

solarized has black colors in it?

micha16:08:23

that's also odd

micha16:08:51

info is bold, warn should be yellow

richiardiandrea16:08:56

I think it is because you might need to set xterm-256color

micha16:08:59

dbug cyan

micha17:08:08

and printf is just normal output

micha17:08:28

error should be red

richiardiandrea17:08:10

yeah below looks right

pesterhazy17:08:00

it's strange.. I swear it works with all other tools, but boot is monochrome with solarized-light

pesterhazy17:08:24

ok so switching the theme to just about any fixes the colors 😞

pesterhazy17:08:44

alright so I'll switch *sigh*

micha17:08:57

i'm kind of disappointed with terminal capabilities in general lately

micha17:08:16

like you can't use unicode in windows console apps

micha17:08:49

unicode seemed like it would be a great thing for making cli output more clear

spieden17:08:04

works great in Terminal.app

micha17:08:24

and colors too, colors seem like a great way to make output more readable

micha17:08:45

it's just a shame if it ends up being a config hassle

oahner17:08:48

there's ansicon for that on Windows

micha18:08:06

ah i hadn't heard of that

oahner18:08:52

it makes cmd.exe handle ansi escape sequences for colors just like every other OS

oahner18:08:54

works great

micha18:08:00

unicode too?

micha18:08:05

that too much to ask

oahner18:08:14

you can use cp65001 for that

oahner18:08:25

not sure if it handles all the unicode range properly tho

oahner18:08:28

lemme check

pesterhazy18:08:30

I agree, such a shame that you still get so many terminal problems, even with popular emulators

micha18:08:52

the command line is ideal for so many things

micha18:08:04

displaying output though is the difficult part

micha18:08:16

gui apps are the opposite

oahner18:08:38

it's a pretty different culture in the windows world, devs love their GUIs

pesterhazy18:08:01

I've always thought that it would be great to have a "companion browser window" that accompanies a clj repl

micha18:08:17

man i wonder if that's a possibility for windows?

pesterhazy18:08:17

basically an additional window that you can output hiccup to

oahner18:08:24

I'm at a windows shop and every other dev looks at me funny when I mention the console

micha18:08:38

maybe we can make a gui app that wraps the boot cli tool?

micha18:08:47

for windows?

alandipert18:08:04

buildings forms based on the task DSL, into it

micha18:08:11

we already make a legit exe with launch4j

oahner18:08:20

not really sure that would help much, a better entry point would be IDEs

oahner18:08:53

cursive, eclipse, build boot support into that

micha18:08:17

ah yes, on that note i've been looking at the gradle server, looks like some good ideas can be found in there we could maybe use

micha18:08:47

like IDEs interact with this gradle server that runs all the time

oahner18:08:11

isn't that just basically a REPL?

micha18:08:22

they've done some good engineering work there, like the way it monitors its own health

micha18:08:40

restarts itself if it detects that you're running code in there that's leaking memory

micha18:08:42

things like that

micha18:08:04

i guess maybe that's the next frontier, developing a good API for IDEs and things like that to interact with boot

micha18:08:54

unfortunately i don't really know anything about how visual studio works

oahner18:08:53

it's pretty gruesome

oahner18:08:01

so cmd.exe does support unicode to a certain extend; you can use utf8 through codepage 65001, but it's rather buggy

micha18:08:35

in the show -p output for example, there are unicode x'es and checkmarks

micha18:08:45

makes it very easy to see what's going on

micha18:08:59

but in cmd.exe they look like ?, both of them

micha18:08:04

which is a bummer

micha18:08:24

because writing out selected is not as good

oahner18:08:35

you could try changing the codepage before running it, but in all likelyhood, the font probably don't contain those glyphs anyway

oahner18:08:09

oh but we're getting ubuntu with windows 10

oahner18:08:16

can't wait for that

micha18:08:18

haha is that a real thing?

oahner18:08:22

apparently

micha18:08:24

or is it some kind of scam

micha18:08:35

wow that's pretty sweet then

oahner18:08:05

we'll reportedly get a fully functional bash shell, with all the unix tools that comes with it

oahner18:08:18

hopefully openssh works too

micha18:08:29

i'd consider running windows if i could compute in linux and have the windows hardware support

micha18:08:44

like some kind of full-screen vm situation

oahner18:08:44

well, you can almost do that with cygwin and co.

micha18:08:53

with i3wm and so on

oahner18:08:12

that would certainly be ideal

micha18:08:30

i can't understand why there isn't a company that sells such a machine

flyboarder18:08:26

@micha: Ubuntu on Windows was what I checked out the other day, still hanging in boot

flyboarder18:08:39

@oahner: update to insider preview to get it now

oahner18:08:00

I'm still running windows 7 😉

micha18:08:06

bummer, i guess it was a networking issue? boot trying to download itself or something?

flyboarder18:08:11

I think so, gonna run with -vv right now, and see what it does

flyboarder18:08:49

@micha gets stuck at Running for first time… (blah)

mtnygard18:08:55

I'm running both the Windows Subsystem for Linux and a Mint Linux VM right now. Both are working great.

mtnygard18:08:26

Except I can't run Emacs in the Window subsystem. The console eats Ctrl-space and Ctrl-X.

flyboarder19:08:57

@mtnygard: is boot working for you in Linux subsystem?

flyboarder19:08:38

Maybe it's my win10 vm causing trouble

stuarthalloway19:08:27

what is the idiomatic way to do separate tasks in a project that need totally disjoint filesets?

stuarthalloway19:08:50

e.g. do you temporarily change the source, resource, and asset paths inside a single task?

micha19:08:31

i don't think that will really work

micha19:08:48

because the paths are basically unmanaged global mutable state in a way

micha19:08:00

the only way to manage it is via the boot env construct

micha19:08:19

like (set-env! ... that will coordinate those changes

micha19:08:32

but if you do that inside the pipeline then you run into issues

micha19:08:46

because the pipeline really needs to be reversible in a way

micha20:08:03

the fileset provides that ability to "undo" changes to global state

micha20:08:24

so if you have separate pipelines you can run boot-in-boot

micha20:08:36

that's kind of the heavy option

micha20:08:56

if you want to fork the pipeline it's possible

micha20:08:16

like one task can accept two continuations (the "next-task")

micha20:08:23

and pass filesets to them

micha20:08:33

but which one will control the actual JVM classpath?

micha20:08:40

how do you merge results?

micha20:08:49

how to handle conflicts?

alandipert20:08:20

uber kind of does that with the "mergers" epicycle

alandipert20:08:32

uber task that is

micha20:08:00

you can pass :mergers option to add-resource et al

stuarthalloway20:08:50

so what is the idiom for building something like Clojure where you want to make the Clojure jar but also a zip that has the jar and other stuff in it?

micha20:08:26

you could maybe build the jar in one step of the pipeline

micha20:08:36

the jar would then be in the fileset for the subsequent steps

micha20:08:49

so one of those could make the zip containing the jar plus other things

stuarthalloway20:08:04

yep, that is where I am right now, but all the other stuff that went into the jar is lying around and in the way

micha20:08:17

the sift task could be used to eliminate those or move them around

micha20:08:37

you can also add metadata to files in the fileset

micha20:08:01

the sift task has an option to select files with specified metadata keys

stuarthalloway20:08:23

ooh, that looks cool

micha20:08:44

metadata on the fileset files isn't clojure metadata, it's just extra keys on the TmpFile records

micha20:08:54

you can assoc onto them

micha20:08:19

the sift task also has facilities for adding metadata to files in the fileset

micha20:08:34

but you can probably just use a regex to select the things you want to eliminate

stuarthalloway20:08:58

ok, I am going to play around with that. Thanks!

micha20:08:05

boot show -f could be helpful too

micha20:08:28

you can put the show -f anywhere in the pipeline to see what's in the fileset

mtnygard20:08:23

@flyboarder: Hmm. Boot sat for a long time on "updating to latest" then segfaulted the JVM.

flyboarder20:08:09

@mtnygard: yeah thats what I’m seeing

micha20:08:03

that could happen if it can't download boot.jar and it tries to add it to the classloader perhaps?

micha20:08:37

that's the only reliable way to get a segfault of the jvm that i know of 🙂

Andy20:08:16

Super exciting discussion which makes me curious if the boot is considered for building https://github.com/clojure/clojure 🙂. Sorry for perhaps naive questions, but I feel to ask: q1) "but which one will control the actual JVM classpath?” can JVM classpath change during tasks execution q2) "how do you merge results?” why result has to merge, tasks could build a “tree” rather than a DAG

Tim20:08:58

how can I turn this into a task: boot wait serve -d target watch cljs target -d target Is this correct:

(deftask dev []
 (comp (wait)
       (serve :dir "target")
       (watch)
       #_(cljs :dir "target")
       (cljs :compiler-options {:foreign-libs [{:file "js-shaw/sha3.js" :provides ["js-sha3"]}]
                                :dir "target"})))

micha20:08:09

@tmtwd: looks like you missed the (target :dir #{"target"}) part

micha20:08:25

and sort of merged it into the cljs task options

Tim20:08:35

oh yeah, I see what you mean

micha20:08:16

@tmtwd: you may want to try serving files from the fileset, btw

micha20:08:22

i mean the classpath, sorry

micha20:08:27

instead of from the target dir

micha20:08:49

you can do that by just not providing a :dir option to the serve task

Tim20:08:45

ok thanks: this works:

(deftask dev []
 (comp (wait)
       (serve)
       (watch)
        (cljs)
       (target :dir #{"target"}))))

Tim20:08:09

can’t get this to work though:

(cljs :compiler-options {:foreign-libs [{:file "src/cljs/js-shaw/sha3.js" :provides ["js-sha3"]}]}

micha20:08:10

with this setup you dfon't really need the target task

Tim20:08:24

but I guess that’s a separate issue

micha20:08:53

i recommend using cljsjs instead of foreight-libs directly

Tim20:08:14

I don’t think this library is packaged with cljsjs

micha20:08:16

then it's just a dependency

micha20:08:22

you could package it 🙂

Tim20:08:30

that’s a possibility

Tim20:08:36

good idea

Tim20:08:52

but packaging it would require knowledge of how to use foreign-libs, I imagine

micha20:08:16

there are examples and whatnot, and we can help if you get stuck

Tim20:08:24

can you point me to one?

micha20:08:31

sure one sec

micha20:08:25

the main idea is that you make a jar that contains the deps.cljs file

micha20:08:41

which is the same as the :foreign-libs option in your task there

micha20:08:58

the cljs compiler looks for that file on the classpath to resolve the foreign libs

micha20:08:32

there are lots of packages, that's just a random one

micha20:08:40

the build.boot file there builds the jar

micha20:08:02

you could try to adapt that to your library

Tim20:08:19

I will do that

micha20:08:48

come back if you get stuck

micha20:08:12

@tmtwd: one thing that might be tricky is getting the externs file

micha20:08:27

which you will need if you use :advanced optimizations

micha20:08:52

the one for airbrake is in the repo there, with the .ext.js file extension

micha21:08:01

you'll see all the cljsjs packages have those

micha21:08:30

that file declares various names as external, so the google closure compiler won't munge them

micha21:08:14

your library probably only has a few functions in it, so we can make an externs file from scratch pretty easily if necessary

micha21:08:48

hopefully™

Tim21:08:28

yes, quite a small single file

Tim21:08:27

where is the deps.clj file in the airbrake project?

micha21:08:39

it's generated by the deps-cljs task

micha21:08:51

which is packaged in the cljsjs/boot-cljsjs dependency

micha21:08:30

@happy.lisper: if you have a tree of tasks instead of a pipeline, and the fileset starts to diverge, which one would represent the JVM classpath?

micha21:08:58

you can only have one classpath per pod

Andy21:08:39

I think I see what you mean. Since the final classpath is determined at the end if I understand correctly. And there would be many ends.

micha21:08:02

well consider like the javac task for example

micha21:08:18

when it runs, it could be in the middle of a pipeline

micha21:08:46

the java compiler takes java source that's on its classpath, and writes class files to a directory of your choosing

micha21:08:12

so the tasks that come before the javac task in the pipeline could add things to the classpath that the java compiler could then compile

micha21:08:41

and likewise, after you've compiled your class files, the javac task adds them to the fileset before passing it to the next task

micha21:08:49

so those class files are now also on the classpath

micha21:08:59

so you can load their classes or whatever you want to do

micha21:08:31

the problems arise because JVM things work from the classpath abstraction

micha21:08:40

which is basically global mutable state sort of

micha21:08:54

it's a really useful abstraction, so we don't want to get rid of it

micha21:08:59

we just want to manage it

micha21:08:38

but since it's shared by all of the things in the pod you can only manage it if you make it a pipeline of changes

micha21:08:42

sequential changes

micha21:08:55

vs a tree

micha21:08:44

the tree view sotr of assumes that the leaves can be independent of each other

micha21:08:00

which isn't really the case when they share the classpath and all write to it

micha21:08:03

and read from it

Andy21:08:36

Thx for the explanation, and sorry for underestimating the problem.

micha21:08:08

no not at all, i didn't mean to take that kind of tone

Andy21:08:23

me neither 🙂

micha21:08:25

i just don't know how boot would handle those issues is all

micha21:08:33

not that it's not possible

micha21:08:05

there is a build tool called broccoli i think

micha21:08:08

the emberjs one

micha21:08:20

it uses a tree

micha21:08:29

but they don't have a classpath in js

micha21:08:44

so they're forced to use files everywhere

micha21:08:55

which is i think a serious limitation

micha21:08:03

it's pretty great that the classpath provides a layer of abstraction between the actual resource and the name that you access it with

micha21:08:32

so loading a class from a jar file, from a url on the internet, or from a file in the filesystem is all the same

flyboarder22:08:05

@micha I got further with sudo boot but it’s throwing an error that i cant run as root, even with the env var set

micha22:08:54

@flyboarder: does the root account in the linux environment really have permission to write everywhere?

flyboarder22:08:07

probably not 😛

micha22:08:09

i could imagine there being limitations with the filesystem

flyboarder22:08:12

it’s windows afterall

oahner22:08:26

just for fun, disable the UAC and LUA

flyboarder22:08:37

windows permissions dont apply inside linux

oahner22:08:05

that's... not something I would have expected from microsoft

micha22:08:13

seems kind of like a plus?

oahner22:08:25

I would lean that way

micha22:08:28

can you have crontabs in there?

micha22:08:37

that would be interesting maybe

oahner22:08:40

that article says the cmd.exe's permission level applies to the bash that's spawned from it

oahner22:08:49

try running that cmd.exe as admin?

flyboarder22:08:57

right but not to the linux env inside it, plus im already elevated

flyboarder22:08:46

i think the issue is where boot wants to write it’s self is using the ubuntu user folder and not the mounted windows folder

flyboarder22:08:58

digging for boot env vars

oahner22:08:36

does the ubuntu env have its own home folder and everything?

flyboarder22:08:52

I think BOOT_HOME is what needs to move, yes it does^

flyboarder22:08:27

so i moved all the boot locations to the mounted windows location and still this

micha22:08:08

looks like the env var isn't gettign set

oahner22:08:23

still didn't leave the java part

micha22:08:27

you could try putting it in boot.properties

micha22:08:33

as a test

flyboarder22:08:59

ok ill try that instead

micha22:08:19

are you using the boot.sh or boot.exe?

micha22:08:37

not sure how that would make a difference, but who knows

flyboarder22:08:53

boot.sh in the ubuntu world

oahner22:08:55

boot.exe shouldn't work at all from the linux side, shouldn't it?

micha22:08:03

oh maybe not

flyboarder22:08:14

had to install java into linux first

oahner22:08:32

it didn't pick up BOOT_AS_ROOT=yes... that's weird

oahner22:08:23

this is a long shot but... do env vars defined in the cmd.exe session carry over into the bash session?

oahner22:08:55

maybe export it before starting bash and then try boot again from inside?

oahner22:08:50

nah, no way that could work, surely it keeps both env separated

oahner22:08:15

hold on, your BOOT_HOME points into a folder that's on the windows side

oahner22:08:26

the NTFS permissions could keep it from seeing it?

flyboarder22:08:49

boot.properties seems to get noticed, but it hangs again….., will try with the other env vars moved in properties file when I get back

flyboarder22:08:17

^NTFS is what the elevated powershell is for

flyboarder22:08:26

otherwise possibly

flyboarder22:08:46

im pointing things to windows mount to avoid linux permissions

oahner22:08:54

depends, if ubuntu uses a different user account, it could not have NTFS write on that folder

flyboarder22:08:01

since the file system is obviously restricted

flyboarder22:08:21

ill play more soon 🙂

oahner22:08:30

I gotta hit traffic myself, ciao!

flyboarder23:08:49

yeah just hangs some more, oh well nice attempt microsoft but i’m not holding my breath that this will work soon

micha23:08:04

i wonder if you could use lsof to inspect it when it hangs

micha23:08:37

maybe that will show that it's trying to do things in a weird directory or something

micha23:08:03

or put printfs in Boot.java