This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-10
Channels
- # announcements (3)
- # architecture (54)
- # babashka (11)
- # beginners (12)
- # calva (5)
- # clj-on-windows (1)
- # cljdoc (2)
- # cljs-dev (1)
- # cljsrn (6)
- # clojure (130)
- # clojure-europe (8)
- # clojurescript (21)
- # conjure (23)
- # core-async (4)
- # datomic (7)
- # depstar (77)
- # events (1)
- # fulcro (27)
- # lsp (88)
- # malli (5)
- # meander (1)
- # off-topic (4)
- # pathom (43)
- # polylith (39)
- # re-frame (9)
- # shadow-cljs (14)
- # timbre (3)
- # tools-deps (53)
The latest commit to the issue-66
branch includes a bug fix and https://github.com/polyfy/polylith/issues/90.
@U1G0HH87L This seems to have fixed one bug in local/root relative path resolution but introduced a different bug. Prior to this update, we had a project that depended on a non-Polylith local dep as ../../worldsingles
and that used to work. Now it does, and it seems to need worldsingles
instead -- which means we can't, separately, build the JAR for that project. That's the new bug.
The bug that has been fixed is that, prior to this update, a base that depended on that non-Polylith local dep had to use worldsingles
even though the correct path should have been ../../worldsingles
.
Here's what we had in the project's deps.edn file:
:deps {org.clojure/clojure {:mvn/version "1.11.0-alpha1"}
worldsingles/worldsingles {:local/root "../../worldsingles"}
poly/base-batch-jobs {:local/root "../../bases/batch-jobs"}
;; being very explicit about which components the base needs:
poly/billing-machine {:local/root "../../components/billing-machine"}
poly/caching {:local/root "../../components/caching"}
poly/configuration {:local/root "../../components/configuration"}
...
That used to work. Now that dependency has to be
worldsingles/worldsingles {:local/root "worldsingles"}
otherwise test
can't find it in the context of that project.Here's the error:
poly> test
Projects to run tests from: worldsingles
Couldn't resolve libraries for the worldsingles project: clojure.lang.ExceptionInfo: Manifest type not detected when finding deps for worldsingles/worldsingles in coordinate #:local{:root "/Developer/workspace/worldsingles"} {:lib worldsingles/worldsingles, :coord #:local{:root "/Developer/workspace/worldsingles"}}
Manifest type not detected when finding deps for worldsingles/worldsingles in coordinate #:local{:root "/Developer/workspace/worldsingles"}
You can see that ../../
is navigating up the tree relative to where poly
is run rather than relative to the project folder projects/worldsingles
.Ok, I will have a look.
Weirdly, it seems that both worldsingles
and ../../worldsingles
work in the base's dependency now whereas only worldsingles
worked before so I'm not sure what's up with that.
Ok, interesting 😉
So the worldsingles
directory lives at the same level as e.g. components
and projects
?
Yes, it's a legacy project.
Okay, I will look into this.
I have pushed a fix @U04V70XH6. I will add more tests around this. It will be included in the next commit.
That breaks the :test
alias in the workspace-level deps.edn
:
:test ; Polylith's testing context for the development project
{:extra-deps {worldsingles/worldsingles-test {:local/root "worldsingles-test"}
com.github.seancorfield/expectations {:mvn/version "2.0.0-alpha2"}}
...
Since :dev
and :test
are all paths relative to the workspace, I would have expected a :local/root
to also be relative to the workspace? Here's the error:
Couldn't resolve libraries for the development project: clojure.lang.ExceptionInfo: Manifest type not detected when finding deps for worldsingles/worldsingles-test in coordinate #:local{:root "/Developer/workspace/wsmain/clojure/projects/development/worldsingles-test"} {:lib worldsingles/worldsingles-test, :coord #:local{:root "/Developer/workspace/wsmain/clojure/projects/development/worldsingles-test"}}
Manifest type not detected when finding deps for worldsingles/worldsingles-test in coordinate #:local{:root "/Developer/workspace/wsmain/clojure/projects/development/worldsingles-test"}
Note the path doesn't even exist: there is no development
inside projects
.However, with that change in place (adding ../../
to that :test
local root), everything else seems to work correctly, i.e., the projects/worldsingles/deps.edn
can have ../../worldsingles
which was the original bug above, and its :test
alias can have ../../worldsingles-test
which is what I would expect. In addition, I can change bases/batch-jobs/deps.edn
to use ../../worldsingles
and that also now works (previously it had to be just worldsingles
which made no sense.
I guess maybe if it's just accepted that :local/root
deps in :dev
or :test
in the workspace deps.edn
file need to be "as-if" relative to a fictional development
project (i.e., in projects
), then that at least is consistent between projects
...?
Actually, no, that really won't work because I actually need to combine :test
with legacy stuff and that relative root will not work there. So I think this is definitely a bug. The development project should treat :local/root
as workspace-relative @U1G0HH87L
Ahh, I know the problem. I missed to treat the development
project differently from the other projects (and yes, I didn’t test that, sorry for that). I will have another look at this.
Thanks. Really appreciate the recent changes!
I found the problem. I will push a fix in a few minutes.
It looked like external libraries don’t turn up in the libs
command (at least not in my test), so I will look into that before I push anything.
Cool. Thanks.
I'll be here for a short while longer (it's midnight) but I can always test the fix first thing in my morning (about 9 hours).
I pushed a fix. Please have another look again.
It seems like the ws-dir:DIR doesn’t work properly now. Hopefully you will not be affected by this bug. This is one thing that I don’t have a test for, so I will add that and fix this in the weekend.
The ws-dir:DIR actually works, but you have to give an existing DIR directory, otherwise it says “The command can only be executed from the workspace root, or by also passing in :: or ws-dir:DIR.“. Will change that so it will tell you that the directory doesn’t exist.
Nope, that is still broken the same way as the previous update:
(! 512)-> clojure -M:poly test :dev :all
Checking out: at 6d4a913dd5417e4b3d8e64be9c622d85b223156a
OpenJDK 64-Bit Server VM warning: Option --illegal-access is deprecated and will be removed in a future release.
Projects to run tests from: development, preview, worldsingles
Couldn't resolve libraries for the development project: clojure.lang.ExceptionInfo: Manifest type not detected when finding deps for worldsingles/worldsingles-test in coordinate #:local{:root "/Developer/workspace/wsmain/clojure/projects/development/worldsingles-test"} {:lib worldsingles/worldsingles-test, :coord #:local{:root "/Developer/workspace/wsmain/clojure/projects/development/worldsingles-test"}}
Manifest type not detected when finding deps for worldsingles/worldsingles-test in coordinate #:local{:root "/Developer/workspace/wsmain/clojure/projects/development/worldsingles-test"}
Okay. It worked in my example project. Can you run this and send me the result: clojure -M:poly ws get:projects:dev:lib-deps
I'll have to update my setup to test that latest SHA... just a second...
I found the problem and have pushed a fix.
OK, updating the SHA...
Er, I don't see the update on issue-66
...?
"Updated 13 hours ago by tengstrand"
(sorry, I know it's late for you @U1G0HH87L)
Forgot to push, but have pushed now! 🙂
Success on dev
(! 532)-> clojure -M:poly test :dev
Checking out: at 99a044b02f2bcc0b6525dbee3dca3fa5f2966cea
OpenJDK 64-Bit Server VM warning: Option --illegal-access is deprecated and will be removed in a future release.
Projects to run tests from: development
Running tests from the development project, including 8 bricks: billing-machine, billing-sdk, http-client-response, messaging-sdk, seo-json-renderer, slack-notifications, batch-jobs, preview-web
Testing ws.batch-jobs.reminders-test
ServerSystem:start() {:host Sean-Corfields-iMac, :heap (3% 130M 4096M), :cpu (39% 8 3.13), :clojure 1.10.3, :java 16, :jvm 16+36, :started 2021-07-15 13:22:52, :version source}
[ws.environment.impl] {} Environment:start() reading environment...
[ws.environment.impl] {} Reading environment settings from /opt/worldsingles/environment.edn.
[ws.environment.impl] {} Using sean-dev as the hostname to determine the environment.
[ws.environment.impl] {} Selected development-sean environment.
[ws.caching.impl] {} Cache:starts() creating caches...
Finally!
And the ws
project also tests clean as well...
...and the legacy test stuff for the bases and components also works. So that's all looking good now! Thank you so much!
Ok, great!