mirror of
https://github.com/enso-org/enso.git
synced 2024-12-25 01:33:16 +03:00
096fcfee82
This PR adds a possibility to generate native-image for engine-runner. Note that due to on-demand loading of stdlib, programs that make use of it are currently not yet supported (that will be resolved at a later point). The purpose of this PR is only to make sure that we can generate a bare minimum runner because due to lack TruffleBoundaries or misconfiguration in reflection config, this can get broken very easily. To generate a native image simply execute: ``` sbt> engine-runner-native/buildNativeImage ... (wait a few minutes) ``` The executable is called `runner` and can be tested via a simple test that is in the resources. To illustrate the benefits see the timings difference between the non-native and native one: ``` >time built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso --no-ir-caches --in-project test/Tests/ --run engine/runner-native/src/test/resources/Factorial.enso 6 720 real 0m4.503s user 0m9.248s sys 0m1.494s > time ./runner --run engine/runner-native/src/test/resources/Factorial.enso 6 720 real 0m0.176s user 0m0.042s sys 0m0.038s ``` # Important Notes Notice that due to a [bug in GraalVM](https://github.com/oracle/graal/issues/4200), which is already fixed in 22.x, and us still being on 21.x for the time being, I had to add a workaround to our sbt build to build a different fat jar for native image. To workaround it I had to exclude sqlite jar. Hence native image task is on `engine-runner-native` and not on `engine-runner`. Will need to add the above command to CI. |
||
---|---|---|
.. | ||
akka-native/src/main | ||
cli/src | ||
connected-lock-manager/src | ||
distribution-manager/src/main/scala/org/enso/distribution | ||
docs-generator | ||
downloader/src | ||
edition-updater/src | ||
edition-uploader/src/main/scala/org/enso/build | ||
editions/src | ||
flexer | ||
graph | ||
interpreter-dsl/src/main/java/org/enso/interpreter/dsl | ||
json-rpc-server | ||
json-rpc-server-test | ||
library-manager/src | ||
library-manager-test/src | ||
locking-test-helper/src/main/scala/org/enso/runtimeversionmanager/test | ||
logger | ||
logging-service/src | ||
logging-truffle-connector/src/main | ||
logging-utils/src | ||
parser/src | ||
parser-service | ||
pkg | ||
profiling-utils/src/main/scala/org/enso/profiling | ||
project-manager | ||
runtime-version-manager/src | ||
runtime-version-manager-test/src | ||
searcher/src | ||
syntax | ||
task-progress-notifications/src/main/scala/org/enso/cli/task/notifications | ||
testkit/src/main/scala/org/enso/testkit | ||
text-buffer/src | ||
version-output/src/main/scala/org/enso/version |