Fork me on GitHub
#planck
<
2017-03-22
>
darwin00:03:17

I was able to reproduce the failure in VirtualBox. It is really puzzling. @richiardiandrea ported some of clj code under self-host, but he forgot to port this one function: https://github.com/binaryage/env-config/blob/b8f6484073c37719cfb73be1b109ff1f9232f45f/src/lib/env_config/impl/helpers.cljc#L25 for some reason planck does not complain, neither lumo does

darwin00:03:27

I don’t understand why it works in lumo and in planck on other systems than Ubuntu 14.04 (trusty)

mfikes01:03:46

@darwin env-configs unit test work for me with Planck in Ubuntu 14.04

[email protected]:~/env-config$ uname -a
Linux vagrant-ubuntu-trusty-64 3.13.0-112-generic #159-Ubuntu SMP Fri Mar 3 15:26:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[email protected]:~/env-config$ lein with-profile +self-host tach planck self-host-test-build
Testing env-config.tests.main

Ran 4 tests containing 16 assertions.
0 failures, 0 errors.

Error encountered performing task 'tach' with profile(s): 'base,system,user,provided,dev,self-host'
Suppressed exit

darwin01:03:32

@mfikes thanks for trying, let me point you to some older tip of the branch, I have fixed it since my original posts

darwin01:03:51

this might be also related to java/clojure/webkit versions, maybe?

mfikes01:03:03

@darwin Oh. And the core of the failure is that Planck (and Lumo) fails to emit a diagnostic for the missing string-starts-with?

mfikes01:03:23

I'll clone that version and take a peek

darwin01:03:26

there are probably two issues: first that inconsistency between plancks on different systems should be tracked down, and second why both planck and lumo were silent on some systems

darwin01:03:18

the fact that tests passed might be just a coincidence, the function probably always returned true in that invalid case and my tests never test false case

mfikes02:03:38

Interestingly, I get it to fail for that older tip in the same way on OS X (10.10 Yosemite)

darwin02:03:40

interesting, btw. I also tested it under Ubuntu 16.04 and it passed all tests there (silently)(

mfikes02:03:05

@darwin I know why Planck behaves differently on different platforms. JavaScriptCore evolved and at some point added .startsWith. I encountered the same inconsistency with Andare https://github.com/mfikes/andare/issues/1

mfikes02:03:14

So if you try (.startsWith "abc" "a") in Planck it might fail or work, depending on how old JavaScriptCore is.

darwin02:03:30

I see, makes sense

darwin02:03:41

unrelated question, do you have any trick how to write portable try-catch code?

darwin02:03:00

my problem is (try ... (catch #?(:clj Throwable :cljs js/Error) e …)

mfikes02:03:19

No, Bloom suggested :default for Clojure. There is a JIRA on the books for it.

darwin02:03:42

yep, that would help

darwin02:03:58

I wanted to help myself with a small macro, but that didn’t fly

darwin02:03:24

catch is part of try-catch special form and I cannot write a macro just for catch part

mfikes02:03:42

Ahh, right

darwin02:03:58

something like (catch-all e …) would expand to (catch #?(:clj Throwable :cljs js/Error) e …)

darwin02:03:25

I would have to write smart macro expanding whole try-catch form

mfikes02:03:45

Yeah, that's a tricky one

darwin02:03:06

and that is a lot of work I’m not going to do right now, aren’t you aware of some library trying to ease writing portable code?

darwin02:03:50

I don’t like how reader conditionals sprinkled in the middle of my code look 😉

mfikes02:03:02

I suppose if you are the one throwing, you always use ex-info to at least have some consistency there.

mfikes02:03:13

I wonder if you can reliably catch that one in the same way portably