Extension spawn: put Kaimon's active environment on JULIA_LOAD_PATH, not pkgdir #61
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
kahliburke/Kaimon.jl!61
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-extension-load-path"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Extension spawn: put Kaimon's active environment on
JULIA_LOAD_PATH, notpkgdirProblem
Every extension crashes on boot when Kaimon is installed from the registry (
pkg> app add Kaimon). From the extension log (slateextension, Windows, Julia 1.12.6, but the failure is platform-independent):Kaimon's dashboard shows the extension crash-looping:
Extension 'slate' crashed (was starting, exit=1, after ~7s)× 3 attempts.spawn_extension!builds the subprocess load path as:For a registry/app install,
pkgdir(Kaimon)is the depot package dir (~/.julia/packages/Kaimon/<slug>), which ships aProject.tomlbut noManifest.toml. That environment claims the nameKaimonduring load-path resolution (it is the project package), but without a manifest none of Kaimon's deps can be resolved — so the boot script'susing Kaimonfails and the extension exits. Users can't repair it in place either: depot package dirs are write-protected, soPkg.instantiate()against them dies withPermission denied(and the boot script's ownPkg.resolve()fails the same way).This only works today when Kaimon runs from a dev checkout, whose project directory carries an instantiated manifest.
Fix
Use the running instance's active environment for the load-path entry instead of
pkgdir. For an app install that's~/.julia/environments/apps/Kaimonand for a dev checkout it's the checkout project — both have instantiated manifests that resolve Kaimon and its deps. Fall back topkgdir(Kaimon)when the active project has no manifest:Base.project_file_manifest_pathalso honors versioned manifests (Manifest-v1.x.toml).Testing
Reproduced with
app add Kaimon+ a registered extension: before the change the extension crash-loops with the JSON resolution error above; with Kaimon's deps reachable through an instantiated environment on the load path, the extension boots and serves its tools.Related
The registered extension's own
--projecthas the same exposure:KaimonSlate.register_extension()defaultsproject_pathtopkgdir(KaimonSlate), which is likewise manifest-less for registry installs, and the boot script'sPkg.resolve()cannot write there. Filing separately since the right fix (Kaimon managing instantiated environments for extensions?) is a design call.Ah, isn't Julia package management fun? I'll take a look, thanks for the effort on this.