Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:
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?


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?


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


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


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



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 ?


You can use config-merge-dir without that


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


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


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


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! 🙂 )


@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


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


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?


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




it’s very handy


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


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


@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.


Mainly just moving responsibilities around

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

@rickmoynihan yes please :)

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 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


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

@raspasov. It would be great to double check that the 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 of React Native. Maybe it's worth creating a new slack channel to discuss?


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 Thanks again for everything 🙇 I hope you find this useful.