You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: espresso/docs/hacking.md
+33-17Lines changed: 33 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,55 @@
2
2
3
3
## Building
4
4
5
-
Set your (JVMCI-enabled) JDK via `mx` argument e.g. `mx --java-home /path/to/java/home ...` or via `export JAVA_HOME=/path/to/java/home`. Or (easiest) run `mx fetch-jdk` to download one.
5
+
### Using a pre-built GraalVM
6
+
7
+
The simplest way to build espresso is to use a pre-built GraalVM.
8
+
9
+
Download and unpack the latest GraalVM [release](https://www.graalvm.org/downloads/) or [ea build](https://github.com/graalvm/oracle-graalvm-ea-builds/releases).
6
10
7
-
`mx build`-ing Espresso creates a GraalVM with Espresso included. You can find out where it is by running `mx graalvm-home`.
11
+
Set the `JAVA_HOME` environment variable to the extracted result. This will be used during the build and as a host JDK.
8
12
9
-
To build the default configuration (interpreter-only), on the `espresso` repository:
13
+
Espresso is only a JVM and it needs a JDK to use as a guest. Set the `ESPRESSO_JAVA_HOME` to a JDK to be used for the guest.
14
+
15
+
To build, run:
10
16
11
17
```bash
12
18
$ mx build
13
19
```
14
20
15
-
Other configurations are provided:
21
+
### Using native-image from the graal repository
22
+
23
+
It is also possible to build using native-image built from sources from the current graal repository.
16
24
25
+
Set your (JVMCI-enabled) JDK via `mx` argument e.g. `mx --java-home /path/to/java/home ...` or via `export JAVA_HOME=/path/to/java/home`. Or (easiest) run `mx fetch-jdk` to download one.
26
+
27
+
Set the `ESPRESSO_JAVA_HOME` to a JDK to be used for the guest.
`mx espresso` runs Espresso (from jars or native) from within a GraalVM. It mimics the `java` (8|11) command. Bare `mx espresso` runs Espresso on interpreter-only mode.
47
+
You can find out where the espresso standalones are by running `mx path --output ...`:
48
+
```bash
49
+
$ mx path --output ESPRESSO_NATIVE_STANDALONE
50
+
$ mx path --output ESPRESSO_JVM_STANDALONE
51
+
```
52
+
53
+
`mx espresso` runs Espresso from a standalone (jvm or native). It mimics the `java` command.
31
54
32
55
```bash
33
56
$ mx --env jvm-ce build # Always build first
@@ -45,7 +68,7 @@ The `mx espresso` launcher adds some overhead, to execute Espresso native image
0 commit comments