Commit Graph

430 Commits

Author SHA1 Message Date
Dan Chao
8bd738ec0b Prepare 0.28.2 release 0.28.2 2025-04-17 08:27:51 -07:00
Daniel Chao
7569b96088 Add release notes for 0.28.2 (#1042) 2025-04-17 08:24:33 -07:00
Daniel Chao
ad131b5543 Adjust installation docs (#1010) 2025-04-16 21:17:58 -07:00
Pedro Piñera Buendía
640cc129db Document how to install pkl with Mise (#982) 2025-04-16 21:17:53 -07:00
Daniel Chao
1d14a750a5 Fix incorrect substring (#1028)
The relative path should be based off the module name prefix, not the
package name.
2025-04-16 21:09:18 -07:00
Jeroen Soeters
6a1d56bb4d Do not crash, but suggest '--multiple-file-output-path' when specifying a directory as output file (#1038)
When specifying a directory instead of a file for the output, pkl won't crash anymore, but instead output an error message, suggesting --multiple-file-output-path.
2025-04-16 21:09:12 -07:00
Kushal Pisavadia
0902cbc628 Build with m2pro.large instances, not macos.m1.large.gen1 (#1020)
* Update `com.circleci.v2` to `1.5.0` and `pkl.impl.circleci` to `1.2.0`

See:
- https://github.com/apple/pkl-pantry/pull/103
- https://github.com/apple/pkl-project-commons/pull/7

* Build with `m2pro.large` instances, not `macos.m1.large.gen1`
2025-04-16 21:09:03 -07:00
Daniel Chao
7717b702b2 Add optimization for generator bodies that don't introduce new members (#1013)
If a generator object literal doesn't add any object members, we
can simply use the parent in its place.

Co-authored-by: Kushal Pisavadia <kushi.p@gmail.com>
2025-04-16 21:08:55 -07:00
mbvissers
c5c0c20caa Fix typo in evolution-and-roadmap.adoc (#1031) 2025-04-01 11:55:39 -07:00
Dan Chao
fc1114fd2e Remove resources/ directory from executable dir 0.28.1 2025-03-03 09:44:24 -08:00
Dan Chao
2b24d2838c Run spotless apply 2025-03-03 09:23:27 -08:00
Dan Chao
917d110e46 Prepare 0.28.1 release 2025-03-03 09:16:48 -08:00
Daniel Chao
11cc9b96bd Add release notes for 0.28.1 (#1003) 2025-03-03 09:16:24 -08:00
Daniel Chao
ab9a231341 Allow native-image flags to be passed through from Gradle properties (#1001)
Allow other build environments (e.g. homebrew) to configure the native-image build without requiring source code changes.
2025-03-03 09:02:57 -08:00
Daniel Chao
cf18ce3d65 Fix shadow jar logic (#998)
Fix an incorrect relocation setting.

Also, add tests to start the shadow jar, and also to test the shadow jar settings.
2025-03-03 09:02:52 -08:00
Daniel Chao
a225258ebf Make Truffle use fallback runtime in Gradle plugin (#995)
Using native libraries in Gradle plugins is problematic; this adds some flags that causes Truffle to use a fallback runtime that avoids loading native libraries.
2025-03-03 09:02:46 -08:00
Daniel Chao
393d939a2c Add Kotlin version bump to breaking changes (#987) 2025-02-26 14:06:43 -08:00
Islon Scherer
52c2b29a04 change version to 0.28.0 2025-02-26 17:09:14 +01:00
Daniel Chao
cf889246fd Add release notes for 0.28 (#978)
Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2025-02-26 07:52:21 -08:00
Daniel Chao
fcce5c7e11 Replace dead links to ANTLR parser grammar (#973) 2025-02-21 08:26:49 -08:00
odenix
52a86d3f32 Untangle external reader code (#776)
- move the following classes into package externalreader:
  - ExternalModuleResolver
  - ExternalResourceResolver
  - MessageTransportModuleResolver (renamed to ExternalModuleResolverImpl, made package-private)
  - MessageTransportResourceResolver (renamed to ExternalResourceResolverImpl, made package-private)
- replace interface ExternalModuleResolver.Spec with record ExternalModuleReaderSpec
- replace interface ExternalResourceResolver.Spec with record ExternalResourceReaderSpec
- translate between messaging.ResourceReaderSpec and ExternalResourceReaderSpec (eliminates dependency from messaging on higher layer)
- translate between messaging.ResourceResolverSpec and ExternalResourceResolverSpec (eliminates dependency from messaging on higher layer)
- add ServerMessages.ExternalReader and translate between this message component and the PklEvaluatorSettings.ExternalReader API
- add ServerMessages.Proxy and translate between this message component and the PklEvaluatorSettings.Proxy API
- change type of CreateEvaluatorRequest.allowedModules/allowedResources from List<Pattern>? to List<String>?
  - removes a lot of code
  - should not need to create a Pattern object to send a message
- deprecate method evaluatorSettings.PklEvaluatorSettings.Proxy.create()
  - only seems useful internally, inlined

Co-authored-by: Dan Chao <dan.chao@apple.com>
2025-02-20 22:38:51 -08:00
Daniel Chao
31c80e792e Ensure findOrAddAuxiliarySlot is not called during compilation (#969)
Fixes an issue that is preventing the native executable from building
2025-02-20 08:09:22 -08:00
Artem Yarmoliuk
50cfb1c962 Bump clikt to 5.0.3 (#947)
This bumps Clikt from version 3 to version 5, which, among other things, improves
the help text formatting with colors.

Also: 
* Add `--version` flag to pkldoc, pkl-codegen-java, pkl-codegen-kotlin
* Add help text to pkldoc, pkl-codegen-java, pkl-codegen-kotlin
2025-02-19 15:18:02 -08:00
Daniel Chao
643c6f5a76 Execute typechecks eagerly when within a constraint (#964)
This changes the language to check all types eagerly when within a type constraint.

This addresses two regressions in the language:

1. Type constraints are too relaxed (listing/mapping parameters may not be checked)
2. Failing type constraints hide members that were forced during execution of the constraint
2025-02-19 12:51:52 -08:00
Daniel Chao
227f0637fc Rename package ast to syntax (#968) 2025-02-19 10:57:41 -08:00
Vladimir Matveev
baa34a6dd1 Added support for an alternative current dir mode in pkldoc (#824)
Some systems have trouble with handling symlinks, which breaks the current directory links created by Pkldoc. In this PR, we add an alternative mode which creates a full copy of the latest published version contents in the current directory instead.

Co-authored-by: Dan Chao <dan.chao@apple.com>
2025-02-19 08:52:32 -08:00
Islon Scherer
2ffd201172 move handling of strings to parser (#962) 2025-02-19 17:19:48 +01:00
Daniel Chao
ee23a8c3f4 Make CliktCommands classes (#963)
Missed these three classes.

This prevents the AOT compiler from statically initializing CLI argument
default values (like working dir).
2025-02-18 08:29:59 -08:00
Daniel Chao
28b128f86f Run spotless formatting (#958)
When we updated spotless's Java and Kotlin formatter, we changed the underlying
formatting rules.
However, due to spotless ratcheting, these formatting changes don't get applied unless a file
gets touched in a commit.

To avoid future PRs introducing lines of change that aren't related to the intention of the PR,
this is a one-time format of all files.
2025-02-17 07:36:43 -08:00
Islon Scherer
d270829ed3 fix calculation of spans in parser (#957) 2025-02-15 12:11:55 +01:00
Michael Case
350b71a634 Fix incorrect glob example (#956)
Correct glob docs and use realistic file extensions.
2025-02-14 13:31:04 -08:00
Daniel Chao
28df90527b Add docs for various keywords (#955) 2025-02-14 13:30:22 -08:00
Daniel Chao
eabfcdd333 Allow -DcommitId flag when building Pkl (#954)
This is to allow building Pkl in environments that don't have access
to git.
2025-02-14 09:36:47 -08:00
Daniel Chao
1a4f9ee72e Improve handling of errors when analysis fails (#948)
Modules that cannot be loaded for one reason or another now cause a Pkl Exception,
with the offending import highlighted as part of the stack trace.
2025-02-13 14:00:48 -08:00
Daniel Chao
65cf3237b7 Add parser benchmarks (#953)
The current benchmark is not too useful now that we have a linear parser.

This changes the benchmarks to parse the standard library, and also the language snippet tests.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2025-02-13 11:22:31 -08:00
Daniel Chao
d00d0ba79f Update dependencies (#938) 2025-02-13 10:19:24 -08:00
Josh B
f56b1bb84f Test and document supercalls using the same method/property name (#943) 2025-02-12 21:10:37 -08:00
Islon Scherer
b526902bf0 Replace ANTLR with hand-rolled parser (#917)
Co-authored-by: Kushal Pisavadia <kushi.p@gmail.com>
Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
2025-02-12 18:11:00 +01:00
Daniel Chao
7c3f8ad261 Improve documentation about Set/Map ordering (#944)
The language reference and stdlib are both slightly incorrect;
maps and sets are ordered when iterated on, but unordered in terms of
equality.
2025-02-12 06:43:51 -08:00
Daniel Chao
7ed710c226 Make commands classes instead of objects (#946)
Making these classes caused native-image to statically initialize
them at build time, which included CLI argument default values
(like working dir).

This turns them back into classes.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2025-02-11 06:38:19 -08:00
Josh B
ad99e4a7f7 Correctly set allowed modules/resoures when external reader scheme contain regex control characters (#941) 2025-02-07 14:03:40 -08:00
Daniel Chao
e85e888f92 [docs] Add documetation about release/evolution/roadmap (#937) 2025-02-05 11:24:41 -08:00
Daniel Chao
3b6fbdff15 Remove usages of VmFunction#apply(Object) (#936)
These call sites should use `ApplyVmFunction1Node` instead.
2025-02-05 09:18:42 -08:00
Daniel Chao
9784cd7265 Turn CLI commands into objects, self register subcommands (#935)
Usages of `RootCommand` no longer need to initialize a new instance, nor register subcommands.
2025-02-05 09:18:23 -08:00
Daniel Chao
aadcccd0fc Run a simple eval script (#928)
Execute `1 + 1` instead of eval'ing `circleci.pkl` (might cause
spurious failures due to requirement on network connection).
2025-02-04 07:21:57 -08:00
Daniel Chao
9075ca0729 Fix native gvm ci (#930)
* Update GraalVM checksum
* Fix: download JDK on macOS

Signed-off-by: Sam Gammon <sam@elide.dev>
Co-authored-by: Sam Gammon <sam@elide.dev>
2025-02-04 07:21:42 -08:00
Sam Gammon
5e12dfb200 fix: upgrade ci jobs to jdk 21 (#926)
Signed-off-by: Sam Gammon <sam@elide.dev>
2025-02-03 17:17:07 -08:00
Sam Gammon
408242a44c Upgrade GraalVM and Truffle, set up multi-JDK testing, bump development Java to 21 (#876)
This updates the GraalVM and Truffle libraries to 2024.1.2.

This also updates the build logic to compile Java sources using Java 21, due to some compile-only dependencies within GraalVM/Truffle using class file version 65. However, the produced artifact is still compatible with Java 17.

This also changes the Gradle build logic to use toolchains, and to test the Java libraries with JDK 17 and 21.

One consequence of this change is that Truffle is no longer shaded within the fat jars.

feat: support for jvm21+ toolchain
feat: support for gradle toolchains
feat: pass -PnativeArch=native to build with -march=native
test: multi-jdk testing support
test: support for jvm-test-suite plugin
test: add tasks to run jpkl eval on multiple jdks
test: make jdk exec tests respect multi-jdk flags and ranges
fix: remove mrjar classes at >jvm17 from fatjars
fix: use jdk21 to run the tests (needed for Unsafe.ensureInitialized)
fix: truffle svm dependency is required after graalvm 24.0.0
fix: warnings for gvm flag usage, renamed truffle svm macro
fix: build with --add-modules=jdk.unsupported where needed
fix: don't use gu tool for modern graalvm versions
fix: catch Throwable instead of deprecated-for-removal ThreadDeath
chore: buildinfo changes for JVM targets, toolchains
chore: enforce testing at exactly jdk21
chore: enforce build tooling at jdk21+
chore: bump graalvm/truffle libs → 24.1.2
chore: toolchains for buildSrc

Signed-off-by: Sam Gammon <sam@elide.dev>
2025-02-03 14:57:40 -08:00
Stanley Cheung
8cfd2357c6 Fix typo in tutorial part 2 (#921) 2025-01-31 07:53:22 -08:00
Sam Gammon
3fa935b390 fix: downstream native-image builds (#914)
SVM (SubstrateVM) compile configuration classes
must be included within the `cli` jar to prevent
downstream `native-image` builds from failing.

Fat JARs cannot be used with `native-image`, so
these classes can still safely be excluded here.

Fixes and closes apple/pkl#907

Signed-off-by: Sam Gammon <sam@elide.dev>
2025-01-29 20:31:05 -08:00