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 distributing pods as manifest libraries #1390

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

cap10morgan
Copy link
Contributor

@cap10morgan cap10morgan commented Oct 10, 2022

Please answer the following questions and leave the below in as part of your PR.

@cap10morgan
Copy link
Contributor Author

Relies on these changes to the pods submodule: babashka/pods#58

@cap10morgan
Copy link
Contributor Author

I documented the various moving parts of all this in doc/pod-libraries.md

@cap10morgan
Copy link
Contributor Author

Looking into the failing tests now

@borkdude
Copy link
Collaborator

PR pushed to this branch with corresponding PR in pods:

https://github.com/babashka/babashka/tree/cap10morgan-feature/manifest-libraries

base-path (.replace ns-str "." "/")
manifest-paths (loop [ns (str/split ns-str #"\.")
paths []]
(let [path (str/join "/" (conj ns "pod-manifest.edn"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we can make paths be calculated lazily and use concat below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, probably. Not sure if it would be worth it or not since the number of these generated per namespace should be pretty small (number of dot-separated ns components minus one). But I'd happy to implement it if you think it's worth it.

@borkdude
Copy link
Collaborator

borkdude commented Oct 12, 2022

What if I wanted to expose clj-kondo.core in my library for clj via normal code but for bb via the pod, so people can use the same namespace?

Then the manifest has to live in /clj_kondo/pod-manifest.edn - but what if there are more libs that have the clj_kondo prefix?

It feels a little bit brittle. What I expected instead (in previous discussion I tried to convey this) is that we would have clj_kondo/core.pod.edn for example, so it becomes unambiguous. Yes, you would have to insert the manifest potentially n times, each time for every namespace, but to circumvent that, you could support a redirection in the .pod.edn to clj_kondo/clj_kondo.pod.edn or so which then contains the complete manifest.

@borkdude
Copy link
Collaborator

Another thing to consider: how would people force pre-downloading of pods in this situation for packaging for lambdas?

@borkdude
Copy link
Collaborator

An illustrating example of what I'm saying in the first comment:

https://github.com/borkdude/quickdoc/blob/a94ab9d46b0e5f787096b49a653b39e9ed3fd47a/src/quickdoc/api.cljc#L4-L14

There I'd love to just be able to require clj-kondo.core and use it like in clojure, but through the pod.

@cap10morgan
Copy link
Contributor Author

Another thing to consider: how would people force pre-downloading of pods in this situation for packaging for lambdas?

Yeah, that's a good question. I'll have to explore that a little. My first thought is to do something similar to uberscripts and run all of the top-level ns and require forms in bb prepare.

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

2 participants