-
I want to use Pkl Packages in air-gapped environments. Currently I have a Project that depends on another Project, which in turn depends on a third one. graph LR
a[My Package]
b[Package B]
c[Package C]
a --depends on--> b --depends on--> c
This works fine... with internet access. Can I package my Project, or run Pkl in a way that allows me to define a mirror, or package the Project with its dependencies? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
AFAIK it is not possible to package dependencies. Running a mirror is also not supported (yet). However there is at SPICE for this at least: I am not sure if this is an option, but pkl caches it's dependencies. So if you can push that cache (~.pkl/ IIRC) to your environment, then you don't need internet connection. |
Beta Was this translation helpful? Give feedback.
-
One option right now is to use the cache dir as a poor man's vendoring mechanism. You can download all packages declared in your Something like this (this script requires jq) cat PklProject.deps.json \
| jq -r '.resolvedDependencies[] | select(.type == "remote") | .uri[7:] + "::sha256:" + .checksums.sha256' \
| xargs -I {} pkl download-package --no-transitive {} --cache-dir vendor Once you have that, you can If you're using the CLI for evaluation, you can also set the cache dir via the PklProject file. This means you don't need to specify amends "pkl:Project"
evaluatorSettings {
moduleCacheDir = "vendor"
} Does this work for you? |
Beta Was this translation helpful? Give feedback.
AFAIK it is not possible to package dependencies.
Running a mirror is also not supported (yet). However there is at SPICE for this at least:
apple/pkl-evolution#4
I am not sure if this is an option, but pkl caches it's dependencies. So if you can push that cache (~.pkl/ IIRC) to your environment, then you don't need internet connection.