This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-24
Channels
- # aleph (13)
- # announcements (3)
- # beginners (134)
- # calva (9)
- # clojure (33)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-norway (42)
- # clojure-uk (7)
- # clojurescript (43)
- # core-async (7)
- # core-typed (2)
- # cursive (32)
- # datomic (19)
- # fulcro (5)
- # gratitude (4)
- # hyperfiddle (26)
- # introduce-yourself (1)
- # jobs-discuss (15)
- # lsp (3)
- # malli (20)
- # off-topic (18)
- # overtone (3)
- # polylith (24)
- # squint (22)
- # xtdb (21)
HI everyone! I just released https://github.com/polyfy/polylith/releases/tag/untagged-1d916a42090feed6fbcd. The documentation can be found https://cljdoc.org/d/polylith/clj-poly/0.2.19-SNAPSHOT/doc/readme. The biggest change is that we from 0.2.19 will store project and brick configuration in config.edn
files in their directories. Another change is that the interface name now can be given when creating a project. To migrate your project, execute the https://cljdoc.org/d/polylith/clj-poly/0.2.19-SNAPSHOT/doc/reference/commands#migrate command. A complete list of the changes can be found https://github.com/polyfy/polylith/blob/master/next-release.txt. Please try it out (maybe in a separate branch) and if it seems to work, I will make a 0.2.19 release out of it.
I see that it talks about the generated deps.edn
containing:
:aliases {:dev {:extra-paths ["development/src"]
Haven't we switched over to :extra-deps
now? Or is this a special case?Also, the development
project section doesn't mention the generated config.edn
file that the workspace doc says is in that project.
The component and base sections don't seem to mention config.edn
either -- but the project section does.
The project
section has a file tree that has config.edn
at the top level alongside workspace.edn
but nothing seems to discuss that file -- is it just a mistake in the file tree "graphic"?
Good feedback. The ./deps.edn
file is the deps file of development
and the extra-path
includes its own source file, just the same way bricks specify their src directory. And then it also includes all the bricks that are included. Will probably be busy now for a few days, but will adress this as soon I have time. I would be good if more people could have a look also, and test the migrate
command + check the documentation.
> The ./deps.edn file is the deps file of development and the extra-path includes its own source file No, that's not the case here.
This is on the workspace page and it's talking about the root deps.edn
file -- and using :extra-paths
instead of :extra-deps
.
(and then that same fragment is repeated on the development page)
Also, this command does not work:
(~/clojure)-(!2001)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' \
> -M -m polylith.clj.core.poly-cli.core \
> create workspace name:example top-ns:se.example :commit
Couldn't open 'workspace.edn': /home/sean/clojure/workspace.edn (No such file or directory)
I think this is a known bug, that workspace.edn
is checked for, before actually creating a new workspace?
I retried with "LATEST"
to use the snapshot version and that failed the same way, so I guess this isn't fixed yet?Will have a look.
I think this update has broken the external test runner support? I migrated our project at work and it is no longer using our external test runner -- so I don't think it is picking up the global :test
config from the workspace.edn
file any more.
Confirmed. So I tried adding the external test runner config to a project and that broke too:
sean@sean-win11-desk:~/workspace/wsmain$ dev.sh poly
_ _ + _ _
##### _ __ ___| |_ _| |-| |_| |_
##### | '_ \/ _ \ | || | | | _| ' \
##### | .__/\___/_|\_, |_|_|\__|_||_|
|_| |__/ poly 0.2.19-SNAPSHOT #1
wsmain$ test
Projects to run tests from: activator, api, auth, batch-jobs, campaign, cfml-affiliate, frankieee, login, match-reminders, migration, migration-data, preview, publisher, system, webpusher, wsadmin, wsbilling-admin, wsbilling-member, wsbilling-rebill, wsmessaging, wsphotoqueue, wsseogeo
Cannot invoke "clojure.lang.IFn.invoke(Object)" because "this.project_to_bricks_to_test" is null
wsmain$
That's with this projects/activator/config.edn
:
{:alias "act"
:test {:create-test-runner [org.corfield.external-test-runner.interface/create]
:setup-fn ws.application-fixtures.interface/pre-test
:teardown-fn ws.application-fixtures.interface/post-test}}
OK, that's as far as I can get with 0.2.19 -- until the external test runner stuff is fixed.
> I think this is a known bug, that workspace.edn is checked for, before actually creating a new workspace?
It turns out it's the presence of any deps.edn
file that causes this to fail, not workspace.edn
, for 0.2.18 (as well as 0.2.19-SNAPSHOT).
> Also, the development
project section doesn't mention the generated config.edn
file that the workspace doc says is in that project.
Fixed.
> The component and base sections don't seem to mention config.edn
either -- but the project section does.
The config.edn
files for bricks are only needed if we use :keep-lib-versions
which is introduced in the Libraries section.
> The project
section has a file tree that has config.edn
at the top level alongside workspace.edn
but nothing seems to discuss that file -- is it just a mistake in the file tree "graphic"?
Yes, it was a mistake. Good catch!
> Haven't we switched over to :extra-deps
now? Or is this a special case?
> No, that's not the case here.
Do you suggest that we should put another deps.edn
file under development
that specifies the development environment's src
directory in :paths
and then include development
with a :local/root
in ./deps.edn
?
> Also, this command does not work: ... (bootstrapping a workspace)
I executed it from an empty directory, and then i worked (on my Mac).
@U04V70XH6 I did a new 0.2.19-SNAPSHOT #3
release. Left to do:
• Add check
and test
to the poly-clj API.
• Make the filename config.edn
configurable.
• Maybe some more.
> Do you suggest that we should put another deps.edn
file under development that specifies the development environment's src
directory in :paths
and then include development
with a :local/root
in ./deps.edn
?
No... but this made me double-check how our repo is set up at work and, in addition to :dev
having all the :extra-deps
for bricks, we also have:
:extra-paths ["development/resources"
"development/src"]
So you can ignore that comment -- I'd just totally forgotten that's what you start with when you're creating a new workspace!> I executed it from an empty directory, and then i worked (on my Mac).
Put an empty deps.edn
in a new folder and then run it: it will fail because there's logic in poly
to detect the old v1 workspace format with deps.edn
but no workspace.edn
and it triggers "this is a v1 workspace" logic and then it fails to read workspace.edn
elsewhere.
Repro:
(~/clojure)-(!2011)-> mkdir poly-bug
Wed Jan 31 13:21:09
(~/clojure)-(!2012)-> cd poly-bug
Wed Jan 31 13:21:13
(~/clojure/poly-bug)-(!2013)-> echo '{}' > deps.edn
Wed Jan 31 13:21:18
(~/clojure/poly-bug)-(!2014)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' \
> -M -m polylith.clj.core.poly-cli.core \
> create workspace name:example top-ns:se.example :commit
Downloading: org/clojure/clojure/maven-metadata.xml from central
Downloading: org/clojure/clojure/maven-metadata.xml from clojars
Downloading: org/clojure/clojure/maven-metadata.xml from sonatype
Downloading: polylith/clj-poly/maven-metadata.xml from clojars
Couldn't open 'workspace.edn': /home/sean/clojure/poly-bug/workspace.edn (No such file or directory)
Wed Jan 31 13:22:18
(~/clojure/poly-bug)-(!2015)->
Okay, I will have a look!
Also, this command does not work:
(~/clojure)-(!2001)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' \
> -M -m polylith.clj.core.poly-cli.core \
> create workspace name:example top-ns:se.example :commit
Couldn't open 'workspace.edn': /home/sean/clojure/workspace.edn (No such file or directory)
I think this is a known bug, that workspace.edn
is checked for, before actually creating a new workspace?
I retried with "LATEST"
to use the snapshot version and that failed the same way, so I guess this isn't fixed yet?☝️:skin-tone-2: Can anyone verify that the above command (from the docs) works or fails in a clean directory?
This worked on my machine (Mac book air, M1): clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' -M -m polylith.clj.core.poly-cli.core create workspace name:example top-ns:se.example :commit
The presence of a deps.edn
-- even an empty one -- is what breaks it:
(~/clojure)-(!2006)-> mkdir j
Wed Jan 24 22:55:08
(~/clojure)-(!2007)-> cd j
Wed Jan 24 22:55:09
(~/clojure/j)-(!2008)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' -M -m polylith.clj.core.poly-cli.core create workspace name:example top-ns:se.example :commit
Wed Jan 24 22:55:33
(~/clojure/j)-(!2009)-> ls
example
Wed Jan 24 22:55:36
(~/clojure/j)-(!2010)-> rm -rf example/
Wed Jan 24 22:55:40
(~/clojure/j)-(!2011)-> echo '{}' > deps.edn
Wed Jan 24 22:55:46
(~/clojure/j)-(!2012)-> clojure -Sdeps '{:deps {polylith/clj-poly {:mvn/version "RELEASE"}}}' -M -m polylith.clj.core.poly-cli.core create workspace name:example top-ns:se.example :commit
Couldn't open 'workspace.edn': /home/sean/clojure/j/workspace.edn (No such file or directory)
I often have deps.edn
files lying around in "scratch" directories and that's where I tried to run that command before.
> I think this is a known bug, that workspace.edn is checked for, before actually creating a new workspace?
It turns out it's the presence of any deps.edn
file that causes this to fail, not workspace.edn
, for 0.2.18 (as well as 0.2.19-SNAPSHOT).