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
PR #494 introduced pkg/plugin/pklrun as the home for the project-aware pkl evaluator and pkl project resolve (with auto-resolve), and collapsed three duplicated newSafeProjectEvaluator helpers onto it. But pkl is still invoked directly from several other places that bypass pklrun — so there is no single source of truth for how formae runs the pkl binary (which binary, bundled vs PATH, error handling, auto-resolve).
This issue proposes finishing the job: route all pkl invocations through pklrun.
Current pkl-binary touchpoints outside pklrun
Direct exec.Command("pkl", ...):
Location
Call
Module
pkg/plugin/manifest.go:69
pkl eval -f json <manifest>
pkg/plugin (same module as pklrun)
pkg/plugin-conformance-tests/setup.go:161
pkl project resolve <dir>
pkg/plugin-conformance-tests (separate module)
pkg/plugin-conformance-tests/setup.go:251
pkl eval -x minFormaeVersion ...
pkg/plugin-conformance-tests
Plain pkl-go evaluators that spawn pkl from PATH (no bundled-binary selection):
root internal/schema/pkl/pkl.go no-project branches already use bundledPklCommand; the pkg/plugin ones do not.
Why it matters
Bundled-binary consistency. Root deliberately prefers the sibling-of-formae pkl (newer stdlib features). manifest.go runs at formae runtime to read installed plugin manifests but shells pkl from PATH — so it can pick up a different pkl version than the rest of the binary. Latent version-skew risk.
Add a no-project pklrun.Eval(path string, opts ...Option) (single-module eval, with WithPklCommand/WithEvaluatorOptions) and route pkg/plugin/manifest.go through it.
Route pkg/plugin/descriptors and pkg/plugin/testutil plain evaluators through pklrun (or expose binary selection so they share BundledPklCommand).
For pkg/plugin-conformance-tests (separate module): either have it depend on pkg/plugin/pklrun or replicate the thin command layer — decide based on the dependency direction we want for the conformance suite.
Summary
PR #494 introduced
pkg/plugin/pklrunas the home for the project-aware pkl evaluator andpkl project resolve(with auto-resolve), and collapsed three duplicatednewSafeProjectEvaluatorhelpers onto it. Butpklis still invoked directly from several other places that bypasspklrun— so there is no single source of truth for how formae runs the pkl binary (which binary, bundled vs PATH, error handling, auto-resolve).This issue proposes finishing the job: route all pkl invocations through
pklrun.Current pkl-binary touchpoints outside pklrun
Direct
exec.Command("pkl", ...):pkg/plugin/manifest.go:69pkl eval -f json <manifest>pkg/plugin(same module as pklrun)pkg/plugin-conformance-tests/setup.go:161pkl project resolve <dir>pkg/plugin-conformance-tests(separate module)pkg/plugin-conformance-tests/setup.go:251pkl eval -x minFormaeVersion ...pkg/plugin-conformance-testsPlain pkl-go evaluators that spawn
pklfrom PATH (no bundled-binary selection):pkg/plugin/descriptors/extract_schema.go:139(generatePklProject)pkg/plugin/testutil/verify.go:165(generatePklProject)internal/schema/pkl/pkl.gono-project branches already usebundledPklCommand; the pkg/plugin ones do not.Why it matters
pkl(newer stdlib features).manifest.goruns at formae runtime to read installed plugin manifests but shellspklfrom PATH — so it can pick up a different pkl version than the rest of the binary. Latent version-skew risk.conformance-tests/setup.gostill has its ownpkl project resolve— the exact pattern feat(pkl): auto-resolve PklProject deps via shared pklrun evaluator #494 removed elsewhere.Proposed direction
pklrun.Eval(path string, opts ...Option)(single-module eval, withWithPklCommand/WithEvaluatorOptions) and routepkg/plugin/manifest.gothrough it.pkg/plugin/descriptorsandpkg/plugin/testutilplain evaluators throughpklrun(or expose binary selection so they shareBundledPklCommand).pkg/plugin-conformance-tests(separate module): either have it depend onpkg/plugin/pklrunor replicate the thin command layer — decide based on the dependency direction we want for the conformance suite.Out of scope / related
pkl project resolvewrites (not yet tracked).Refs
pklrun)