Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Projects loaded from arbitrary URIs #21

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

HT154
Copy link
Contributor

@HT154 HT154 commented Feb 26, 2024

Builds on apple/pkl#255 to allow fully in-memory evaluation of Pkl codebases using projects.

  • In EvaluatorOptions, replace ProjectDir with ProjectBaseURI (API breaking)
  • WithResourceReader and WithModuleReader now append : to the scheme when appending to the allow-lists
  • Correct typo in DeclaredProjectDepenedencies (API breaking)
  • Add DEVELOPMENT.adoc with instructions on how to debug the pkl server subprocess
  • Miscellaneous doc comment clarifications

* In `EvaluatorOptions`, replace `ProjectDir` with `ProjectBaseURI` (API breaking)
* `WithResourceReader` and `WithModuleReader` now append `:` to the scheme when appending to the allow-lists
* Correct typo in `DeclaredProjectDepenedencies` (API breaking)
* Add DEVELOPMENT.adoc with instructions on how to debug the `pkl server` subprocess
* Miscellaneous doc comment clarifications
@HT154 HT154 marked this pull request as ready for review February 26, 2024 23:41

= Pkl Go Development Guide

== Debugging the Pkl Server

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HT154 Does this work generally for debugging Pkl? I was just finding myself yesterday a bit annoyed at not being able to put breakpoints in Pkl sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For debugging "regular" pkl eval invocations, you don't need to fuss with this, you can do it straight from intellij by finding the entrypoint (pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt) and starting to run/debug from the main function. You can also modify the run configuration in that menu to pass CLI args, env vars, etc. as needed.

The approach documented here does work for general debugging as well, but it's required for debugging pkl server because the host process (eg. via pkl-go) currently must spawn the pkl process.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's very cool, thanks Josh!

@HT154
Copy link
Contributor Author

HT154 commented Jun 5, 2024

@bioball Is this good to merge now that apple/pkl#486 has merged?

@bioball
Copy link
Contributor

bioball commented Jun 5, 2024

@HT154 yup--we're going to do a release soon so I'll get this in.

Copy link
Contributor

@bioball bioball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bioball bioball merged commit 1ccec69 into apple:main Jun 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants