circleci / clj-v8 Goto Github PK
View Code? Open in Web Editor NEWClojure wrapper for the v8 JS engine
Clojure wrapper for the v8 JS engine
clj-v8's dependency on JNA is at version 3.5.1. There is a newer point release (3.5.2) and a newer major release (4.0).
3.5.2 is most interesting to me, due to a bug fix relaxing JNA's libc requirement, without which clj-v8 can't run on linux platforms with glibc < 2.11.
Can this be bumped up and released?
Thanks
When run on ubuntu 12.04 (fairly clean) I get
==== Detecting environment ====
==== Preparing ====
==== Building v8 ====
make: *** No rule to make target dependencies'. Stop. Building Linux 32 bit make: *** No rule to make target
ia32.release'. Stop.
Building Linux 64 bit
make: *** No rule to make target x64.release'. Stop. ==== Building v8wrapper ==== rm -f *.o *.so *.dylib test g++ -c -fPIC -I../v8/include -Wall v8wrapper.cc -o v8wrapper.o cp ../v8/out/x64.release/lib.target/libv8.so.clj-v8 . cp: cannot stat
../v8/out/x64.release/lib.target/libv8.so.clj-v8': No such file or directory
make: *** [libv8.so.clj-v8] Error 1
=== Copying v8wrapper and v8 (64bit) ===
cp: cannot stat libv8wrapper.so': No such file or directory cp: cannot stat
libv8.so.clj-v8': No such file or directory
rm -f .o *.so *.dylib test
g++ -c -m32 -fPIC -I../v8/include -Wall v8wrapper.cc -o v8wrapper.o
In file included from /usr/include/c++/4.6/x86_64-linux-gnu/32/bits/os_defines.h:40:0,
from /usr/include/c++/4.6/x86_64-linux-gnu/32/bits/c++config.h:393,
from /usr/include/c++/4.6/cstdlib:43,
from v8wrapper.cc:1:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make: ** [v8wrapper.o] Error 1
=== Copying v8wrapper and v8 (32bit) ===
cp: cannot stat libv8wrapper.so': No such file or directory cp: cannot stat
libv8.so.clj-v8': No such file or directory
If two JVM processes use v8.core at the same time, one of them (I think usually the first one started) will exit with a segfault.
Tested with both Ubuntu 16.04 and 14.04 x64 with Oracle Java 8
Simple test case:
$ ls lib
clj-v8-0.1.5.jar clj-v8-native-0.1.4.jar clojure-1.8.0.jar jna-3.5.1.jar
$ java -cp 'lib/*' clojure.main -e '(do (require '"'"'[v8.core :as v8]) (v8/run-script-in-context (v8/create-context) "while (true){};"))' &
[1] 21802
$ java -cp 'lib/*' clojure.main -e '(do (require '"'"'[v8.core :as v8]) (v8/run-script-in-context (v8/create-context) "while (true){};"))' &
[2] 21823
$ #
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGBUS (0x7) at pc=0x00007fee01b0de0e, pid=21802, tid=0x00007fee20de8700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
#
[error occurred during error reporting (printing problematic frame), id 0x7]
# Failed to write core dump. 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:
# hs_err_pid21802.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
[1]- Aborted (core dumped) java -cp 'lib/*' clojure.main -e '(do (require '"'"'[v8.core :as v8]) (v8/run-script-in-context (v8/create-context) "while (true){};"))'
Getting the following exception when running on an M1 Macbook Pro
CompilerException Syntax error compiling at (v8/core.clj:43:1). #:clojure.error{:phase :compile-syntax-check, :line 43, :column 1, :source "v8/core.clj"}
clojure.lang.Compiler.load (Compiler.java:7652)
clojure.lang.RT.loadResourceScript (RT.java:381)
clojure.lang.RT.loadResourceScript (RT.java:372)
clojure.lang.RT.load (RT.java:459)
clojure.lang.RT.load (RT.java:424)
clojure.core/load/fn--6856 (core.clj:6115)
clojure.core/load (core.clj:6114)
clojure.core/load (core.clj:6098)
clojure.core/load-one (core.clj:5897)
clojure.core/load-one (core.clj:5892)
clojure.core/load-lib/fn--6796 (core.clj:5937)
clojure.core/load-lib (core.clj:5936)
Caused by:
Exception Unsupported OS/archetype: Mac OS X aarch64
v8.core/find-file-path-fragments (core.clj:20)
v8.core/find-file-path-fragments (core.clj:7)
v8.core/load-library-from-class-path (core.clj:31)
v8.core/load-library-from-class-path (core.clj:29)
v8.core/eval11745 (core.clj:46)
v8.core/eval11745 (core.clj:43)
clojure.lang.Compiler.eval (Compiler.java:7181)
clojure.lang.Compiler.load (Compiler.java:7640)
clojure.lang.RT.loadResourceScript (RT.java:381)
Looks like the table in that function needs to be updated to include the M1 support?
Hi,
I'm using clj-v8 transitively via Optimus, deploying to a somewhat aging but long-term supported RHEL environment (5.x).
The shared objects in clj-v8 appear not to be backward-compatible with such an old platform due to variants of glibc, ELFs, ABIs, etc etc.
I was able to rebuild the binaries (x86_64) in a suitable VM, but they replace the existing native/linux/x86_64/*
files. I presume they aren't going to be forward-compatible (or even desirable to use in a newer system, if they are).
Do you have any thoughts on adding some kind of "ancient" linux target for these distributions?
Hi,
Is clj-v8 published under any particular open source license? I can't locate any reference to one in the codebase.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.