Hello I am working on this project: https://github.com/svazqz/plClojure
But currently I am facing an issue after building the c++ binary, when I run the file create after the build step I get:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000105d3894c, pid=12933, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0.2) (build 21.0.2)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21.0.2, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# V [libjvm.dylib+0x42894c] jni_CallStaticObjectMethodV+0x9c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/$USER/Projects/plClojure/hs_err_pid12933.log
#
# If you would like to submit a bug report, please visit:
# https://github.com/Homebrew/homebrew-core/issues
#
zsh: abort ./bazel-bin/src/pl_clojure
Which in summary is related to:
Internal exceptions (2 events):
Event: 0.124 Thread 0x000000014880a800 Exception <a 'java/lang/NoClassDefFoundError'{0x0000000787f120c0}: clojure/java/api/Clojure> (0x0000000787f120c0)
thrown [src/hotspot/share/classfile/systemDictionary.cpp, line 301]
Event: 0.124 Thread 0x000000014880a800 Exception <a 'java/lang/NoSuchMethodError'{0x0000000787f123c8}: var> (0x0000000787f123c8)
thrown [src/hotspot/share/prims/jni.cpp, line 1072]
I have tried different ways of adding clojure jar files as dependencies in the project but either the bazel sync
fails when downloading the deps or the binary still throwing the previous exception after dependencies have been successfully downloaded and binary has been built.
How can I add the required jar files and then use them in the c++ code, using bazel?
I have tried using this rules:
http_archive(
name = "rules_clojure",
sha256 = "c841fbf94af331f0f8f02de788ca9981d7c73a10cec798d3be0dd4f79d1d627d",
strip_prefix = "rules_clojure-c044cb8608a2c3180cbfee89e66bbeb604afb146",
urls = ["https://github.com/simuons/rules_clojure/archive/c044cb8608a2c3180cbfee89e66bbeb604afb146.tar.gz"],
)
load("@rules_clojure//:repositories.bzl", "rules_clojure_dependencies", "rules_clojure_toolchains")
rules_clojure_dependencies()
rules_clojure_toolchains()
And I want to be able to use clojure inside c++ code like this:
options[0].optionString = "-Djava.class.path=/Library/external/spec_alpha/spec.alpha-0.1.143.jar:/Library/external/clojure/clojure-1.9.0.jar";
In order to be able to run clojure code throw c++ interface.
svazq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.