Skip to content

Commit 165fd6d

Browse files
Automatic merge of master into galahad
2 parents b0dcbb4 + b33c897 commit 165fd6d

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

docs/reference-manual/embedding/embed-languages.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ To summarize, the code cache can be controlled by keeping and maintaining strong
682682
683683
## Polyglot Isolates
684684
685-
On Oracle GraalVM, a Polyglot engine can be configured to run in a dedicated Native Image isolate.
685+
On Oracle GraalVM, a polyglot engine can be configured to run in a dedicated Native Image isolate.
686686
A polyglot engine in this mode executes within a VM-level fault domain with a dedicated garbage collector and JIT compiler.
687687
Polyglot isolates are useful for [polyglot sandboxing](../../security/polyglot-sandbox.md).
688688
Running languages in an isolate works with HotSpot and Native Image host virtual machines.
@@ -694,22 +694,50 @@ For example, a dependency on isolated JavaScript can be configured by adding a M
694694
<dependency>
695695
<groupId>org.graalvm.polyglot</groupId>
696696
<artifactId>polyglot</artifactId>
697-
<version>24.0.0</version>
697+
<version>${graalvm.polyglot.version}</version>
698698
<type>jar</type>
699699
</dependency>
700700
<dependency>
701701
<groupId>org.graalvm.polyglot</groupId>
702702
<artifactId>js-isolate</artifactId>
703-
<version>24.0.0</version>
703+
<version>${graalvm.polyglot.version}</version>
704704
<type>pom</type>
705705
</dependency>
706706
```
707707
708-
The downloaded dependency is platform-independent, which contains a native-image for each platform.
709-
We plan to support downloading polyglot isolate native images for individual platforms in a future release.
708+
Starting from the Polyglot API version 24.1.0, the polyglot engine supports polyglot isolates for individual platforms.
709+
To download a polyglot isolate for a specific platform, append the operating system and
710+
CPU architecture classifiers to the polyglot isolate Maven `artifactId`. For example,
711+
to configure a dependency on isolated Python for Linux amd64, add the following Maven dependencies:
712+
713+
```xml
714+
<dependency>
715+
<groupId>org.graalvm.polyglot</groupId>
716+
<artifactId>polyglot</artifactId>
717+
<version>${graalvm.polyglot.version}</version>
718+
<type>jar</type>
719+
</dependency>
720+
<dependency>
721+
<groupId>org.graalvm.polyglot</groupId>
722+
<artifactId>python-isolate-linux-amd64</artifactId>
723+
<version>${graalvm.polyglot.version}</version>
724+
<type>pom</type>
725+
</dependency>
726+
```
727+
728+
Supported platform classifiers are:
729+
* `linux-amd64`
730+
* `linux-aarch64`
731+
* `darwin-amd64`
732+
* `darwin-aarch64`
733+
* `windows-amd64`
734+
735+
For a complete Maven POM file that adds the polyglot isolate Native Image dependency for the current platform,
736+
refer to the [Polyglot Embedding Demonstration](https://github.com/graalvm/polyglot-embedding-demo) on GitHub.
737+
710738
711739
To enable isolate usage with the Polyglot API, the `--engine.SpawnIsolate=true` option must be passed to `Engine` or `Context` when constructed.
712-
The option `engine.SpawnIsolate` may not be available if used on any other JDK than Oracle GraalVM.
740+
The option `engine.SpawnIsolate` may not be available if used on any JDK other than Oracle GraalVM.
713741
714742
```java
715743
import org.graalvm.polyglot.*;
@@ -734,6 +762,7 @@ Currently, the following languages are available as polyglot isolates:
734762
| Language | Available from |
735763
|-------------------------------|----------------|
736764
| JavaScript (`js-isolate`) | 23.1 |
765+
| Python (`python-isolate`) | 24.1 |
737766
738767
We plan to add support for more languages in future versions.
739768

sdk/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This changelog summarizes major changes between GraalVM SDK versions. The main f
1212
* GR-47956 Added the option `engine.InterpreterCallStackHeadRoom` to protect against stack overflow in the middle of a guest method execution in the interpreter. For the UNTRUSTED polyglot sandbox policy, the value for the option is computed automatically based on the value of the mandatory option `sandbox.MaxASTDepth`, the option `sandbox.MaxStackFrames` is no longer mandatory. The new option is available only in the AOT mode.
1313
* GR-40931 Added experimental support for virtual threads on HotSpot. Not all languages are currently supported for use with virtual threads, please check the language changelog for further information. Truffle debugging, CPU time limits and some memory limits are currently not supported on virtual threads. The number of threads is currently limited to 65535 threads entered per context.
1414
* GR-40931 Using virtual threads in a native-image will now emulate virtual threads using platform threads until Loom support for Truffle languages in native-image is implemented.
15+
* GR-48481: It is now possible to depend on platform-specific Maven artifacts when using polyglot isolates. The `-isolate` Maven artifacts remain platform-independent. However, if platform specific builds are required, consider adding a platform specific suffix to the Maven artifact name, such as `-isolate-linux-amd64`. The reduced binary size of platform specific dependencies can improve build times and reduce the distribution size of your application. For more details, see [Embedding Languages](https://www.graalvm.org/latest/reference-manual/embed-languages/#polyglot-isolates).
16+
* GR-48481: The Python language is now available as a polyglot isolate.
1517

1618
## Version 24.0.0
1719
* (GR-49334) Deprecated the `FileSystems#allowLanguageHomeAccess()` method and introduced `FileSystem#allowInternalResourceAccess()` as a replacement. To ensure compatibility, both methods now provide support for language homes and internal resources.

0 commit comments

Comments
 (0)