Fork me on GitHub
#boot
<
2015-08-19
>
avery01:08:41

Am I missing something with aot + boot? Cloning https://github.com/adzerk-oss/boot-uberjar-example and running boot repl + (require ‘my-namespace) throws java.lang.RuntimeException: Unable to resolve symbol: my-namespace in this context

avery01:08:03

With boot aot -a repl it works, but do I always need to aot before running a REPL?

micha01:08:34

it's because of the :gen-class i think

avery01:08:44

Aye, removing it makes require work fine.

alandipert01:08:47

i think something is eating your quote

alandipert01:08:03

the quote on 'my-namespace' that is

avery01:08:30

It should just be the normal (require 'my-namespace)

avery01:08:22

I ask because I’m experiencing the same issue in a different project. Wondering if perhaps a “launch” ns would be more expedient and avoid this issue.

alandipert01:08:57

what does this do? boot repl -e "(do (require 'my-namespace) (println (resolve 'my-namespace/-main)) (System/exit 0))"

alandipert01:08:42

it feels like a tooling issue, as the error message you showed is that for any unbound symbol

avery01:08:28

tmp/boot-uberjar-example ✪ ▸ boot repl -e "(do (require 'my-namespace) (println (resolve 'my-namespace/-main)) (System/exit 0))" nREPL server started on port 61349 on host 127.0.0.1 - <nrepl://127.0.0.1:61349> REPL-y 0.3.5, nREPL 0.2.8 Clojure 1.6.0 Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26 Exit: Control+D or (exit) or (quit) Commands: (user/help) Docs: (doc function-name-here) (find-doc "part-of-name-here") Find by Name: (find-name "part-of-name-here") Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Examples from http://clojuredocs.org: [clojuredocs or cdoc] (user/clojuredocs name-here) (user/clojuredocs "ns-here" "name-here") clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: my-namespace in this context, compiling:(my_namespace.clj:1:1) java.lang.RuntimeException: Unable to resolve symbol: my-namespace in this context #<Namespace user> Error loading namespace; falling back to user nil user=>

alandipert01:08:15

is that in boot-uberjar-example or the project you're seeing the issue in?

alandipert01:08:29

curious because that prints out #'my-namespace/main for me

alandipert01:08:45

can you do ye olde boot -V?

avery01:08:07

boot-uberjar-eample. I’m on BOOT_VERSION=2.1.2

avery01:08:15

Boot App Version: 2.0.0-pre14 though, is that right?

alandipert01:08:28

ah, that might be it - you should upgrade your boot.sh

alandipert01:08:41

you want app version 2.2.0

avery01:08:02

Standard wget .. chmod .. mv? Or is there a command for that?

alandipert01:08:16

it's in homebrew now, if you're on mac

alandipert01:08:28

blow away your existing install and brew install boot-clj and you should be good to go

avery01:08:32

FYI, straight up brew install boot-clj requires a boot -u afterwards (it is just 2.0.0 for BOOT_VERSION to start)

avery01:08:05

With everything at 2.2.0 it works. With the as-installed brew version, it was the existing behavior I was seeing.

alandipert01:08:11

good call, i think that's probably because you had an existing $HOME/.boot/boot.properties

alandipert01:08:36

yes unfortunately the 2.2.0 core isn't compatible with pre-2.2.0 App

alandipert01:08:41

a mistake we won't make again moving forward

avery01:08:58

Ahh, haha. Let me just double check this with my project.

avery01:08:55

Thanks for the troubleshooting help. I’m headed off.

alandipert13:08:30

@avey_q: hm, maybe fiddle with BOOT_JVM_OPTIONS? or see if they set JAVA_OPTS

alandipert13:08:04

have you contacted them yet about it?

avery13:08:02

Not yet, I’ve played with JAVA_OPTS in a previous go, but I will try fiddling with BOOT_JVM_OPTIONS for a bit. Haven’t contacted them yet.

avery13:08:29

BOOT_JVM_OPTIONS seems to have done the trick. Thanks!

alandipert14:08:04

@avey_q: care to add what you set it to to the JVM options wiki page? thanks in advance!

danielsz15:08:49

@micha You're talking at Clojutre!

danielsz15:08:58

@alandipert: Are you going as well?

alandipert15:08:31

@danielsz: unfortunately no

danielsz15:08:41

I'm in Europe at the moment, and I really would like to go. But it depends on the costs involved. I have to calculate how expensive that is going to be.

danielsz15:08:23

@martinklepsch: You're talking as well! Well done. Are you flying, going by train?

danielsz15:08:54

@juhoteperi: Are you aware of tips to keep the costs down when going to Clojutre?

martinklepsch15:08:58

@danielsz: where are you currently?

danielsz15:08:08

I'm in Paris.

danielsz15:08:18

Je suis à Paris.

juhoteperi15:08:28

Not sure if Ryanair is currently flying directly to Tampere (and from where)

danielsz15:08:42

Is there going to be a huge airbnb for all the attendees? (giggle)

danielsz15:08:03

@juhoteperi where are people going to stay?

danielsz15:08:15

hotels, campings, airbnb I suppose

martinklepsch15:08:23

@danielsz: @micha and @raywillig are planning on sharing one (afaik). I already booked one for me and my girlfriend

juhoteperi15:08:35

http://www.omenahotels.com/ Is relatively cheap hotel chain

martinklepsch15:08:15

There are a bunch of 60€/night houses on airbnb that can accomodate 3+ people

danielsz15:08:32

Oh, that sounds reasonable.

juhoteperi15:08:33

I guess cheapest way to get from Helsinki airport to Tampere is by bus

martinklepsch15:08:55

we’re also flying to helsinki fwiw

raywillig15:08:05

@juhoteperi: there's also a train, right?

martinklepsch15:08:31

yeah, many more flights, train/bus is cheap

danielsz15:08:09

Why not fly directly to Tampere?

martinklepsch15:08:04

I think helsinki with return was 90p.p. whereas Tampere was like 150 simple_smile

danielsz15:08:25

@martinklepsch: Ah, so that's it. I understand.

martinklepsch15:08:30

@danielsz: any plans to visit Berlin?

juhoteperi15:08:37

There’s train station at Helsinki airport now and it’s 1h 30min to 2h with 1 transfer to Tampere. Looks like prices are from 18e to 30e.

danielsz15:08:46

@martinklepsch: Actually, I might absolutely do that.

martinklepsch15:08:55

sweet! depending on when you’d come I might have a spare room as well simple_smile

danielsz15:08:09

@martinklepsch: Thank you, that is very kind of you. I'll definitely let you know as soon as I make my plans.

danielsz15:08:00

@juhoteperi Are there many Bromptons in Tampere?

danielsz15:08:22

I tend to bring mine everywhere I go. Is it a bike-friendly place?

juhoteperi15:08:49

Don’t know about Bromptons. There are city bikes which I think are available to tourists.

danielsz15:08:32

It folds into a luggage piece. So it goes with you on the train/plane/bus

juhoteperi15:08:45

#C08BDAFEE channel is probably better place for planning

danielsz15:08:35

Oh, sure. Sorry.

alandipert15:08:08

@danielsz: that bike looks cool. it is very i light i presume?

micha15:08:53

"Brompton"

micha15:08:07

that sounds like what we call what i did last night

danielsz15:08:46

@micha: Haha. What did you do last night?

danielsz15:08:09

@alandipert: It's the best thing ever, but it's not particularly light. 12kg.

danielsz15:08:03

@alandipert: It's British engineering. But it's available in the US.

danielsz15:08:33

@alandipert: You should have Adzerk buy one for each employee.

alandipert15:08:39

it somehow looks very british

alandipert15:08:43

pennyfarthing-esque

danielsz15:08:28

@alandipert: Haha. I think I see what you mean.

danielsz15:08:01

@alandipert: althought the wheels are identical, small 16″ diameter

onetom15:08:40

someone once said that > Brompton is the Apple of foldable bikes

micha16:08:54

and apple is a bicycle for the mind

onetom16:08:04

it's not very light, but u can have small wheels attached to its package carrier, so when u fold it, u can just roll it on those by pushing it via the saddle

danielsz16:08:22

onetom: I can see why. Mine has trodden in Lamma island.

onetom16:08:53

micha: i wanted to say something like: > Brompton is the Hoplon of foldable bikes but without the previous saying it wouldn't have made much sense simple_smile plus im not sure how much do u actually value apple stuff..

micha16:08:40

the "bicycle for our minds" quote is amazing

micha16:08:49

they really are

danielsz16:08:10

@onetom I'm not a native English speaker, so I might misuse the word. I meant trodden as in it has set foot on. http://dictionary.reference.com/browse/trodden

juhoteperi16:08:10

I thought I could learn to tolerate Apple/OS X by using Macbook for some time

juhoteperi16:08:12

Didn’t work 😄

micha16:08:33

i'm really happy with my x250 so far

juhoteperi16:08:01

My X220 broke few weeks ago so I got a Retina Macbook but I can’t install Linux on this thing and I hate the design of the machine also

micha16:08:26

i just don't like OSX, the machines are nice

onetom16:08:26

@juhoteperi: u just had a shitty teacher or no teacher at all... apple is not that bad and im saying this after trying all existing window managers for linux 😉 it's not great either, i agree

danielsz16:08:28

@juhoteperi: linux doesn't install on that one?

juhoteperi16:08:47

Glossy display and sharp front corner especially bother me

juhoteperi16:08:04

@danielsz: Nope, this is the latest version. Few months old.

micha16:08:19

that's osx

juhoteperi16:08:21

Suspend doesn’t work. WIFI works but not out of box, some problems with keyboard layout.

micha16:08:26

a backwards bicycle for your mind

juhoteperi16:08:53

But I found an used X220 from net and I’ll be getting that next week 😄

juhoteperi16:08:18

@onetom: Have you tried i3 wm? It’s my favorite

micha16:08:25

a colleague of mine has an x230, really nice machine

micha16:08:41

old style keyboard and all

juhoteperi16:08:53

X230 has the new keyboard

onetom16:08:03

@juhoteperi: my favourite was evilwm, but as far as i remember i3 is a bit better simple_smile

danielsz16:08:09

@juhoteperi: I installed linux on a macbook air with i3wm and Emacs and that's about it. Best machine ever?

juhoteperi16:08:42

I thought about getting X250 but the new low voltage processors are not even as performant as 4 year old i7 so doesn’t seem like a good deal

juhoteperi16:08:03

And I could have bought used X230 but my existing batteries wouldn’t be compatible

micha16:08:04

her x230 doesn't have chicklet keys

micha16:08:34

it has awesome real keys, including all the function keys and prtsc etc

juhoteperi16:08:15

Could be x220 keyboard in x230, I hear that’s possible.

micha16:08:31

actually i'm probably just confused

micha16:08:07

ah right, it's an x220

micha16:08:11

nevermind!

micha16:08:22

less x's but better keyboard

juhoteperi16:08:52

Looks quite hip but I prefer having gears 😄

micha16:08:13

a bicycle with no gears or brakes for your mind

martinklepsch16:08:29

@micha: man that backwards bicycle video is amazing

micha16:08:03

i know! that guy is the best

martinklepsch16:08:24

> a bicycle with no gears or brakes for your mind I’m crying 😄

danielsz16:08:16

@micha Truly remarkable experiment in that video.

juhoteperi16:08:00

Hmh, bootstrap is moving to SASS 😕

onetom16:08:38

@juhoteperi: reason? any url on the topic?

onetom16:08:29

yeah, the bike is quite hip indeed. i know quite a lot of people on lamma, but with this bike even more people start talking to me simple_smile

juhoteperi16:08:59

Maybe it’s possible to use Sass through JNA bindings from Java

juhoteperi16:08:32

I’ll have to check if it’s possible to provide alternative import handler so that it could search for files in Java classpath

juhoteperi16:08:21

If it libsass can be properly used from Java there’s a good chance it would be faster than less4j

alandipert17:08:12

i hae some WIP on running sass gem in a pod for boot-sassc (which currently shells out)

juhoteperi17:08:36

Ruby Sass is the old version? Or maybe it’s up-to-date

juhoteperi17:08:56

But shelling out makes it hard to support importing files from classpath and such

avery17:08:29

@alandipert: Added note to https://github.com/boot-clj/boot/wiki/Configuring-Boot. Can you check the wording suits your fancy.

martinklepsch17:08:28

idea: we could add little emoji things next to well written/important wiki entries to highlight them

micha19:08:12

that's the class name

micha19:08:35

we'd have to change the name of the class though, which would be a breaking change

micha19:08:40

or make a wrapper maybe

micha19:08:18

have boot.Boot.main() delegate to boot.App.main() perhaps?

martinklepsch19:08:07

breaking change as in new binary?

micha19:08:12

unless there's a way to put some kind of info in the jar or in the java command options?

micha19:08:28

well new binary and not compatible with older libraries

martinklepsch19:08:23

added it to the 3.0.0 milestone

micha19:08:04

yes they should be

micha19:08:21

1.8 doesn't even have a permgen

martinklepsch19:08:36

@micha: an ideas why this may happen then?

micha19:08:07

boot must be using a different java somehow?

martinklepsch19:08:46

jdk-8u51-macosx-x64.dmg is the only thing I installed and looks right

juhoteperi19:08:08

user=> (System/getProperty "java.runtime.version")

micha19:08:53

you can do it from boot repl, too

micha19:08:07

the jmx thing can tell you jvm info like that

martinklepsch19:08:13

"1.7.0-u60-unofficial-b30"

juhoteperi19:08:36

there's some command on OS X you can use to change default jre

juhoteperi19:08:17

just having proper java binary first on the path might not be enough as JAVA_HOME can point elsewhere

micha19:08:51

this would be good to have in the wiki 😉

martinklepsch19:08:53

~ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home

martinklepsch19:08:56

el capitan, lots of strange things

martinklepsch19:08:18

will try installing from a freshly downloaded dmg

martinklepsch19:08:54

crazy. still:

~ set -x JAVA_HOME (/usr/libexec/java_home -v 1.8.0_60)
~ boot repl
nREPL server started on port 55088 on host 127.0.0.1 - 
REPL-y 0.3.5, nREPL 0.2.8
Clojure 1.7.0
OpenJDK 64-Bit Server VM 1.7.0-u60-unofficial-b30
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from : [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (System/getProperty "java.runtime.version")
"1.7.0-u60-unofficial-b30"

martinklepsch20:08:38

I’m out of ideas 😄

juhoteperi20:08:23

BOOT_JAVA_COMMAND?

martinklepsch20:08:52

does this exist?

micha20:08:42

BOOT_JAVA_CMD

micha20:08:37

that's not intended to mean rtfm, it's just to show where the env vars are listed

martinklepsch20:08:30

ah sweet, I just had the wiki page opened so somehow thought this might be the only place, but you’re right- awsome help texts exist simple_smile

martinklepsch20:08:58

@juhoteperi: are two cljs tasks with different :ids sets still allowed in master?

martinklepsch20:08:03

the second build doesn’t even require core.async fwiw

martinklepsch20:08:07

@juhoteperi: when just running with boot cljs everything compiles fine.

juhoteperi20:08:01

Why do you want to run those in separate tasks?

juhoteperi20:08:09

It should work though

martinklepsch21:08:55

@juhoteperi: different optimization modes + settings

juhoteperi21:08:39

Ahmmm, there's not reason why that wouldn't work with one task... it's just not implemented now

juhoteperi21:08:47

different settings work

juhoteperi21:08:56

but optimization is only task setting currently

martinklepsch21:08:32

yeah, I can stuff all things in edn files but then for prod/dev I’d need to modify those files manually

malcolmsparks21:08:58

@martinklepsch: this might be completely out-of-context, but there are some tricks you can do with edn that avoid having to hack them manually - there are some examples here: https://github.com/juxt/aero

juhoteperi21:08:31

@martinklepsch: Test project would be helpful

martinklepsch21:08:07

seems to have no correlation to dependencies used

juhoteperi22:08:14

cljs verbose output helps...

juhoteperi22:08:24

The first cljs task adds output files to fileset as resources so the seconds task sees those

juhoteperi22:08:34

But why does cljs try to compile them...

martinklepsch22:08:12

because it looks for all .cljs files?

juhoteperi22:08:26

Cljs looks for all .cljs files in input folders

juhoteperi22:08:50

And now we pass all tmp-dirs in fileset to cljs compiler

juhoteperi22:08:13

We could maybe filter out directories created by other cljs tasks....

juhoteperi22:08:38

I don't think that's very neat solution but I can't think other fixes now

martinklepsch22:08:38

maybe add the :output-dir in a different role than the ones in input-files?

juhoteperi22:08:57

Yeah that would fix it

juhoteperi22:08:23

But I'm thinking something is probably depending on those files being available as input files

martinklepsch22:08:06

you mean for caching/fast incremental builds?

juhoteperi22:08:36

No, I mean some other tasks which want's to read the js files

juhoteperi22:08:52

@micha: Can you think of any reason why adding cljs output files to fileset as asset files would be a bad idea?

juhoteperi22:08:28

They don't need to be on classpath at least

micha22:08:04

@juhoteperi: hmm, an interesting question

micha22:08:22

we can try it

juhoteperi22:08:41

I wonder what happens if boot-cljs tries to do e.g. 20 cljs builds parallel 😄

juhoteperi23:08:40

I did a release of boot-cljs as everyone was already using the new version 😄

micha23:08:16

@juhoteperi: i think ultimately asset-paths is the wrong thing to use here

micha23:08:42

like i've been thinking about experimenting with separating the google closure step into a separate task

micha23:08:08

i think it's a problem with the cljs compiler really

micha23:08:25

but i think it's the best solution for now

micha23:08:47

another option would be to run multiple cljs tasks in parallel via a helper function

micha23:08:57

so they all get the same input

micha23:08:07

and their output filesets are merged when they're done

juhoteperi23:08:11

We could mark the directories created by cljs task and filter them out in other cljs tasks

micha23:08:27

oh yeah, that's a good point

micha23:08:31

that's maybe the best solution

micha23:08:41

because it would only have to know about its own things

juhoteperi23:08:48

But what would be best way to do the marking? Dot file in root of dir?

micha23:08:49

genius, i like it

micha23:08:03

or could be fileset metadata

micha23:08:18

maybe meta on the fileset object itself

juhoteperi23:08:32

Oh right that should at least work

micha23:08:48

i'm not sure if meta is preserved across add-resource etc

juhoteperi23:08:59

I was thinking fileset metadata but it should be filepath -> metadata so I'm not sure if that would work?

micha23:08:15

why filepath?

micha23:08:31

i see, yeah

micha23:08:45

meta on the files themselves would work

micha23:08:03

i did experiments with that, you can do it on the command line with the sift task even

juhoteperi23:08:13

on what files?

juhoteperi23:08:08

tmp-dirs themselves don't have TmpFile records, I think?

micha23:08:42

no, it would have to be on the files

micha23:08:52

it's just assoc'ing onto maps though

juhoteperi23:08:54

That would make it complicated

micha23:08:56

so should be very fast

juhoteperi23:08:15

Cljs compiler only takes list of dircectories

micha23:08:55

we can filter the fileset to get a new fileset, then commit! that, perhaps

micha23:08:28

then at the end we can add the files produced by cljs to the original fileset

micha23:08:33

and commit! again

juhoteperi23:08:02

hm currently boot-cljs uses core/get-env :directories to get list of directories

juhoteperi23:08:13

should probably use core/input-dirs instead?

micha23:08:21

why does it need directories?

micha23:08:43

cljs compiler should get all the namespace source files from the classpath

juhoteperi23:08:59

Cljs compiler needs list of all dirs where cljs sources can be found

micha23:08:08

lol really?

micha23:08:38

but it also redundantly looks on the classpath

micha23:08:52

so you need to keep directories and classpath coupled

juhoteperi23:08:58

It somewhat works without, but breaks is some cases as it won't notice that some files changed

micha23:08:08

you can't win

micha23:08:32

that's just abusive

micha23:08:44

as our friend would say

micha23:08:01

well we are making pods anyway

micha23:08:19

so we can mock more nonsense for their coconuts i guess

micha23:08:53

the coconuts are piling up too high lol

micha23:08:15

i think we just don't support this chaining of cljs tasks until that gets fixed in cljs

micha23:08:57

wait, why wouldn't the fileset thing work?

micha23:08:12

the directories would still be reflecting what we want

juhoteperi23:08:14

I'll ask David when he get's back if there's real need to list all dirs or just the one with main ns

micha23:08:16

so we could still pass those

micha23:08:40

(let [fileset' (->> fileset (remove-when-meta [::cljs]) commit!)]
  (do-cljs-compiling (input-dirs fileset'))
  (->> fileset (add-compiled-with-meta tmpdir ::cljs) commit!))

micha23:08:44

something like that?

juhoteperi23:08:29

would add-compiled-with-meta just add metadata directly to fileset object?

micha23:08:02

it would add the files in tmpdir to the fileset and on each thing it adds it will put meta

juhoteperi23:08:32

input-dirs doesn't list the dir if there are no files in the dir?

micha23:08:33

the main thing is the first commit! at the top of the let

micha23:08:46

input-dirs is fixed for any fileset

micha23:08:57

unless you explicitly mess with them, which you shouldn't

micha23:08:12

they are fixed for all time as far as boot is concerned

micha23:08:33

input-dirs has no relation to source-paths or resource-paths

micha23:08:46

boot copies files from source-paths etc into input-dirs

micha23:08:55

whch are owned and operated by boot internally

micha23:08:50

input-dirs just gives the "holding" directories

micha23:08:04

the buckets where the actual files associated with the fileset are stored