Fork me on GitHub
#polylith
<
2022-09-08
>
Eugen03:09:35

this seems like an interesting thread regarding visualisations of apps / components . I know poly tool has some basic visualisation in terms of deps . does it have more? in architecture channel

Daniel Gerson10:09:53

So the way I'm using shadow-cljs with polylith is to not use projects/deliverableA/deps.edn to define dependencies and instead use https://github.com/dmg46664/problems/blob/main/01_shad_parent_root/projects/deliverableB/shadow-cljs.edn (example proj) to define dependencies and source paths. This does mean that the the poly tool is unaware of the project dependencies unless I duplicate them in an unused project deps.edn. The current constraints are: 1) The poly tool is unaware of shadow-clj.edn so is unable to reason about dependencies unless information is duplicated. 2) shadow-cljs is unable to be run from a parent directory like clj is able to and it hard codes the location of shadow-cljs.edn 2.1) --config-merge doesn't work delegating to a lower directory as it can only merge into a known build and you cannot add a build. (perhaps if there is a root shadow-cljs.edn with all the project builds, but specifics are delegated down, this could work??) 2.2) shadow-cljs cannot reference aliases in a parent dir deps.edn 3) :local/root dependencies work with shadow delegating to deps but only for loading src not loading shared test code. 4) deps.edn has deprecated referencing outside project directories "../xxx" and so polycan only work either by symlinks or a root deps.edn. In order to allow everything to work together either poly must be aware of shadow-cljs or shadow-cljs needs to work more like clj. It would be nice to run something like yarn shadow-cljs -A:parent-alias --parent-deps "../" compile script or from a root directory run clj -A:shadow-cljs:deliverableB watch script . However in the mean time I'm happy duplicating shadow-cljs.edn and deps.edn for my actual project. Thought I'd just document my experience. cc: @thheller

Daniel Gerson12:09:13

My question is 2.1 is not appropriate, because it would still force all projects to share all dependencies. I had just thought of that approach while writing this up 😅

thheller17:09:56

> shadow-cljs is unable to be run from a parent directory like clj is able to

thheller17:09:19

clj also only accepts a local deps.edn?

thheller17:09:39

> shadow-cljs cannot reference aliases in a parent dir deps.edn

thheller17:09:56

deps.edn cannot reference aliases of other deps.edn

thheller17:09:12

> deps.edn has deprecated referencing outside project directories "../xxx" and so polycan only work either by symlinks or a root deps.edn.

thheller17:09:20

whats wrong with :local/root?

thheller17:09:10

I really don't know enough about polylith to comment much. you can just use clj to run shadow-cljs, there is no need to use the shadow-cljs command if it doesn't do what you need it to do

Daniel Gerson12:09:05

Thanks for your responses! I need to make sure of a few things before responding. 🙏

Eugen22:09:15

I'm trying to run polylith Validate Workflow from https://github.com/polyfy/polylith/blob/master/doc/ci-and-deployment.md#1-validate-workflow in Jenkins CI using parallel stages so they run faster since JVM startup takes some time. https://www.jenkins.io/doc/book/pipeline/syntax/#parallel It failes and I get this error:

+ clojure -Sdeps {:mvn/local-repo "/var/jenkins_home/workspace/REDACTED_jenkins/.m2"} -M:poly deps color-mode:none
Error building classpath. Manifest type not detected when finding deps for polyfy/polylith in coordinate {:git/url "", :deps/root "projects/poly", :git/sha "22fe6fe46bbee5c678d7d81bcbbd46d83be98a75", :git/tag "v0.2.15-alpha"}
I presume there is a concurency issue here but not exactly sure where. I might be able to spin some more agents so the poly checks run independently. But wanted to ask here and see if someone else has had this issue. ( Did not find on this channel any mentions)

hiredman22:09:42

sounds like you are describing clj with the same set of deps at the same time in parallel, which will break

hiredman22:09:34

you might be ok if you set GITLIBS in the environment to something parallel to your m2 setting (assuming a separate m2 for each stage)

Eugen07:09:02

thanks. I will try to run the stages in their own container. but this means no deps are cached, which is a waste

Eugen07:09:54

probably I will drop this. but as it stands, it seems clojure tasks cannot be paralelized