Skip to content

Commit adcf7cf

Browse files
committed
added GraalVM 20
1 parent ce9f6c8 commit adcf7cf

File tree

9 files changed

+58
-64
lines changed

9 files changed

+58
-64
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Here the list of libraries tested:
2323
- ring/http-kit - Web server :question:
2424
- [aleph](./aleph) - Web server :white_check_mark:
2525
- [safely](./safely) - Circuit breaker :white_check_mark:
26+
- [secure-random](./secure-random) - `SecureRandom` initialization :white_check_mark:
2627

2728

2829
More libraries to come (*PRs are welcome*).

clojure/README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ Currently testing the following Clojure versions
4545
- Clojure 1.10.0
4646
- Clojure 1.10.1
4747

48-
And the following GraalVM versions
48+
And the following GraalVM versions have been tested.
4949

5050
- GraalVM-CE-1.0.0-rc14
5151
- GraalVM-CE-1.0.0-rc15
5252
- GraalVM-CE-1.0.0-rc16
5353
- GraalVM-CE-19.0.0
5454
- GraalVM-CE-19.3.0.2
5555
- GraalVM-CE-19.3.1
56+
- GraalVM-CE-20.0.0
5657

5758

5859
This is the current result:
@@ -61,29 +62,40 @@ This is the current result:
6162
----------------------------------------------------------------------
6263
Verifying native images
6364
----------------------------------------------------------------------
65+
verifying simple-clojure-1.10.1-graal-20.0.0 : OK
66+
verifying simple-clojure-1.10.0-graal-20.0.0 : OK
67+
verifying simple-clojure-1.9.0-graal-20.0.0 : OK
68+
verifying simple-clojure-1.8.0-graal-20.0.0 : OK
69+
verifying simple-clojure-1.7.0-graal-20.0.0 : OK
70+
6471
verifying simple-clojure-1.10.1-graal-19.3.1 : OK
6572
verifying simple-clojure-1.10.0-graal-19.3.1 : OK
6673
verifying simple-clojure-1.9.0-graal-19.3.1 : OK
6774
verifying simple-clojure-1.8.0-graal-19.3.1 : OK
6875
verifying simple-clojure-1.7.0-graal-19.3.1 : OK
76+
6977
verifying simple-clojure-1.10.1-graal-19.3.0.2 : OK
7078
verifying simple-clojure-1.10.0-graal-19.3.0.2 : OK
7179
verifying simple-clojure-1.9.0-graal-19.3.0.2 : OK
7280
verifying simple-clojure-1.8.0-graal-19.3.0.2 : OK
7381
verifying simple-clojure-1.7.0-graal-19.3.0.2 : OK
82+
7483
verifying simple-clojure-1.10.1-graal-19.0.0 : OK
7584
verifying simple-clojure-1.10.0-graal-19.0.0 : OK
7685
verifying simple-clojure-1.9.0-graal-19.0.0 : OK
7786
verifying simple-clojure-1.8.0-graal-19.0.0 : OK
7887
verifying simple-clojure-1.7.0-graal-19.0.0 : OK
88+
7989
verifying simple-clojure-1.10.0-graal-1.0.0-rc16 : OK
8090
verifying simple-clojure-1.9.0-graal-1.0.0-rc16 : OK
8191
verifying simple-clojure-1.8.0-graal-1.0.0-rc16 : OK
8292
verifying simple-clojure-1.7.0-graal-1.0.0-rc16 : OK
93+
8394
verifying simple-clojure-1.10.0-graal-1.0.0-rc15 : OK
8495
verifying simple-clojure-1.9.0-graal-1.0.0-rc15 : OK
8596
verifying simple-clojure-1.8.0-graal-1.0.0-rc15 : OK
8697
verifying simple-clojure-1.7.0-graal-1.0.0-rc15 : OK
98+
8799
verifying simple-clojure-1.10.0-graal-1.0.0-rc14 : OK
88100
verifying simple-clojure-1.9.0-graal-1.0.0-rc14 : OK
89101
verifying simple-clojure-1.8.0-graal-1.0.0-rc14 : OK

secure-random-trick/README.md

-23
This file was deleted.

secure-random-trick/project.clj

-30
This file was deleted.

secure-random-trick/test/secure_random_trick/core_test.clj

-7
This file was deleted.
File renamed without changes.

secure-random/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# secure-random
2+
3+
The smallest project possible, which demonstrates the issue with
4+
`SecureRandom` objects bound to dynamic Vars.
5+
6+
`SecureRandom` class need to be initialized at Runtime.
7+
8+
## Usage
9+
10+
1. Point `[:native-image :graal-bin]` in project.clj to your GRAAL_VM installation.
11+
2. Run `lein native-image`
12+
3. the run `./target/simple-main`

secure-random/project.clj

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(defproject secure-random "0.1.0-SNAPSHOT"
2+
:dependencies [[org.clojure/clojure "1.9.0"]]
3+
:plugins [[io.taylorwood/lein-native-image "0.3.1"]]
4+
:native-image {;; name of output image, optional
5+
:name "simple-main"
6+
;; path to GraalVM home, optional
7+
:graal-bin
8+
"/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.0.0/Contents/Home/bin"
9+
10+
;; pass-thru args to GraalVM native-image, optional
11+
:opts ["--verbose"
12+
"--no-fallback"
13+
"--enable-all-security-services"
14+
"--initialize-at-build-time"
15+
"-H:+ReportExceptionStackTraces"
16+
"--report-unsupported-elements-at-runtime"]}
17+
18+
19+
:main simple.main
20+
21+
:profiles {:uberjar {:aot :all
22+
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}
23+
:repl-options {:init-ns simple.main})

secure-random-trick/src/secure_random_trick/core.clj renamed to secure-random/src/simple/main.clj

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(ns secure-random-trick.core
1+
(ns simple.main
22
(:gen-class)
33
(:import (java.security SecureRandom)
44
(java.util Random)))
@@ -9,11 +9,17 @@
99
)
1010
)
1111

12-
;; Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
12+
;; Caused by:
13+
;; com.oracle.graal.pointsto.constraints.UnsupportedFeatureException:
14+
;; No instances of sun.security.provider.NativePRNG are allowed in the
15+
;; image heap as this class should be initialized at image runtime. To
16+
;; see how this object got instantiated use
17+
;; -H:+TraceClassInitialization.
18+
;;
1319
;; Detailed message:
1420
;; Trace: object java.security.SecureRandom
1521
;; object clojure.lang.Var
16-
;; method secure_random_trick.core$next_random_long_BANG_.invokeStatic()
22+
;; method secure_random.core$next_random_long_BANG_.invokeStatic()
1723

1824
(defn next-random-long!
1925
[]

0 commit comments

Comments
 (0)