Randomization doesn't work with GraalVM native-image

Description

Problem description:

A native compiled with GraalVM always returns the same "random" value:

Repro:

Clone: $ git clone https://github.com/clojure/test.check.git && cd test.check

Make main class:

Make classes dir: mkdir -p classes

AOT compile:

Run on JVM, observe that random works:

Compile with GraalVM native-image:

Run binary, observe that random doesn't work:

Proposed solution:
Delay creation of random value until it is needed. Implemented in patch TCHECK-157-1.

Alternative solution:
Delaying class initialization to runtime. This does not work:

Environment

None

Activity

Show:
Michiel Borkent
September 1, 2020, 4:33 PM

Comment from on Slack:

LGTM
I can't open jira on my computer for some reason, so can't comment on it

Assignee

Alex Miller

Reporter

Michiel Borkent

Labels

None

Approval

None

Patch

Code

Priority

Major