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: docs/reference-manual/embedding/embed-languages.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -538,13 +538,17 @@ To build a native executable with the above configuration, run:
538
538
mvn -Pnative package
539
539
```
540
540
541
-
To build a native executable from a polyglot application, for example, a Java-host application embedding Python, a `./resources` directory containing all the required files is created by default.
542
-
By default, the language runtime will look for the resources directory relative to the native executable or library image that was built.
541
+
Building a native executable from a polyglot application, for example, a Java-host application embedding Python, automatically captures all the internal resources required by the included languages and tools.
542
+
By default, the resources are included in the native executable itself.
543
+
The inclusion of resources in the native executable can be disabled by `-H:-IncludeLanguageResources`.
544
+
Another option is a separate _resources_ directory containing all the required files.
545
+
To switch to this option, use `-H:+CopyLanguageResources`. This is the default behavior when `-H:+IncludeLanguageResources` is not supported, i.e., with Graal Languages earlier than 24.2.x (see the [versions roadmap](https://www.graalvm.org/release-calendar/)).
546
+
When `-H:+CopyLanguageResources` is used, the language runtime will look for the resources directory relative to the native executable or the shared library.
543
547
At run time, the lookup location may be customized using the `-Dpolyglot.engine.resourcePath=path/to/resources` option.
544
-
To disable the resource creation, the `-H:-CopyLanguageResources` build-time option may be used.
545
-
Note that some languages may not support running without a resources directory.
548
+
To disable the capturing of resources altogether, add both `-H:-IncludeLanguageResources` and `-H:-CopyLanguageResources`to build-time options.
549
+
Note that some languages may not support running without their resources.
546
550
547
-
With Polyglot version 23.1 the language home options like `-Dorg.graalvm.home` should no longer be used and were replaced with the resource directory option.
551
+
With Graal Languages version 23.1 and newer the language home options like `-Dorg.graalvm.home` should no longer be used and were replaced with the resource directory option.
548
552
The language home options remain functional forcompatibility reasons but may be removedin future releases.
Copy file name to clipboardExpand all lines: sdk/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ For usages of the module-path pass the `--enable-native-access=org.graalvm.truff
10
10
* GR-54300 `Context` and `Engine` is now automatically closed when no longer strongly referenced. A reachable `Value` or `PolyglotException` will keep the associated `Context` reachable. Additionally, the `Context` remains reachable when explicitly entered or if there is an active polyglot thread within it. The `Engine` remains reachable when there is a strongly reachable `Language`, `Instrument`, or `Context` instance. However, it is still recommended not to rely on garbage collection for closing. Instead, use the try-with-resources pattern for explicit context and engine management. For more information, refer to the [Automatic Close on GC documentation](https://github.com/oracle/graal/blob/master/truffle/docs/CloseOnGc.md).
11
11
* GR-60022 Introduced the [FileSystem.newCompositeFileSystem](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html#newCompositeFileSystem(org.graalvm.polyglot.io.FileSystem,org.graalvm.polyglot.io.FileSystem.Selector...)) method, which creates a composite `FileSystem` delegating operations to the specified delegate FileSystem instances based on the provided selectors.
12
12
* GR-60022 Introduced the [FileSystem.newDenyIOFileSystem](https://www.graalvm.org/truffle/javadoc/org/graalvm/polyglot/io/FileSystem.html#newDenyIOFileSystem()) method, which creates a `FileSystem` that denies all file operations except for path parsing.
13
+
* GR-57838 Added automatic inclusion of language and instrument resources for embedding Truffle languages in native image. We no longer produce a _resources_ folder next to the image by default. Documentation available [here](https://www.graalvm.org/reference-manual/embed-languages/#build-native-executables-from-polyglot-applications).
13
14
14
15
## Version 24.1.0
15
16
* GR-51177 Enable random offsets of runtime compiled function entry points for the UNTRUSTED polyglot sandbox policy.
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1331,10 +1331,11 @@ public static boolean useClosedTypeWorld() {
1331
1331
1332
1332
publicstaticclassTruffleStableOptions {
1333
1333
1334
-
@Option(help = "Automatically copy the necessary language resources to the resources/languages directory next to the produced image." +
1335
-
"Language resources for each language are specified in the native-image-resources.filelist file located in the language home directory." +
1336
-
"If there is no native-image-resources.filelist file in the language home directory or the file is empty, then no resources are copied.", type = User, stability = OptionStability.STABLE)//
@Option(help = "Automatically copy the necessary language resources to the resources directory next to the produced image.", type = User, stability = OptionStability.STABLE)//
@Option(help = "Automatically include the necessary language internal resources in the produced image.", type = User, stability = OptionStability.STABLE)//
* Register all fields accessed by a InlinedField for an instance field or a static field as
287
300
* unsafe accessed, which is necessary for correctness of the static analysis.
@@ -469,8 +482,31 @@ public void duringSetup(DuringSetupAccess a) {
469
482
470
483
StaticObjectSupport.duringSetup(a);
471
484
485
+
if (SubstrateOptions.TruffleStableOptions.CopyLanguageResources.hasBeenSet() && SubstrateOptions.TruffleStableOptions.IncludeLanguageResources.hasBeenSet() &&
// IncludeLanguageResources == true, but it is not supported.
496
+
if (SubstrateOptions.TruffleStableOptions.IncludeLanguageResources.hasBeenSet()) {
497
+
throwVMError.shouldNotReachHere("The option IncludeLanguageResources has been set to true, but it is not supported!");
498
+
}
499
+
if (!SubstrateOptions.TruffleStableOptions.CopyLanguageResources.hasBeenSet()) {
500
+
copyLanguageResources = true;
501
+
}
502
+
}
503
+
504
+
if (copyLanguageResources) {
505
+
includeLanguageResources = false;
506
+
}
507
+
472
508
HomeFinderhf = HomeFinder.getInstance();
473
-
if (SubstrateOptions.TruffleStableOptions.CopyLanguageResources.getValue()) {
509
+
if (copyLanguageResources) {
474
510
if (!(hfinstanceofDefaultHomeFinder)) {
475
511
VMError.shouldNotReachHere(String.format("HomeFinder %s cannot be used if CopyLanguageResources option of TruffleBaseFeature is enabled", hf.getClass().getName()));
476
512
}
@@ -521,6 +557,38 @@ public void duringSetup(DuringSetupAccess a) {
521
557
if (needsAllEncodings) {
522
558
RuntimeResourceSupport.singleton().addResources(ConfigurationCondition.alwaysTrue(), "org/graalvm/shadowed/org/jcodings/tables/.*bin$", "Truffle needsAllEncodings flag is set");
Copy file name to clipboardExpand all lines: truffle/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,8 @@ This changelog summarizes major changes between Truffle versions relevant to lan
37
37
* GR-32682 Added `InstrumentableNode.findProbe()` to specify how an instrumentable node finds its associated probe. This is useful for bytecode interpreters to store the probe nodes in a separate data structure without associated wrapper nodes.
38
38
* GR-32682 Added `InstrumentableNode.createProbe(SourceSection)` method, which allows to create eager probe nodes for an instrumentable node. Eager probes do not wait for a probe to be inserted and for example all probes for statements can be inserted in a batch. Eager probes are typically used in combination with overriding the `InstrumentableNode.findProbe()` method.
39
39
* GR-32682 Added detection of boxing overloads to support state sharing and better boxing elimination. See `Specialization#rewriteOn` for details.
40
+
*`TruffleSafepoint#poll(Node)` does not require a non-null location anymore. However, it is still recommended to always pass a location node, if available.
41
+
* GR-57838 Added `InternalResource#unpackResourceFiles(Path, Path, Path, Predicate)` to allow filtering of resources to unpack.
40
42
41
43
## Version 24.1.0
42
44
* GR-43839 Added optional parameter to TruffleString.ByteIndexOfCodePointSetNode to choose whether the node may calculate the input string's precise code range.
0 commit comments