Fork me on GitHub
#boot
<
2017-06-02
>
sophiago00:06:06

i don't normally use boot, but am trying for the first time to see if i can buid Nightcode from the jar (i'm on NixOS so this seemed like the most painless way to get it running). i tried boot run Nightcode-2.3.3.jar and after it downloaded a ton of deps from maven i'm getting some clojure errors (i can't tell if this means Nightcode is broken, but the only issue related to building it from the jar is on Windows and unaddressed after three months)

sophiago00:06:02

i may just be going about this the wrong way if i already have a jar i just want to install?

richiardiandrea00:06:52

@sophiago I don't think boot can run jar files that way, you might want to try java -cp

richiardiandrea00:06:20

Ah, unless your run is a custom thing ๐Ÿ˜

sophiago00:06:32

ah, ok. i think i misinterpreted a line on the Nightcode readme that was instead intended to create a jar from source

sophiago00:06:56

Nah, i just need to install this totally unsupported editor for a workshop i'm teaching ๐Ÿ˜›

richiardiandrea00:06:28

Well folks said it's cool so I am curious to see how easy it is to bootstrap ๐Ÿ˜

sophiago00:06:45

you're saying run java -cp on the jar?

sophiago00:06:39

(i'm on OracleJDK fwiw)

richiardiandrea00:06:02

So boot build builds the jar ok...

sophiago00:06:21

well, i just downloaded the jar form their site

sophiago00:06:27

i'm not trying to hack on it ๐Ÿ™‚

sophiago00:06:54

but not necessarily trying to write a nix pkg for something i'm only installing to help students with for two days

richiardiandrea00:06:07

And the main is in core so java -cp ...Jar nightcode.coreshould work

sophiago00:06:03

it can't find the classpath in there

sophiago00:06:15

err *main class

richiardiandrea00:06:53

Ah, try -jar to the java command

richiardiandrea00:06:12

I never remember ๐Ÿ˜€

sophiago00:06:44

it still can't find the main class ๐Ÿ˜ž

sophiago00:06:18

lol, that's the class i'm teaching

sophiago00:06:31

except it's totally decentralized and the nyc one is a mess

richiardiandrea00:06:25

You don't probably need the nightcode.core thing

richiardiandrea00:06:52

And good luck for your teaching, ClojureBridge is awesome!

sophiago00:06:18

i'm guessing the nightcode jar is just broken...

richiardiandrea00:06:48

Well I guess I will quickly try but I am away from keyboard now

sophiago00:06:08

yeah, if you could confirm so i feel okay telling the other teachers it's broken that'd be a huge help!

sophiago00:06:28

fwiw, i just cloned the repo and called boot build on it to see if maybe the jar was just out of date and it gave me that same stack trace i posted above ๐Ÿ˜›

richiardiandrea01:06:15

@sophiago have you tried to download the jar instead of building it?

sophiago01:06:52

@richiardiandrea that's what i tried first. i only tried building a new one with boot when that one appeared broken ๐Ÿ˜•

sophiago01:06:53

but i'm not sure if it's distro specific, so if you do just happen to have the time to try and launch the jar on their site that would be a huge help (I'm assuming you're at least on Debian/Redhat/OSX or similar)

richiardiandrea01:06:54

Yeah I am on Ubuntu

sophiago01:06:57

right. they have a package for that, but it's more work than i'd like to even set it up in a nix-shell

richiardiandrea01:06:03

java -cp Nightcode-2.3.3.jar clojure.main
Clojure 1.9.0-alpha15
user=> (require 'nightcode.core)
ClassNotFoundException javafx.scene.control.Tab  java.net.URLClassLoader.findClass (URLClassLoader.java:381)
user=>

richiardiandrea01:06:16

maybe I am missing that as well as you?

sophiago01:06:34

oh, i never tried it with clojure.main

sophiago01:06:09

i guess you wanted to diagnose it by just launching it in a clj repl and requiring the ns yourself?

sophiago01:06:01

and you have clojure downloaded in the same dir i suppose?

richiardiandrea01:06:09

no it is packaged

sophiago01:06:33

uh, well i get Error: Could not find or load main class clojure.main

richiardiandrea01:06:35

yeah it works like this

richiardiandrea01:06:47

sudo apt-get install openjfx

richiardiandrea01:06:06

we should PR some repo ๐Ÿ˜„

sophiago01:06:56

tbh i'm not sure what openjfx is. as mentioned, i use Oracle JDK

sophiago01:06:11

and i'm not sure how you're loaded nightcode into a clojure repl

richiardiandrea01:06:51

it is not included by default, see SO question above

sophiago01:06:54

to be clear, you just have the jar in the dir you're calling it from and that's all?

richiardiandrea01:06:27

yes I have installed openjfx and now I do: java -jar Nightcode-2.3.3.jar nightcode.core

sophiago01:06:08

richiardiandrea: oh...well i likely have the same issue with building openjfx

sophiago01:06:27

if i was on mac none of this would be an issue! ๐Ÿ˜›

sophiago01:06:49

i'm on NixOS, hence any extremely uncommon pkgs are a huge pain

sophiago01:06:04

i'm not even sure what openjfx is

richiardiandrea01:06:48

UI java bindings

sophiago01:06:16

but that applies to openjdk, not oracle

richiardiandrea01:06:31

yeah, for Oracle I don't have a clue, probably some googling will solve the problem

sophiago01:06:41

JavaFX is included with Oracle JDK8

richiardiandrea01:06:28

oh ok, have you tried in the repl then, that could surface the problem

sophiago01:06:34

turns out i have both open and oracle installed and it defaulted to open ๐Ÿ˜›

sophiago01:06:02

i'm temporarily disabling it in the package manager since i can't remember how nix updates symlinks for it

richiardiandrea01:06:36

I gotta go.. right on time ๐Ÿ˜„

richiardiandrea01:06:52

happy that you solved!

richiardiandrea01:06:34

it would be great to add this info to the README or somtething...let's remind each other ๐Ÿ˜„

sophiago01:06:48

the nightcode readme?

sophiago01:06:02

it seems an open issue with OpenJDK

richiardiandrea01:06:02

yeah and/or the ClojureBridge

sophiago01:06:17

no one updates that particular ClojureBridge repo you linked me to

sophiago01:06:28

although i'll certainly email the folks i'm working with

richiardiandrea01:06:22

ok great thanks for that!

richiardiandrea01:06:37

the command that solved was sudo apt-get install openjfx but i will open an issue in Nightcode too ๐Ÿ™‚

sophiago01:06:11

but if you're on debian/ubuntu you wouldn't be launching from the jar anyway. they have a package

sophiago01:06:31

and again, it's not a Nightcode specific issue. it's an OpenJDK issue

sophiago01:06:32

OpenJDK uses mercurial so no idea how they log issues

richiardiandrea02:06:51

just wanted to put it out somewhere ๐Ÿ˜„

sophiago02:06:30

uh, except you could open that issue for literally every java application on github...

sophiago02:06:04

anyway, i'm not wading into the agile hellhole that is openjdk's bug tracker. surely they're aware it doesn't bundle JavaFX and are fine with it

sophiago02:06:19

thanks for your diagnostic help, tho!

seancorfield01:06:04

(this would be a good use of Slack threads so it doesnโ€™t clog up the main channel for everyone else)

richiardiandrea01:06:38

seancorfield: you are right Sean tnx

seancorfield01:06:19

No problem. I just switched to #boot and was like OMG! How far back do I need to scroll?? ๐Ÿ™‚

dominicm23:06:17

I do feel it's a lot of clicks to start a thread, speaking as a vim user. Even reactions are quicker.

martinklepsch01:06:07

Is there a way to customize the name of the boot libraries to be downloaded? (like CLOJURE_NAME but BOOT_NAME kind of โ€” maybe also just the org part)

martinklepsch02:06:40

(asking so that I can swap the boot jars with my own deployed to clojars or similar)

richiardiandrea03:06:09

Uhm, I have never heard of it, what I do is to change the version.properties file to a custom version and boot.properties accordingly, but there must be a better way ๐Ÿ˜€

martinklepsch03:06:22

@richiardiandrea right the version change helps for locally installed test versions but if you want to load boot from a maven repoโ€ฆ.

richiardiandrea03:06:24

Do you control the maven repo?

richiardiandrea03:06:41

(probably not ๐Ÿ˜)

juhoteperi10:06:51

Hmm any ideas if we can release current Boot master as 2.7.2 SNAPSHOT or do some of the changes require bumping to 2.8? I need version with https://github.com/boot-clj/boot/pull/558 as soon as possible

juhoteperi10:06:02

Why does deploy require java 1.7? << Java version: 1.8 >> You must build with Java version 1.7 only.

juhoteperi11:06:09

Javac options are setup to target 1.7 but I'm not sure if Clojure AOT respects those

martinklepsch12:06:06

@juhoteperi I think it might be to stay compatible with Java 1.7 โ€” maybe?

juhoteperi12:06:35

Code compiled in 1.8 can be compatible with 1.7

martinklepsch12:06:10

Well then ๐Ÿ˜„

juhoteperi12:06:57

At least Javac, not sure about Clojure AOT, usually libraries don't use that

juhoteperi12:06:59

I think Java version shouldn't affect at all the bytecode Clojure compiler emits so that shouldn't be a problem either

dave12:06:56

FWIW: i used to compile one of my projects (alda) with java 7 explicitly, so that my jar file would run on systems with java 7+, and i did it by using the javac options -source 1.7 -target 1.7 -bootclasspath $JDK7_BOOTCLASSPATH

dave12:06:20

that allowed me to build the project without actually changing my default java version

dave12:06:57

the location of the bootclasspath varies depending on your OS. on my OSX system, that happened to be at /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/

alandipert14:06:42

@juhoteperi i donโ€™t see why we canโ€™t release whatโ€™s ready as 2.7.2

juhoteperi14:06:02

Just a snapshot would be enough for me now

alandipert14:06:21

i forget, do snapshots mess up boot -u?

juhoteperi14:06:58

Hmm not sure

alandipert16:06:05

confirmed it doesnโ€™t, and 2.7.2-SNAPSHOT is deployed ๐Ÿพ

alandipert16:06:17

@calvis @juhoteperi ^^

seancorfield16:06:29

I saw a changelog note about performance improvements in artifact uploads, does 2.7.2 also improve artifact downloads?

seancorfield16:06:36

We depend on New Relicโ€™s Java API and itโ€™s about 9MB and whenever we bump the version, Boot seems to take a long time to download/process that libraryโ€ฆ Of course it may be something else but it seems like itโ€™s Boot.

richiardiandrea16:06:03

@seancorfield the patch above above basically enables lazy evaluation of log's payloads and it might have improved performance in each and every place where we were doing a lot of logging

seancorfield16:06:45

Cool, will probably bump to 2.7.2 soon then. Would prefer a non-snapshot but I think we can work with it as-is. Iโ€™ll open a JIRA issue at work to evaluate the new version (since we have a Boot wrapper shell script and control all the config under our version control).

juhoteperi17:06:20

I think the change will help with both downloads and uploads, the log call was on aether transfer callback function

juhoteperi17:06:41

I think that callback is called every few thousand bytes or such when downloading and uploading, but I'm not sure

ghadi18:06:12

i believe the java7 stuff had to do with boot/boot-bin and Launch4J

ghadi18:06:24

don't quote me on that ^