graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
raspasov 2021-06-16T04:30:50.118500Z

I have some. Been doing RN since 2016 or so. Also been doing a bit more Swift/Obj-C native dev in combination with RN last couple of weeks.

raspasov 2021-06-16T04:31:30.119200Z

What can I do to help/participate?

2021-06-16T14:01:47.121900Z

If I discover reflective access calls with native-image-agent and with config-merge-dir set (so I can instrument multiple inputs) is there an equivalent to config-merge-dir to merge the trace files necessary for a modified refl to run?

borkdude 2021-06-16T14:13:33.125900Z

@rickmoynihan I think trace files are just a vector of things, so you could just append them?

2021-06-16T14:13:46.126300Z

yeah was just going to say essentially that

borkdude 2021-06-16T14:14:05.127Z

if you have improvements to refl, feel free to raise PRs

2021-06-16T14:14:56.127800Z

Happy to help; but I guess the reason it’s not a library is because it’s not obvious how to extract the reusable bits from a specific build just yet

2021-06-16T14:17:09.129700Z

Right now I’m thinking it might be better to split the run into two phases. 1. a task to generate merged reflect configs with merge-dir set 2. a task to generate separate trace files 3. a final task that generates the cleaned config by iterating over each trace-file

borkdude 2021-06-16T14:18:30.130100Z

correct, molding this into a library would be too soon as it's probably project-specific how to use this

2021-06-16T14:18:36.130300Z

:thumbsup:

borkdude 2021-06-16T14:18:49.130700Z

I was more thinking of improvements to filtering out false positives

borkdude 2021-06-16T14:19:07.131200Z

the merge stuff afaik isn't available in the readily available distribution

borkdude 2021-06-16T14:19:14.131400Z

only when you build yourself with mx ?

2021-06-16T14:19:34.131900Z

You can use config-merge-dir without that

2021-06-16T14:20:21.132500Z

The native image configure tool doesn’t appear to work without building with mx though

2021-06-16T14:20:33.132900Z

Though tbh I’m not entirely sure what that tool is, or what it means

2021-06-16T14:20:56.133400Z

but I’ve used config-merge-dir just fine before

2021-06-16T14:21:18.133800Z

i.e. just set that, run the process a bunch of time with different inputs; then compile to a native image as normal with a merged reflection config; and all the reflective calls for those inputs are bottomed out properly. (With lots of false positives though — hence why I need your refl stuff! 🙂 )

2021-06-16T14:24:04.134100Z

@borkdude: FYI this ⬆️ does seem to work; it’s a possible improvement I could issue a PR if you’re interested.

borkdude 2021-06-16T14:27:35.134500Z

yeah, I think that makes sense. There is already a classpath task as well in the bb.edn

borkdude 2021-06-16T14:27:47.134700Z

which we should feed into this script probably instead of hardcoding it

2021-06-16T14:28:14.134900Z

funny you should mention that; that’s exactly what I did 🙂

2021-06-16T14:28:50.135100Z

but I did it in my project, not your repo.

borkdude 2021-06-16T14:39:20.135500Z

@rickmoynihan but how do you merge the configs?

2021-06-16T14:40:27.136100Z

Simply run multiple times with this: -agentlib:native-image-agent=config-merge-dir=nativecfg instead of this: -agentlib:native-image-agent=config-output-dir=nativecfg

borkdude 2021-06-16T14:41:18.136500Z

so it just merges the existing configs in the nativecfg dir with existing ones?

borkdude 2021-06-16T14:41:21.136800Z

I didn't know that

2021-06-16T14:41:21.136900Z

yup

2021-06-16T14:42:22.137100Z

it’s very handy

2021-06-16T14:43:30.137700Z

by the way I’m really enjoying using the bb task runner, it’s really, really nice! 🙇

1🙂
2021-06-16T14:45:19.138600Z

refl made me finally bite the bullet and start using it for this project

2021-06-16T17:22:49.141Z

@borkdude: FYI I’ve just modified my usage of refl to do all of the above and I can confirm it works a charm! 🎉 concat traces and merge configs. I’m going afk for a few days though; but if you’re interested I’m happy to discuss pushing back the refactorings necessary, when I’m back next week. Though it’s not really very complicated.

2021-06-16T17:23:36.141400Z

Mainly just moving responsibilities around

borkdude 2021-06-16T17:24:01.141600Z

@rickmoynihan yes please :)

1👍
Karol Wójcik 2021-06-17T08:29:02.145Z

I think invoking the code with different main arguments will fail for some complex apps. Maybe integration with https://github.com/FieryCod/clojure-graalvm-agent-helper? I do already have the power of refl mixed graalvm-agent-helper, and the results are promising. On the other hand, maybe it's too early to automate the process since not all false positives have been discovered?

Karol Wójcik 2021-06-17T15:47:16.145400Z

@borkdude Would you be interested in resource trimming patch?

borkdude 2021-06-17T15:47:43.145700Z

yeah

phronmophobic 2021-06-16T17:41:19.141800Z

@raspasov. It would be great to double check that the https://github.com/phronmophobic/mobiletest 1) works , 2) is easy to follow. I've done mobile development, but mostly objective-c/c++ for games. It would great to get your take on what kind of GUI API you think would make sense (clj bindings for SwiftUI?, UIKit, something else?). I'd also like to know what you think of React Native generally. One interesting strategy would be to create bindings to the https://github.com/facebook/react-native/tree/master/ReactCommon of React Native. Maybe it's worth creating a new slack channel to discuss?

2021-06-16T23:24:31.142100Z

Decided to do this, this evening, I’ve backported most of the changes I made to my project into refl for you. I’ll probably not be able to revise the PR until early next week though https://github.com/borkdude/refl/pull/2 Thanks again for everything 🙇 I hope you find this useful.