#14406·graal

Truffle compiler calls `toString()` on node fields during PE compilation

Author: bioballCreated Sep 8, 2026Updated Sep 15, 2026
Labelsbugtruffle

Describe GraalVM and your environment :

  • GraalVM version or commit id if built from source: 25.2.4
  • CE or EE: CE
  • JDK version: JDK25
  • OS and OS Version: macOS Tahoe
  • Architecture: Apple Silicon
  • The output of java -Xinternalversion:
OpenJDK 64-Bit Server VM (25.0.4+7-jvmci-25.2-b20) for bsd-aarch64 JRE (25.0.4+7-jvmci-25.2-b20), built on 2026-07-21T23:37:10Z with clang Apple LLVM 15.0.0 (clang-1500.3.9.4)

Have you verified this issue still happens when using the latest snapshot? No

Describe the issue When inspecting the compiler output (e.g. using -Dpolyglot.engine.TraceCompilation=true -Dengine.CompilationFailureAction=Throw), I see that the compiler thread is throwing exceptions coming from calling into the Pkl language (resulting in calls into execute() on my nodes).

In debugging this further, it looks like this is because the compiler is calling .toStriong() on node fields. In Pkl, a runtime object's toString() will possibly do evaluation.

Code snippet or code repository that reproduces the issue Repo: https://github.com/apple/pkl

Steps to reproduce the issue N/A

Expected behavior The compiler graph shouldn't be trying to execute my language.

I think a reasonable outcome from this issue can simply be to include documentation that the truffle compiler might call toString() on node fields.

Additional context Slack thread here: https://graalvm.slack.com/archives/CNQSB2DHD/p1788539943316009