Commit Graph
100 Commits
Author SHA1 Message Date
Daniel Chao 99c2d84c43 Fix enforcement of const member access inside methods (#1945) 2026-10-30 16:57:49 +00:00
Daniel Chao dd026c7023 Minimize thrown IllegalStateException when profiling (#1931)
Sometimes we see a thrown IllegalStateException when CPU profiling,
where the underlying cause is a ConcurrentModificationException in
the underlying GraalVM internals.

This attempts to minimize the chances of this exception being thrown
by starting proiling after the evaluator and its context have been
created.
2026-10-22 09:44:10 -07:00
Daniel Chao 3f5797de6f Fix changelog links (#1929) 2026-10-21 15:32:55 -07:00
Daniel Chao ac0d9f1d31 Run GitHub release in parallel with Maven (#1928) 2026-10-21 15:09:53 -07:00
Daniel Chao a06684b2c0 Improve error message thrown for "cannot instantiate" (#1916)
If the parent comes from an implicit node (e.g. read super entry node),
Pkl will currently bury its source section when rendering the error
message.
2026-10-20 08:42:18 -07:00
Daniel Chao 08f0c3781b Improve error messages when typealiases fail to check (#1914)
This adds the typealias' usage site to the stack frame.
2026-10-19 12:34:04 -07:00
Daniel Chao 97c73e7c28 Fix qualified type resolution (#1915)
Fixes an issue where `GetModuleOwnerNode` resolves to levelsUp == 0,
but its enclosing owner is a parse-time invisible scope.
2026-10-19 12:23:38 -07:00
Daniel Chao ef5e34c210 Fix failing Windows build (#1912)
This test is failing, but is also moot now because file URIs now
forbid authority components.
2026-10-16 19:18:11 +00:00
9f79fe47da Replace VmObjectLike.iterateMemberValues() with VmObjectCursor (#1879)
Motivation:
- VmObjectLike.iterateMemberValues() is an internal iterator whose loop body is a Java lambda.
  It suffers from the following limitations:
  - `continue` and `break` cannot be used.
  - `return` becomes an (awkward) replacement for `continue` and `break`.
    It cannot be used to return from the enclosing method.
  - Mutating variables requires hoisting them (MutableBoolean, etc.).
  - Node.execute() calls are very slow because they are behind a Truffle boundary.
  - Callers of iterateMemberValues() do not specify what and how they want to iterate.
    This obscures the iteration code and makes it difficult (often impossible) to optimize.

Changes:
- Add interface VmObjectCursor, an external iterator that iterates over VmObject members.
  Its design is inspired by org.graalvm.collections.MapCursor.
- Add VmObjectCursor implementations specialized for different members, VmObject subclasses, and cursor options.
- Replace VmObjectLike.iterateMemberValues() with the following methods that return VmObjectCursor:
  - properties()
  - properties(CursorOption)
  - elements()
  - elements(CursorOption)
  - entries()
  - entries(CursorOption)
  - members
  - members(CursorOption)
- Replace all usages of iterateMemberValues() with one of the above methods.
  Before: object.iterateMembersValues((key, member, value) -> { if (member.isProp()) {...} });
  After : for (var cursor = object.properties(); cursor.advance(); ) {...}

Result:
- Iteration code is much simpler and clearer.
- Iteration code that calls Node.execute() is much faster because it is no longer behind a Truffle boundary.
- Other iteration code is potentially faster and can be better optimized in the future.

Co-authored-by: translatenix <119817707+translatenix@users.noreply.github.com>
Co-authored-by: Jen Basch <jbasch94@gmail.com>
2026-10-16 17:47:18 +00:00
Daniel Chao fe96e0b1b0 Bump Gradle to 9.8.1 (#1904) 2026-10-15 21:00:04 -07:00
f96fba00e1 Add a CPU profiler (#1823)
This introduces a way to run CPU profiling.

The profiler produces output in pprof format.

CLI users can enable CPU profiling via command line flags.
Profiling is otherwise not offered as an API.

Co-authored-by: Jen Basch <jbasch94@gmail.com>
Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2026-10-15 15:57:55 +00:00
Daniel ChaoandJen Basch d062312df9 Add sourceBundle task to download and prepare source bundles (#1902)
* Add tasks to generate source jars for java executables

* native source bundles

* source bundles in separate plugin

* Wire up sourceBundle task

* Produce bundles on a per-variant basis (Java fat jar, each native variant)
* Introduce `pklNativeSourceBundle` and `pklJvmSourceBundle` plugins for handling fat jar vs. GraalVM bits
* Download compiled classes list, and exclude Java sources for executable stuff specifically
* Include native sources when appropriate (GraalVM, JDK, zlib, musl, libpkl)

---------

Co-authored-by: Jen Basch <jbasch@apple.com>
2026-10-14 10:03:45 -07:00
Daniel Chao 88a50d167e Add support for customizing spring boot ConfigurationProperties (#1897)
This adds an option which allows users to control exactly how
`@ConfigurationProperties` annotations are attached to classes.

This helps when:

* Spring Boot users don't have a single root class, but multiple
  classes that are injected in disparate places
* Pkl's module structure doesn't match the resulting `.properties`
  layout
2026-10-08 20:42:59 +00:00
Daniel Chao f973fd6717 Change how VmValueRenderer renders Typed values (#1412)
This changes it to render the qualified name instead of the simple name.

* Module classes render the module name
* Classes within module render the module name and the class name joined by `#`
* Rendering of members of `pkl:base` does not change

For example:

* `new k8s.core.v1.Service {}` instead of `new ModuleClass {}`.
* `new k8s.core.v1.Service#ServiceSpec {}` instead of `new ServiceSpec {}`
* `new pkl.Project {}` instead of `new ModuleClass {}`

This affects the following:

* `toString()`
* `trace()`
* Error messages
* REPL
2026-10-08 13:32:26 -07:00
Daniel Chao 1a3d7a1a76 Produce compiled classes list (#1898)
This adjusts Gradle logic so that it produces a list of compiled classes
in each of the various native image builds.
2026-10-06 15:18:20 -07:00
Daniel Chao dbcecd9677 Fix decoding of pkl-binary into Java Pattern (#1895)
Patterns that originate from the language runtime will add
`Pattern.UNICODE_CHARACTER_CLASS | Pattern.UNICODE_CASE` as implicit
regex flags, so we need to do the same on the binary decoding side.
2026-10-05 09:09:30 -07:00
Daniel Chao ba25f4820c Perf improvements for String.endWith(Regex) (#1884)
* Compute a derived regex expression with `\z` anchor
* Ensure derived regex can't be messed up with comments (in extended mode) or quote start

Follow up to #1880
2026-10-05 09:09:03 -07:00
Daniel Chao 82fe176c69 Improve cases where type nodes can turn into TypeNode.UnionOfStringLiterals (#1875)
This adds logic to UnresolvedTypeNode to create a `UnionOfStringLiterals`
type node if a member is a typealias who is a string or a string literal union.

Also, this fixes an issue where marking a duplicate string literal with the
default marker throws an index out of bounds exception.
2026-10-02 09:16:25 -07:00
Daniel Chao b8c7a42318 Make typechecking more PE friendly (#1871)
This makes various improvements to help truffle do partial
evaluation of code related to typechecking.

* Split `UnionTypeNode` into `UnionTypeNodeExploded` and
 `UnionTypeNodeLooped` to avoid gigantic graphs. This especially helps
  in the case of typealiases, because they are inlined into their usage
  sites.

* Move constraint-failure exception construction in
  `TypeConstraintNode` behind `@TruffleBoundary` helper methods
  instead of `transferToInterpreterAndInvalidate`, since building the
  exception is a rare, off-hot-path operation.

* Move `ClassNode`'s one-time class-initialization logic behind a
  `@TruffleBoundary` method (`initClass`), store `VmLanguage` as a
  field instead of recomputing it via `VmLanguage.get(this)`, and use
  `transferToInterpreterAndInvalidate` since class init never needs to
  re-run on the compiled path.

* Pass `VmLanguage` explicitly into `TypeTestNode` and `ClassNode`
  (via `AstBuilder`) rather than resolving it with
  `VmLanguage.get(this)` on a hot path.

* Fix various issues where the partial evaluator determines that a frame
  should have been materialized but was not.

* Pre-initialize call targets in `ObjectMember.setMemberNode()` and
  `FunctionLiteralNode` so the first invocation doesn't trigger a
  compilation invalidation.

* Fix truffle node tree issues (don't mark `@RootNode` as child,
  deepCopy instead of passing an already adopted node).

* Remove unnecessary interpreter transfers when throwing type mismatch exceptions
2026-09-30 07:16:54 -07:00
Daniel Chao d1e043be4e Make join call overriden toString() (#1872)
This changes the `join` method in `List`/`Set`/`Listing` to
call the overridden `toString()` method.

This is a breaking change, but is considered a bugfix.
2026-09-25 09:24:16 -07:00
Daniel Chao 43e132a383 Fix "unchecked or unsafe operations" warning in javac (#1874)
Fix this printed warning during java compilation:

"Note: Some input files use unchecked or unsafe operations. Recompile with -Xlint:unchecked for details"

* Add `-Xlint:unchecked` as a javac flag
* Fix the various warnings
2026-09-24 09:28:49 -07:00
Daniel Chao 119b1571bb Switch ad-hoc vmobject building to use VmObjectBuilder (#1873) 2026-09-24 07:32:30 -07:00
Daniel Chao d5a7dc021e Switch inferred new {} expressions in method args to using frame slots (#1857)
This changes the logic for inferring `new {}` expressions in method
arguments to using regular frame slots, instead of auxiliary slots.

Overall, this is a performance improvement: no looking up auxiliary slot
numbers, which makes this code much more PE friendly.

* At parse time, get or create a frame slot that holds the method
* Introduce `ArgInfo` record (preserve primitive int) over using `Pair`
* Remove unneeded `isImplicitNewExpr` method; this is not needed because
  we can just keep track of the method slot on the frame descriptor
  builder.
2026-09-22 12:12:57 -07:00
Daniel Chao cbffd6c114 Improve error message when amending a property with no value set (#1867)
Improve error message when amending a property with no value set

This decorates error messages with the amendment node.
2026-09-21 06:54:22 -07:00
Daniel Chao e0b3b87e19 Fix native image build (#1865)
PE code can't call `Object.equals`
2026-09-17 21:57:35 -07:00
Daniel Chao cec08c651e Optimize super property and super subscript nodes (#1853)
This adds cacheing to ReadSuper* nodes so that the same
node being executed can possibly re-use a previously cached value.
2026-09-17 20:46:03 -07:00
Daniel Chao d0de24b85b Avoid using Object.toString() for in-language API (#1850)
This changes code so that the in-language `toString()` doesn't use
Java's `Object.toString()`.
Additionally, the existing `toString()` implementation is switched over
to using `VmValueRenderer`, which does not force (leaves `?` in place of
unforced values).

This helps improve ergonomics when working on the language (can enable
automatically calling `toString()` on debug values).

Additionally, external tools might call toString(); for example,
Truffle's compiler sometimes will stringify node fields (e.g.
when -Dengine.CompilationFailureAction=Throw) is set.
2026-09-11 23:08:26 +00:00
Daniel Chao e3881f6149 Fix invalid prefix when generating spring boot config (#1862)
Fix invalid prefix when generating spring boot config

In Spring Boot, the prefix passed to `@ConfigurationProperties` must
be in "canonical form".

The presence of this annotation allows spring boot to directly inject
properties into a class, but is not actually needed.

The correct behavior here is to omit this annotation if the property
name does not match Spring Boot's canonical form.
2026-09-11 15:49:04 -07:00
Daniel Chao 9b52a4fd82 Fix CI on Windows (#1861)
Fix bad assertion: `IoUtils.getSystemModuleCacheDir()` uses the actual
OS env, but the test hard-codes `isWindows` to false.
2026-09-11 11:09:37 -07:00
Daniel Chao 8fba228790 Fix failing test on Windows (#1858) 2026-09-10 21:31:19 -07:00
Daniel Chao 90245589b6 Improve documentation on netRcHeaders method (#1854) 2026-09-09 15:30:08 -07:00
Daniel Chao 713adac824 Make generator nodes more PE friendly (#1844)
* In GeneratorWhenNode, need to move individual iterations into their
  own methods so that the @ExplodeLoop sees a constant number of
  iterations whenever that method is called.
* In the other nodes, the lambda passed to
  `forceAndIterateMemberValues` needs to capture the materialized frame,
  not the virtual frame.
2026-09-08 15:11:10 -07:00
Daniel Chao 92b26aca17 Optimize annotations without object bodies (#1843)
This skips some unnecessary steps when evaluating annotations that
have no attached object bodies by returning an EmptyObjectLiteralNode
instead of a PropertiesLiteralNode
2026-09-02 13:04:26 -07:00
Daniel Chao 0035199176 Improve partial-evaluation when amending null parents (#1836)
GraalVM's partial evaulator can't handle recursive calls into the same
node.

The current implementation around evaluating `VmNull` as a parent causes
the partial evaluator to bail out, leaving Pkl stuck in interpreter
mode.

This rewrites the various object literals to add individual
specializations for each type of default value we can see from a VmNull
parent.

Also:
* Fix `isTypeObjectClass` impl
* Fix bug when amending with generator object literal node with object params
2026-09-02 18:18:55 +00:00
Daniel Chao 2c2f50113d Make enclosing frame lookup more PE friendly (#1842)
The truffle compiler currently _always_ bails out of compilation for
`VmUtils.getFrame()` calls, because it determines that some branch
of this code can possibly return a materialized frame.

This adjusts the code so that the hot path (levelsUp == 0)
does not touch `VmUtils.getFrame()`, and avoids unnecessarily
materializing the frame.
2026-09-02 10:01:25 -07:00
Daniel Chao 9f28c1cb11 Make listing/mapping typecasts more PE-friendly (#1837)
This rewrites the listing/mapping typecast nodes to be more friendly
to partial-evaluation.

This is because the compiler bails out of deeply recursive calls.
2026-09-02 10:00:59 -07:00
Daniel Chao adee565a8c Mark protobuf module as deprecated (#1778)
This moves the protobuf module from experimental to deprecated

Rationale:

* This is very seldom used, if used at all
* Not fully fleshed out (this really should be paired with a protoc-gen-pkl, which doesn't exist)
* There is a ProtoJSON wire format that we can already render to
2026-09-02 09:26:51 -07:00
Daniel Chao 1208fa9438 Improve reading of const members (#1835)
The previous implementation can cause the JIT compiler to permanently
bail out when reading const memebrs.
2026-08-28 09:18:56 -07:00
Daniel ChaoandFlorin Ungur 6551a59f9e Use XDG base directories and Known Folders on Windows (#1809)
This changes logic that previously read/wrote from `~/.pkl` to use
XDG base directories (all OSes), and Known Folders locations on Windows.

For example, Pkl will look for `settings.pkl` in:

1. `$XDG_CONFIG_HOME/pkl/settings.pkl`
2. `%APPDATA/pkl/settings.pkl`
3. `~/.pkl/settings.pkl`
4. Path pkl/settings/pkl within `$XDG_CONFIG_DIRS`
5. `/etc/xdg/pkl/settings.pkl`

---------

Co-authored-by: Florin Ungur <florin@florinungur.com>
2026-08-20 21:50:24 +00:00
Daniel ChaoandIslon Scherer 4dd37219c0 Fix name resolution of types in constraints (#1826)
This fixes an issue where type names are resolved incorrectly
in typealias constraints.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2026-08-19 11:10:32 -07:00
Daniel Chao 99c9f53063 Remove community.adoc page (#1820)
This is being moved to pkl-lang.org
(see https://github.com/apple/pkl-lang.org/pull/172).
2026-08-10 11:23:24 -07:00
Daniel ChaoandIslon Scherer c5896d76d0 Split libpkl libraries between shared and static libs (#1812)
This adds a `libpkl-static.pc` so pkg-config users can link either
statically or dynamically via `pkg-config --libs libpkl`, or
`pkg-config --libs libpkl-static`.

Additionally, this fixes an issue where the replace tokens wasn't
doing anything, leaving the `@version@` token intact in the archive.

Additionally, this adds an `-install_name` when building the dylib for macOS.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2026-08-07 15:47:16 +00:00
Daniel Chao 417c08ae11 Fix various issues in libpkl (#1805)
* Fix possible SIGSEGV from host process.
   - Require that the same `pkl_exec_t` be used in the same OS thread; returning meaningful error if this fails
* Remove `System.exitProcess(1)` logic in NativeTransport; this would kill the host process too and isn't an appropriate action for a received ProtocolException
* Allow multiple calls to pkl_init without pkl_close; this limitation doesn't really make any sense
* Prefer calling methods defined in graal_isolate.h, instead of creating the same method via CEntryPoint
* Add a CMakeLists.txt so that CLion can follow the code and provide proper diagnostics
* Improve doc comments; describe params as either in or out
2026-07-31 16:23:37 +00:00
043f0e129b Add documentation for libpkl (#1801)
This adds a new Antora module for libpkl, and updates the language
bindings documentation.

Co-authored-by: Jen Basch <jbasch94@gmail.com>
Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2026-07-30 17:24:27 +00:00
Daniel Chao a55a3d7c33 Improve evaluation of typealiases (#1796)
This simplifies the resolution of names in typealias constraints.
This removes the existing logic around swapping out the frame's
owner/receiver, and instead favors resolving the variable at parse time.

* During variable resolution, create read variable nodes that read off of
  a receiver node
* Introduce `GetTypeAliasModuleNode` that provides the typealias's
  enclosing module
* Inject the enclosing module during typealias instantiation
2026-07-30 17:22:45 +00:00
Daniel Chao f6107b6e86 Fix libpkl and windows builds (#1799)
* Fix issue where linker can't find object files
* Fix issue where macOS libpkl builds time out due to exhausting host resources
2026-07-28 23:32:19 +00:00
Daniel Chao 79dd95c4e6 Fix deploy build (#1798)
* Fix issue where the DeployJob and GithubRelease jobs download
  artifacts using a glob that only matches one artifact
* Make NativeImageBuild task only produce outputs as declared by build;
  ensure there's no build_artifacts.txt, sources/ dir, etc.
2026-07-28 20:42:50 +00:00
Daniel Chao be03023499 Fix snippet test mismatch between hotspot and native test (#1797) 2026-07-28 18:18:36 +00:00
67df676359 Introduce C library for Pkl (#1238)
This uses native-image to generate a C library for Pkl.
This generated library from native-image is wrapped with our own library,
in `pkl.h`.

This produces a static and a dynamic library for each os/arch variant
that Pkl currently supports.

Co-authored-by: Kushal Pisavadia <kushal.p@apple.com>
Co-authored-by: Jen Basch <jbasch94@gmail.com>
Co-authored-by: Islon Scherer <i_desouzascherer@apple.com>
2026-07-25 04:15:26 +00:00
Daniel Chao 2242cc9c82 Fix variable resolution of object body params (#1788)
Fixes a regression introduced in Pkl 0.32.
2026-07-22 13:04:36 -07:00
Daniel Chao 03792be984 Add more third party licenses (#1784)
Some new third-party libs ended up in our distributions, but we didn't
add them to our third party notices.
2026-07-17 18:59:11 +00:00
Daniel Chao 3b5e9df0da Migrate Gradle delegated properties (#1782)
There were some more that we missed last time around
2026-07-16 15:41:28 -07:00
Daniel Chao 60b0d86b5f Fix eval -x of local members (#1760)
This fixes a regression where local members cannot be seen by the
expression evaluator.

Because variable are now parse-time resolved, this builds a truffle node
by first constructing a synthetic module of all defined local members,
and calls AstBuilder on this synthetic module first.
2026-07-11 00:03:15 +00:00
Daniel Chao 7a7f3abc50 Migrate Gradle deprecations (#1745) 2026-07-08 12:05:19 -07:00
Dan Chao 25d86db416 Update changelog with release notes link 2026-07-08 10:29:48 -07:00
Dan Chao 997cfc9ae2 Start next dev iteration 2026-07-08 10:29:48 -07:00
Dan Chao 9916c23cfc Prepare 0.32.0 release 2026-07-08 10:29:48 -07:00
Daniel Chao c3d570c769 Fix docsite (#1740) 2026-07-08 09:45:07 -07:00
Daniel Chao 7499a89d83 Add 0.32 release notes (#1699)
This adds release notes for the 0.32 release
2026-07-08 09:38:37 -07:00
Daniel Chao 010d971af0 Add tests for empty IntSeq iteration (#1739) 2026-07-08 06:37:56 -07:00
Daniel Chao bd83e29641 Normalize asset paths in local dependencies (#1737)
This changes local asset path resolution so that `..` segments at the
dependency root just resolves to the dependency root.

This makes import resolution work the same between local and remote dependencies.
2026-07-08 05:43:36 -07:00
Daniel Chao 2ec62c99a7 Enforce stricter rules on reference access (#1718)
This changes the following:

1. If given a union type, the member must exist on each member of that type
2. If accessing a member off `Reference<D, Null>`, give a `Reference<D, Null>`

Also:
* Improve error messages thrown during member access.
* Add test around accessing members off of a function type
2026-07-06 19:24:14 -07:00
Daniel Chao 3fc97d8dad Allow projectpackage: resource reads by default in Gradle plugin (#1735)
Fix an inconsistency: they are allowed as imports, but not reads.
2026-07-06 14:41:52 -07:00
Daniel Chao eaf73af247 Improve thread safety for pkl:base (#1719)
Stdlib modules are singletons that are shared across multiple evaluators.
This improves thread safety by evaluating its `output.bytes` during
initialization, which initializes truffle nodes (e.g. TypeTestNode),
and also initializes the member cache of the module output of `pkl:base`
2026-07-06 11:19:29 -07:00
Daniel Chao 2ec83198f5 Fix replacements of types nested within nested constraints (#1731)
Also, adjust tests
2026-07-06 08:58:56 -07:00
Daniel Chao 45912c504f Fix incorrect member links (#1723)
This fixes various incorrect member links in the stdlib.
2026-07-02 11:04:01 -07:00
Daniel Chao 139d1ae8ec Fix many editor diagnostics (#1707)
This addresses many IDE warnings resulting from the switch to JSpecify.

Also, this changes the behavior of exporting VmObject; there's no place
in our code that does not force a VmObject prior to export, so
the existing logic around handling nullable values has been removed.
2026-06-29 16:22:19 +00:00
Daniel Chao 742a8e88da Fix for-generator variable resolution in nested eager scope (#1706)
Fixes an issue around resolving for-generator variables in some cases
2026-06-29 09:07:51 -07:00
Daniel Chao 158f709ed4 Adjust doc comments on ref.pkl (#1693)
This adjusts the doc comments in ref.pkl

* Fix incorrect code snippets
* Clean up examples
* Remove some sections
* Make phrasing consistent with the rest of the stdlib
2026-06-25 21:31:54 +00:00
Daniel Chao f61a5cf541 Check if receiver is a module object in relativePathTo (#1650)
Closes #1649
2026-06-24 11:48:57 +02:00
Daniel Chao 1bf00b84ea Revert "Reject abstract members in non-abstract classes" (#1688)
The changes made in this commit are good, but we're going to kick this out
to the next release.
This is because:

1. There's a couple more issues around the `abstract` modifier that is not
implemented yet, and need design considerations
2. These are breaking changes, and we want to minimize the amount of breakages
for users.
3. The main branch is still the develop branch for Pkl 0.32

We will apply a re-revert of this commit after Pkl 0.32 is released.
2026-06-23 09:46:14 -07:00
Daniel Chao 15f089b275 Implement toString() on VmReference (#1692)
This is still needed right now, because some methods call through to
`toString()`.
2026-06-23 09:45:13 -07:00
Daniel Chao fc8fe86e5a Remove incorrectly placed index methods on Collection (#1681)
These methods aren't implemented in `Set`, and don't really make sense because `Set` types can't be accessed by index.

Note: although this removes methods, this actually isn't a breaking change:
1. Calling `Set.findIndex()` currently throws an error around "cannot invoke abstract method"
2. `List` and `Set` are the only subclasses of `Collection`.

The following code isn't breaking at runtime, although static analysis tooling (like our IDE plugins) will now flag this as an error:

```pkl
myCollection: Collection

idx = myCollection.indexOf(1)
```
2026-06-15 08:56:55 -07:00
Daniel Chao 84d2c32d10 Improve handling of frame slots (#1634)
This makes various improvements to the handling of frame slot vars, and
includes some bug fixes introduced by
https://github.com/apple/pkl/pull/1622

* Refactor SymbolTable to track for-generator and parameter slots in
each scope
* Execute let expressions in their own root node in some places
* Unify how frame slots are managed; they are all represented as
`FrameSlotVariable`, created in `AstBuilder`, and passed into
`SymbolTable`.
* Fix how let expressions are executed in custom this scopes (introduce
a new root node when needed)
2026-06-11 03:02:42 +00:00
Daniel Chao 27fe06c796 Fix errors around strings with lone high or low surrogates (#1673)
This fixes some errors around treatment of strings with lone high/low
surrogates.
2026-06-10 08:35:22 -07:00
Daniel Chao 1a1e1cfea9 Fix String.padStart/padEnd (#1672)
Fixes the following two bugs:

* Pads to incorrect string length
* Does not append full code point
2026-06-10 08:34:50 -07:00
Daniel Chao 44f8706616 Fix visiting element type node of Collection (#1675)
This is a bug in the visitor logic, but currently doesn't impact any
language behavior.
2026-06-10 06:53:26 -07:00
Daniel Chao ac822f11eb Improve handling of evaluator in multi-file output (#1670)
* Re-use same evaluator across output dirs
* Close evaluator after all files are written
2026-06-10 06:52:47 -07:00
Daniel Chao f6e3f5e00b Fix VmIntSeq.length (#1666)
This fixes an internal optimization.

No language-observable change results from this fix, so no tests are
introduced.
2026-06-10 06:52:25 -07:00
Daniel Chao 16a640ed80 Bump pkl.impl.ghactions to version 1.8.1 (#1668)
Updates pkl.impl.ghactions package to version 1.8.1
2026-06-09 09:28:22 +02:00
Daniel Chao 391329c1fa Fix test (#1667)
The previous PR (https://github.com/apple/pkl/pull/1637) got auto-merged
by mistake; there's a failing test here
2026-06-08 16:11:49 -05:00
Daniel ChaoandIslon Scherer d012285f7d Improve HTTP redirect following (#1637)
This implements HTTP redirect following ourselves.

The goal is:

1. All I/O is checked against `--allowed-resources` and
`--allowed-modules`, including HTTP redirects
2. HTTP rewrite rules can affect redirect following
3. HTTP headers can affect redirect following

---------

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2026-06-08 18:13:48 +00:00
Daniel Chao b993cc3bb1 Fix doIsEquivalentTo for IntMaskSlotTypeNode (#1664)
This fixes an internal optimization; doesn't result in a
language-observable change, so no test case is introduced.
2026-06-07 12:51:31 -07:00
Daniel Chao 1cc20b611f Revert configuration cache (#1659)
This reverts the commits that enabled Gradle's configuration cache
feature.

IMO: this feature is too hard to use. We don't know if a task is valid
for the configuration cache until it runs, and it's very hard to tell if
something is safe when authoring Gradle code.
For example, our publish tasks are currently failing; I don't know how I
would fix this without running the publish task again on my dev machine.

Also, some of our build scripts become more brittle because of this; for
example, see
https://github.com/apple/pkl/blob/bb07589eae0b3195a589559a3245cbc12c29b394/build-logic/src/main/kotlin/BuildInfo.kt#L291-L296
2026-06-05 23:31:40 +00:00
Daniel Chao bb07589eae Fix gradle configuration cache issues for gradle-compatibility (#1658) 2026-06-05 14:17:06 -07:00
Daniel Chao 01f8fcae7b Catch correct exception type in MultiplicationNode (#1652)
Closes #1651
2026-06-05 12:55:27 -07:00
Daniel Chao 41e012a0f0 Fix toRadixString on math.minInt (#1656)
Closes #1655
2026-06-05 18:27:03 +00:00
Daniel Chao aa01241068 Fix eager typecheck of Map (#1654)
Closes #1653
2026-06-05 11:24:00 -07:00
Daniel Chao 87ec8ee730 Enable Gradle configuration cache (#1646)
Enable the configuration cache feature in Gradle, and adjust various
pieces of build logic that aren't configuration cache compatible.
2026-06-05 11:05:19 -07:00
Daniel Chao 99cac1f886 Fix native build (#1636) 2026-06-02 15:57:52 -07:00
Daniel Chao 035ef0a789 Change loading of external readers (#1394)
This introduces breaking changes for external readers are loaded:

1. In PklProject, relative paths are resolved relative to the enclosing
PklProject file (make behavior consistent with how other settings work)
2. Make CLI flags blow away any settings set on a PklProject
3. Introduce a new `workingDir` property, which defaults to the
PklProject dir

The overall goal is to make this behavior consistent with how other
settings work.
For example, relative paths for other evaluator settings are already
relative to the project directory.
Additionally, in every other case, CLI flags will overwrite any setting
set within PklProject.
2026-06-02 18:02:52 +00:00
Daniel Chao c9f3823952 Touch ups around local members (#1633)
* Add assertion if ObjectMember key in cachedValues is not local (should never happen)
* Move test to snippet tests
2026-06-02 03:47:46 +00:00
Daniel Chao 7dd2bc67de Optimize let expressions as frame slot vars (#1622)
This introduces an optimization to write let expressions to frame slots
of the current frame, rather than transforming them into lambdas. As a
result, let expressions are _much_ faster to execute.
2026-06-01 16:53:30 -07:00
Daniel Chao 7c927b0a43 Fix deploy build (#1623)
Fixes the following error:

```
A problem was found with the configuration of task ':pkl-core:sourcesJar' (type 'Jar').
Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.
  - Gradle detected a problem with the following location: '/home/runner/work/pkl/pkl/pkl-core/build/generated/sources/baseModuleMembers'.

    
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    Reason: Task ':pkl-core:sourcesJar' uses this output of task ':pkl-core:generateBaseModuleMembers' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    
For more on this, please refer to https://docs.gradle.org/9.5.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
    Possible solutions:
94 actionable tasks: 76 executed, 18 from cache
      1. Declare task ':pkl-core:generateBaseModuleMembers' as an input of ':pkl-core:sourcesJar'.
      2. Declare an explicit dependency on ':pkl-core:generateBaseModuleMembers' from ':pkl-core:sourcesJar' using Task#dependsOn.
      3. Declare an explicit dependency on ':pkl-core:generateBaseModuleMembers' from ':pkl-core:sourcesJar' using Task#mustRunAfter.
```
2026-05-26 15:20:54 -07:00
Daniel Chao b2f005d11d Enable error-prone check for GuardedBy, fix errors (#1621) 2026-05-26 13:39:15 -07:00
Daniel Chao 72948e50fe Fix calls to string case api (#1620)
* Enable IntelliJ inspection for calls to `String.toLowerCase()` and
`String.toUpperCase()`
* Enable error prone check
* Fix all issues
2026-05-26 11:20:02 -07:00
Daniel Chao a1eea47b3f Restore @ThreadSafe and @Immutable annotations (#1613) 2026-05-22 15:58:09 -07:00
Daniel Chaoandodenix 95bcd6a463 Remove jsr305; switch GuardedBy to com.google.errorprone (#1611)
- Remove single usage of @immutable without replacement
- Remove HttpClient's usages of @threadsafe without replacement
- Replace javax.annotation.concurrent.GuardedBy
  with com.google.errorprone.annotations.concurrent.GuardedBy

Also:
- Remove redundant final modifiers from members of a final class

---------

Co-authored-by: odenix <self@odenix.org>
2026-05-22 14:15:18 -07:00
Daniel Chao a800072441 Fix native build (#1610)
Fix native executable build; there was a missing truffle boundary
2026-05-22 11:50:40 -07:00
Daniel Chao b070d56741 Remove public modifier on LazyHttpClient and RequestRewritingClient (#1609)
This introduces a test helper to expose configured HTTP settings, and
makes the underlying classes package-private again.
2026-05-22 10:17:26 -07:00