How can I instantiate nested java records from clojure?
say:
public class MyClass {
public record MyRecord(...)
public class MyInnerClass(...)
}
MyClass$MyRecordin case anyone is curious: I did end up getting my CI pipeline working, and it's only moderately cursed https://codeberg.org/jyn514/flower/src/branch/dev/ci/generate_ci.clj
bb doesn’t support -P without clojure also being installed, so i need clojure anyway and now i have to deal with multiple installs. the caching here is not so complicated but it does have a bootstrapping problem, and bash is actually rather good at process spawning to start with so it didn’t feel so hard to just do that
note that there needs to be a separate generation step regardless, the CI provider only accepts new jobs through YAML
i never did find a way to pass arbitrary arguments through the integration test runner :/ that was the hard part, not the shell quoting. but i spent enough time on this already it didn’t seem worth it just to avoid messing with symlinks
oh huhhhh
also you can programmatically invoke it from bb itself
maybe i misread the docs
(babashka.tasks/clojure "-P")this is quite promising
it does download a tools jar in first invocation (that you could cache in CI if you wanted). it's the same tools jar that the clojure CLI would invoke
@borkdude one other thing that confused me: it has a separate bb.edn, which is fine, but it also warns that it can’t manage java libraries? the thing i need clojure -P and tools.build for is building flower into an uberjar, and i do have native java dependencies
"but it also warns that it can’t manage java libraries?"?
if you invoke clojure with bb, none of these limitations are there, it's just clojure
but maybe I'm misunderstanding you
oh i see, it’s literally running the clojure jar file it just downloaded
yes
how does that work from inside graal? do you need java installed also?
yes. but the clojure CLI also needs that
bb clojure is using this https://github.com/borkdude/deps.clj it's a rewrite of the clojure CLI bash script that you can programmatically invoke as well
that’s hot
i wish it were easier to do caching with literally any CI provider, i found exactly two that would let me load a docker image without needing it pre-published to a registry and they both had other limitations
the current setup is minimizing “setup done after downloading the docker image” which is a really silly thing to have to worry about and ties me to popular tools :/ but the alternative is that i set up a private S3 bucket that i use to store caching layers
Why are you generating bash with bb if you can also run bb in CI? :-)