Fork me on GitHub
#tools-deps
<
2018-11-02
>
richiardiandrea01:11:08

How long does builds take for you folks in average? I am being told node builds take 5-10 minutes and I want to make sure I am not doing anything wrong before answering. At the moment a monorepo build takes 22 minutes and it downloads ~50 deps

richiardiandrea04:11:18

This is more of a #clojurescript question actually

slipset07:11:00

First of all, I know tools.deps/clj is not meant as a build tool. But still: We now have a bunch of utils like pack, Eastwood, depot, testrunner, etc which are useful tools to use in a build pipeline. I know I can add aliases to all of these in my home-directory’s deps.edn, but that doesn’t really work across multiple machines. Having all the aliases duplicated across multiple projects doesn’t seem like a great solution either. One solution I could think of is that deps.edn could refer to other deps.edns and use their aliases. Would that be possible?

cjohansen09:11:41

what exactly is the problem in duplicating between projects? lack of standardization?

cjohansen09:11:43

I have stuff like this:

cjohansen09:11:46

:ancient {:extra-deps {olical/depot {:mvn/version "1.2.0"}}
                     :main-opts ["-m" "depot.outdated.main"]}

cjohansen09:11:05

you want to make that implicit in your deps.edn?

slipset09:11:13

I was imagining that when I wanted to bump the version on olical/depot, I’d have to check out all my projects and bumpt it.

slipset09:11:34

Also, some of the aliases are somewhat more involved than this.

cjohansen09:11:58

yup. it’s a difficult trade-off. it’s tempting to standardize or “dedupe” some of this boilerplate, but that creates problems when things aren’t as equal anymore

cjohansen09:11:03

e.g. you loose the flexibility

slipset09:11:26

I’ve come to realise this. But that’s another discussion we could have over a cup of coffee IRL 🙂

cjohansen09:11:53

if you have a lot of very similar projects I guess you could make your own dev package, and encode the aliases in it, and then use it like so:

cjohansen09:11:57

{:aliases
 :dev {:extra-deps {my.company/my-bundle {:mvn/version "1234"}}}
 :test {:main-opts ["my.bundle.test"]}
 :ancient {:main-opts ["my.bundle.ancient"]}
 :build {:main-opts ["my.bundle.build"]}}

cjohansen09:11:03

yes, for sure 🙂

cjohansen09:11:21

but that approach does quickly leads to entangled framework world, use with caution

slipset09:11:06

I guess so.

cjohansen09:11:09

I don’t have enough similar projects to warrant the effort, but this is an approach I would consider to contain the duplication and lightly enforce some standardization. you’d still have to bump the shared dependency in all projects, but at least you reduced n deps/aliases to 1

cjohansen09:11:29

I’m sure there are other ways to approach this as well

orestis10:11:04

One thing I noticed really is that when most of those things are just standalone utilities, they shouldn’t even be in my main deps.edn file, because they don’t need all my “production” stuff to run.

Alex Miller (Clojure team)12:11:08

Exactly - put them in your ~/.clojure/deps.edn

orestis13:11:14

Is there then a way for the clj to ignore any local deps.edn?

orestis13:11:16

Meaning, when the Classpath is created, it only has the stuff from ~/.clojure/deps.edn and nothing from a local deps.edn file.

Alex Miller (Clojure team)13:11:03

no, why would you want that?

orestis14:11:06

In the context of a standalone library, e.g. clj-new, cljfmt etc etc that does “build tool” stuff — it has no need to bring in the application-level deps. I’m not sure what the ramifications of having more things in the classpath are though — apart from the potential version conflicts which I think are addressable right now.

orestis10:11:47

I’m always thinking that perhaps it’s time for a new “dev-time” tool that provides a wrapper and some porcelain around those single-purpose libraries. Sure you lose the flexibility, but you also don’t have to make all those decisions when you are a newcomer to the ecosystem, plus the single-purpose libraries can still be used standalone and can evolve at their own pace.

cjohansen10:11:51

wherever it is, all the deps and scripts required to build and deploy the app should reside in the repo at least

dominicm10:11:51

@orestis would such a thing be put into each project? Or be part of the setup guide for ~/.clojure/deps.edn when you're new to a project?

cjohansen10:11:07

I strongly believe that developing any app should require as few pre-installed tools as possible, and that the code/repo should be as self-contained as possible

rickmoynihan12:11:46

I agree with this sentiment too. tools.deps is quite good here, as you can effectively ship tooling with a repo; and version lock the tools - without having to include binaries etc.

orestis10:11:26

I think it could be its own standalone CLI, like lein or boot.

orestis10:11:05

But in the end all it would do is generate the correct clj/clojure invocation for you.

cjohansen10:11:32

I’m currently using deps.edn + Makefile to get the job done. I see some things that will probably seem like tedious repetition at some point, but so far I’m loving the simplicity of it. no magic, you can see everything

💯 4
orestis10:11:32

I see your point though @christian767 — though with tools.deps you need to have clj installed — otherwise, well, you have to fallback to java -cp ..., no?

cjohansen10:11:00

yes, I think clj and java is a good baseline requirement for clojure projects at this point

orestis10:11:09

Right, a more opinionated Makefile is what I’m trying to describe.

orestis10:11:58

My experience in trying to setup a new deps.edn based project was a few days trying out the various uberjar libraries, then a linter, then a formatter, then an outdated-deps-finder etc etc etc.

orestis10:11:29

I think the community would benefit if this is done for you, while still maintaining the much-needed transparency and zero magic.

💯 4
orestis10:11:58

I wonder how could this move forward? Ask people to upload their deps.edn and makefiles and shell scripts somewhere and compare approaches? I’m too much of a newb to do this based only on my assumptions, and different projects will have wildly different needs.

dominicm10:11:08

You start a project by cloning edge, and then modifying it. Everything is set up for you. clj is all you need.

dominicm10:11:29

Templates also solve this problem.

cjohansen10:11:26

basically, scaffolding

dominicm10:11:01

I wouldn't say scaffolding is a good comparison. It's more of a cookie cutter or starting point than anything.

orestis10:11:02

The issue with templates/scaffolding is that after the initial project creation, you are on your own.

cjohansen10:11:16

my issue with this approach is that it sets you off for an overwhelming start, and it is too easy to end up with a bunch of stuff laying around that you don’t really need

dominicm10:11:34

@orestis that's why we suggest cloning. You can upgrade by doing git merge edge/master

dominicm10:11:03

I've been making some adjustments to reduce the chances of conflicts to very low. It should only happen if you modify things (in which case, what do you expect?)

dominicm10:11:32

The documentation around this isn't great, but it's how we expect edge to be used, and how we use it internally.

dominicm10:11:29

blugh, s/modify things/modify shared areas in a separate folder/

orestis10:11:13

I see your point — and it might be hugely valuable for a consulting company, since you tend to start projects very often, right? I’m more after something that decouples some very common concerns for most people, while imposing no opinions on how your actual app is structured. Meaning, I just want to run a command to give me outdated dependencies, a command to run all my tests, a command to build my uberjar. I’d like newcomers to the community to have a single entry point, and if/when they want more power, be able to drop down to the layer below.

orestis10:11:04

Crucially, they shouldn’t have to know the underlying libraries if they don’t care. Similarly to how you don’t really know how lein builds uberjars.

dominicm10:11:19

I know 🙈 You don't want to

orestis10:11:47

And also crucially though, the uberjar building library is standalone and people can use it as they see fit.

cjohansen10:11:57

koacha does this for tests

cjohansen10:11:15

you could create a binstub on your box, run koacha in your app, and it’ll “just work”

dominicm10:11:31

We start, and maintain, a lot of projects, yep 🙂. edge is slightly more opinionated than that, it assumes integrant for example. But I think the implementation would work for this? Use a git repo, and merge periodically to have the uberjar builder updated by maintainers upstream.

orestis10:11:58

Exactly @christian767, kaocha is very good at that, it has its own CLI - like thing, but you can also use its API if you want to.

dominicm10:11:23

Binstubs are only part of the puzzle though 🙂 What would provide: > I think the community would benefit if this is done for you, while still maintaining the much-needed transparency and zero magic. ?

orestis10:11:24

So what I’m after is — a cli tool that you could install, then run XXX test and it would do the right thing, using kaocha under the hood. Kaocha then can keep evolving and people can use it standalone without the XXX tool.

orestis10:11:50

You wouldn’t know that kaocha is used unless you really want to — kaocha is a very good example since it plays well with clojure.test. Uberjars can be more fiddly to configure, I guess?

slipset10:11:27

This is sort of the discussion I was looking for

slipset10:11:46

But in one way, I guess we’re discussing yet another lein or boot

dominicm10:11:49

jars need a lot of configuration in my experience 🙂 Clients come up with all sorts of novel environments in which we have to deploy.

dominicm10:11:59

@slipset I wouldn't like to see another lein or boot fwiw.

slipset10:11:46

I know, but the ideas I’m sort of looking for very quickly lead in that direction, unfortunatly

slipset10:11:17

Even if it’s only @christian767 Makefile or Juxt’s edge.

slipset10:11:36

I could imagine ending up in:

slipset10:11:21

$ make -f /usr/local/etc/default-makefile-for-app setup

slipset10:11:56

which is basically lein new app or clj -A:clj-new app ...

slipset10:11:59

or some sort.

orestis10:11:10

I’m not 100% sure if this only an “ergonomics” thing — or if some plumbing is still missing from tools.deps.

dominicm10:11:37

Given Stu's advocacy for CLJ-2373 (I've memorized it he's said it so much!), let's take a leaf out of the Clojure/core approach to solving problems. What is the problem statement here?

dominicm10:11:46

If we were only trying to solve the assembly problem, then templates are fine. So there's another element too I'm guessing?

dominicm10:11:38

I kinda get the impression we're each looking for different additional properties. I've seen mention of "project-local isolation", "baseline as clj", and "not caring about underlying library".

dominicm11:11:34

fwiw, I care more about "baseline as clj" because it's the minimum I can expect anyone to have done, ever. If we're doing training as a company, getting binstubs installed, covering all the distros is more hassle than it's worth for me. I would probably find it acceptable if a project had some kind of alias like clj -A:tool-name which would then do the rest for itself. add-lib is pretty compelling here, as the tool can dynamically fetch it's dependencies as needed.

seancorfield06:11:14

@alexmiller merged master back to the add-lib branch and we just added a :deps alias at work to that SHA so we can use add-lib in our REPLs. It's nice. I need update my dot-clojure file/repo with that too.

orestis12:11:34

Nice breakdown. Fully agree.

seancorfield16:11:24

I uploaded my https://github.com/seancorfield/dot-clojure as a guide for others some time ago -- I think sharing these is useful while the tool is still new.

seancorfield16:11:12

As for a self-contained project: yes, very important -- it's why we have a shell wrapper that sets CLJ_CONFIG (to point to a repo-specific "dot Clojure" folder) and we have a deps.edn file for each subpar object in the repo.

richiardiandrea16:11:08

Funny I was doing the same yesterday but it seemed like a hack ^

andy.fingerhut16:11:36

But today, it no longer seems like you are hacking. Today, you are corfielding 🙂

richiardiandrea16:11:42

It seems like everybody is going to corfield their deps.edn sooner or later 😄

andy.fingerhut16:11:19

Sean, if this goes seriously weird, I sincerely apologize

😆 4
andy.fingerhut16:11:02

If it only goes slightly weird, then .... you are welcome? 🙂

seancorfield18:11:20

Weird is good. I like weird. :rolling_on_the_floor_laughing:

🤪 8
seancorfield18:11:20

Weird is good. I like weird. :rolling_on_the_floor_laughing:

🤪 8
seancorfield18:11:36

Back to the CLJ_CONFIG stuff (I was on my phone earlier)... we've found the ability to specify a "home" deps.edn via CLJ_CONFIG is great! It means a project can have a "home" configuration for aliases that provide project-specific tooling as well as :override-deps (which we rely on heavily to "pin" versions across subprojects within the overall project.

seancorfield18:11:03

I talked a bit our shell wrapper a week or two back I think. Mostly it takes commands of the form build alias(es) subproject and it goes into that subproject and runs CLJ_CONFIG=../versions clojure -A:defaults:aliases (edited to add our defaults alias -- very important!)

Alex Miller (Clojure team)18:11:51

Is that only for aliases?

seancorfield18:11:51

It does a few mini-DSL-y sort of things around plural aliases or aliases with certain prefix/suffix strings as well as expanding some internal "aliases" but it's only a few tens of lines of shell script.

seancorfield18:11:53

@alexmiller We have the "pinned" version of Clojure specified as a regular :deps in that versions/deps.edn file but everything else is just aliases I think.

seancorfield18:11:31

Oh, and it adds our Archiva Maven repo as well.

seancorfield18:11:23

It's definitely shown the need for all deps-based tooling to support correct deps.edn merging with support for :override-deps and aliases, if it doesn't just execute in the context of your project's classpath (Depot, for example, already supports aliases but needed a PR to support :override-deps merging).

seancorfield18:11:42

It would definitely simplify usage if :override-deps could be top-level and not need an alias.

dominicm19:11:13

@seancorfield fwiw, I don't like the CLJ_CONFIG solution because it takes away the ability to have aliases (e.g. A custom repl) from a user. I understand your choice and think it is pragmatic though.

seancorfield19:11:36

Yeah, it's a compromise. We have REPL-related aliases in that deps file, as well as other tooling.

seancorfield19:11:13

What I'd really like would be the ability to specify an extra deps.edn file easily between user-deps and project-deps.

seancorfield23:11:39

@alexmiller Is this something you'd entertain as an enhancement? Essentially to support something like <system>/deps.edn, <user>/deps.edn, <tooling>/deps.edn, (project) deps.edn.

seancorfield23:11:13

I wasn't sure if you just missed this in the flow of questions in the channel since you didn't comment -- and I sort of expected you to 🙂

Alex Miller (Clojure team)00:11:41

Don’t know - have been hoping to move towards fewer deps.edn files, not more :)

seancorfield00:11:20

Fair enough. The underlying t.d.a. lib supports an arbitrary number of deps.edn files tho'... and it would be nice and generic to surface that in clj/`clojure` 🙂

seancorfield00:11:56

You can easily merge extra stuff at the end with -Sdeps but you can't insert anything before the project deps.edn which is where I find the need -- and I think I'm not alone.

seancorfield00:11:38

We can get away with "replacing" the user-deps via CLJ_CONFIG for our needs but it does mean some duplication and inconvenience.

Alex Miller (Clojure team)00:11:12

Other things are pointing away from having an arbitrary number of deps so that’s much more likely to die

Alex Miller (Clojure team)00:11:52

But I asked because I’m interested in the use cases

seancorfield00:11:53

Interesting. I wonder how we'll make things work if that goes away. It's kind of fundamental to our workflow right now.

seancorfield00:11:24

I guess we'd need to maintain a variant of the clojure script that allowed us to specify an extra deps file around these lines

# Chain deps.edn in config paths. repro=skip config dir
if "$repro"; then
  config_paths=("$install_dir/deps.edn" "deps.edn")
else
  config_paths=("$install_dir/deps.edn" "$config_dir/deps.edn" "deps.edn")
fi
config_str=$(printf ",%s" "${config_paths[@]}")
config_str=${config_str:1}

seancorfield00:11:44

(which part are you saying might "die"? support for CLJ_CONFIG or support for the --config-files command line argument in t.d.a.?)

seancorfield19:11:52

So we'd have <system>/deps.edn, <user>/deps.edn, <tooling>/deps.edn, (project) deps.edn.

timgilbert19:11:27

Say, I'm getting this error trying to mvn install a tools.deps.alpha repo I've got checked out locally, anyone know if there is some special stuff I need to do in order to build it?

[INFO] --- clojure-maven-plugin:1.7.1:test (clojure-test) @ tools.deps.alpha ---
Error: Could not find or load main class clojure.main
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Alex Miller (Clojure team)19:11:13

Can you provide more info? Is there a pom? Did you gen it or make it? What do you mean by a “tools.deps.alpha repo”?

timgilbert19:11:48

Sure. I just cloned https://github.com/clojure/tools.deps.alpha and ran mvn install. There is a pom, which I've left unchanged from the repo. I couldn't find any docs about a build process, but I'm sure I could have missed something.

timgilbert19:11:19

(I get the same error running mvn test, which makes sense)

timgilbert19:11:30

Here is the full output:

% mvn install
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tools.deps.alpha 0.5.461-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.12:add-source (add-clojure-source-dirs) @ tools.deps.alpha ---
[INFO] Source directory: /mnt/c/Users/tim/Dropbox/src/cljs/tools.deps.alpha/src/main/clojure added.
[INFO]
[INFO] --- build-helper-maven-plugin:1.12:add-resource (add-clojure-source-dirs) @ tools.deps.alpha ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.12:add-test-source (add-clojure-test-source-dirs) @ tools.deps.alpha ---
[INFO] Test Source directory: /mnt/c/Users/tim/Dropbox/src/cljs/tools.deps.alpha/src/test/clojure added.
[INFO]
[INFO] --- build-helper-maven-plugin:1.12:add-test-resource (add-clojure-test-source-dirs) @ tools.deps.alpha ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tools.deps.alpha ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /mnt/c/Users/tim/Dropbox/src/cljs/tools.deps.alpha/src/main/resources
[INFO] Copying 18 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ tools.deps.alpha ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ tools.deps.alpha ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /mnt/c/Users/tim/Dropbox/src/cljs/tools.deps.alpha/src/test/resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ tools.deps.alpha ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ tools.deps.alpha ---
[INFO]
[INFO] --- clojure-maven-plugin:1.7.1:test (clojure-test) @ tools.deps.alpha ---
Error: Could not find or load main class clojure.main
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.073 s
[INFO] Finished at: 2018-11-02T19:48:28+00:00
[INFO] Final Memory: 19M/295M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.7.1:test (clojure-test) on project tools.deps.alpha: Clojure failed. -> [Help 1]

timgilbert19:11:29

Sorry, I could put this all in a ticket too. Just thought I might be missing something obvious.

Alex Miller (Clojure team)19:11:19

Ok, so you actually mean tda

Alex Miller (Clojure team)19:11:49

No magic here, it is just a maven build and I run mvn test on it all the time

timgilbert19:11:01

% java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

% mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-17134-microsoft", arch: "amd64", family: "unix"

timgilbert19:11:55

This is running under ubuntu in the "windows subsystem for linux" which is a bit of a weird environment but all the usual clojure stuff works fine

Alex Miller (Clojure team)19:11:58

I’m using Java 11 and Maven 3.5.4 at the moment, but I don’t have any reason to believe your versions are not sufficient

Alex Miller (Clojure team)19:11:14

the build box is certainly using much older stuff to build and deploy that lib

Alex Miller (Clojure team)19:11:47

try throwing -X -e on your mvn command

timgilbert20:11:29

I was wondering if I might need to build clojure locally first or something

Alex Miller (Clojure team)20:11:01

it’s just using the released clojure 1.9.0

timgilbert20:11:43

Here's the exception with -X -e:

[ERROR] Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.7.1:test (clojure-test) on project tools.deps.alpha: Clojure failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.theoryinpractise:clojure-maven-plugin:1.7.1:test (clojure-test) on project tools.deps.alpha: Clojure failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Clojure failed.
        at com.theoryinpractise.clojure.AbstractClojureCompilerMojo.callClojureWith(AbstractClojureCompilerMojo.java:464)
        at com.theoryinpractise.clojure.AbstractClojureCompilerMojo.callClojureWith(AbstractClojureCompilerMojo.java:366)
        at com.theoryinpractise.clojure.ClojureRunTestWithJUnitMojo.execute(ClojureRunTestWithJUnitMojo.java:138)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more

Alex Miller (Clojure team)20:11:52

It’s failing in the test step, which is kinda weird. You could use -Dmaven.test.skip=true if you wanted to just move past that

timgilbert20:11:48

Aha! That did it.

Alex Miller (Clojure team)20:11:54

it’s failing to run Clojure to run the tests. not sure why that would be

Alex Miller (Clojure team)20:11:11

I’ve seen a lot of maven build failures, but I haven’t seen this one :)

timgilbert20:11:13

My next question was going to be how to run the tests 😉

timgilbert20:11:47

It's possible that some local modifications I made messed something up, let me try on a clean master

timgilbert20:11:27

Hmm, still getting the same thing on a clean master. I'll see if I can repo at home on my mac and file a ticket if so. Thanks for looking.

seancorfield20:11:34

It works on my Mac. I haven't tried to build/install any Clojure Contrib projects on WSL on my Windows 10 laptop. I'll try to remember to test that later today.

timgilbert20:11:33

The root of the problem seems to be that I'm getting the clojure dependency with scope provided.

% mvn dependency:tree | grep org.clojure
[INFO] org.clojure:tools.deps.alpha:jar:0.5.461-SNAPSHOT
[INFO] +- org.clojure:clojure:jar:1.9.0:provided
[INFO] |  +- org.clojure:spec.alpha:jar:0.1.143:provided
[INFO] |  \- org.clojure:core.specs.alpha:jar:0.1.24:provided
[INFO] +- org.clojure:data.xml:jar:0.2.0-alpha5:compile
[INFO] |  \- org.clojure:data.codec:jar:0.1.0:compile
[INFO] +- org.clojure:tools.gitlibs:jar:0.2.64:compile
[INFO] \- org.clojure:tools.cli:jar:0.3.5:compile

timgilbert20:11:25

Anyways, I'll mess around a bit more and put a ticket up. I'm guessing this is something local to my machine.

Alex Miller (Clojure team)20:11:34

interesting. I wonder why that’s different here vs there

seancorfield21:11:38

@U08QZ7Y5S FYI, if you're relying on WSL, avoid Insider build 18272 -- they broke WSL in that build (they know about it, not sure when a fix will flight tho').

timgilbert21:11:27

After the October fiasco, I'm avoiding Windows updates altogether for some time

Alex Miller (Clojure team)21:11:44

October Fiasco is my new hardcore band btw

8
seancorfield21:11:02

I'm on Fast Ring Insider builds so my WSL is bricked on both my Windows machines. Fortunately, I still have my Mac for dev work! 🙂

timgilbert17:11:15

FWIW, filed https://dev.clojure.org/jira/browse/TDEPS-105 to track this mishegas. My home mac is sad so I haven't had time to test it there

Alex Miller (Clojure team)17:11:39

@U08QZ7Y5S I believe you’re experiencing this, and I feel bad about that, but priority-wise has to fall into my “won’t fix” bucket, so I’m going to decline it. If you manage to find a fix, happy to see it re-opened and consider.

timgilbert17:11:44

That's totally fine with me, I mostly just wanted to get it documented in case somebody else was seeing it. I have to confess that I have no idea how mvn test ever works without a concrete clojure.jar in the dependency tree, though.

Alex Miller (Clojure team)17:11:39

prob via the clojure maven plugin (which is in the classpath)

john19:11:27

What are people using as an environ replacement? Does it only work with a project.clj?

zane19:11:11

juxt/edge is deps.edn-based and uses Aero: https://github.com/juxt/aero

👌 8
seancorfield19:11:55

We have our own, internal, configuration library that can use env vars but mostly relies on EDN files.

dominicm23:11:57

I'd enjoy evangelizing aero to you 🙂 Any big differences between aero and your system?

seancorfield23:11:02

I'd have to go look at Aero again. We did a review of pretty much everything available out there when we decided to "roll our own" a while back...

yogidevbear11:11:54

(whispers "aero" into Sean's ear while he's sleeping)

4
seancorfield19:11:33

We've considered open sourcing it, but it does contain some proprietary stuff that we haven't had time (or inclination) to refactor out yet.

kenny20:11:52

If I have this in my :deps:

compute/integrations {:git/url    "[email protected]:ComputeSoftware/integrations.git"
                      :sha        "e0b915e5e9b285d322b6d01231d8e4e468550d76"
                      :exclusions [commons-logging/commons-logging]}
And I run clj -Stree -Sforce, I get this:
compute/integrations [email protected]:ComputeSoftware/integrations.git e0b915e
  com.amazonaws/aws-java-sdk-autoscaling 1.11.399
  com.amazonaws/aws-java-sdk-sts 1.11.399
  com.cognitect/anomalies 0.1.12
  clj-http/clj-http 3.9.1
    org.apache.httpcomponents/httpasyncclient 4.1.3
      org.apache.httpcomponents/httpcore-nio 4.4.6
    slingshot/slingshot 0.12.2
    org.apache.httpcomponents/httpcore 4.4.9
    org.apache.httpcomponents/httpclient-cache 4.5.5
    org.apache.httpcomponents/httpclient 4.5.5
      commons-logging/commons-logging 1.2
Why is commons-logging/commons-logging included?

Alex Miller (Clojure team)20:11:46

feel free to file a ticket with a repro if you can slim it down

Alex Miller (Clojure team)20:11:11

it being under a git dep might be part of the answer, not sure

kenny20:11:58

Will see if I can get a repro.

kenny20:11:36

First cut at the obvious repro case and I cannot reproduce. I made a git repo with a deps.edn that has clj-http as the dep. I made directory with a deps.edn on my computer that added that lib as a dep with the commons-logging exclusion and it behaved correctly. Is there something else I should be looking for in my current problem case that may shed some light here?

kenny20:11:46

If I add that exact dependency to my new project:

{:deps {compute/integrations {:git/url    "[email protected]:ComputeSoftware/integrations.git"
                              :sha        "e0b915e5e9b285d322b6d01231d8e4e468550d76"
                              :exclusions [commons-logging/commons-logging]}}}
commons-logging is not in the tree, as expected.

kenny20:11:13

Ok this is bizarre. After running clj -Stree in my original project after making no changes, I no longer have this issue. I ran clj -Stree -Sforce before so I would've thought that would cover any caching issues. Never mind, I searched the wrong terminal output.

kenny21:11:30

This dep excludes httpclient, as expected.

compute/integrations {:git/url    "[email protected]:ComputeSoftware/integrations.git"
                      :sha        "e0b915e5e9b285d322b6d01231d8e4e468550d76"
                      :exclusions [org.apache.httpcomponents/httpclient]}

kenny21:11:28

Is there a way to see all the deps that have commons-logging as a dep?

kenny21:11:50

Removing all other deps in my project besides Clojure and compute/integrations causes the exclusion to work correctly.

kenny21:11:52

Got a repro. There is something seriously funky going on. Repro is here: https://github.com/kennyjwilli/clj-exclusions. cd into the app directory and run clj -Stree -Sforce. I get this:

org.clojure/clojure 1.9.0
  org.clojure/core.specs.alpha 0.1.24
  org.clojure/spec.alpha 0.1.143
integrations/integrations ..
  clj-http/clj-http 3.9.1
    commons-codec/commons-codec 1.11
    org.apache.httpcomponents/httpasyncclient 4.1.3
      org.apache.httpcomponents/httpcore-nio 4.4.6
    slingshot/slingshot 0.12.2
    commons-io/commons-io 2.6
    org.apache.httpcomponents/httpcore 4.4.9
    org.apache.httpcomponents/httpclient-cache 4.5.5
    org.apache.httpcomponents/httpclient 4.5.5
      commons-logging/commons-logging 1.2
    potemkin/potemkin 0.4.5
      clj-tuple/clj-tuple 0.2.2
      riddley/riddley 0.1.12
    org.apache.httpcomponents/httpmime 4.5.5
com.amazonaws/aws-java-sdk-cloudwatch 1.11.399
  com.amazonaws/jmespath-java 1.11.399
    com.fasterxml.jackson.core/jackson-databind 2.6.7.1
      com.fasterxml.jackson.core/jackson-core 2.6.7
      com.fasterxml.jackson.core/jackson-annotations 2.6.0
  com.amazonaws/aws-java-sdk-core 1.11.399
    joda-time/joda-time 2.8.1
    com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.6.7
    software.amazon.ion/ion-java 1.0.2
Now if I change the name of the dependency from integrations to lib, I get this output from clj -Stree -Sforce:
org.clojure/clojure 1.9.0
  org.clojure/core.specs.alpha 0.1.24
  org.clojure/spec.alpha 0.1.143
com.amazonaws/aws-java-sdk-cloudwatch 1.11.399
  com.amazonaws/jmespath-java 1.11.399
    com.fasterxml.jackson.core/jackson-databind 2.6.7.1
      com.fasterxml.jackson.core/jackson-core 2.6.7
      com.fasterxml.jackson.core/jackson-annotations 2.6.0
  com.amazonaws/aws-java-sdk-core 1.11.399
    joda-time/joda-time 2.8.1
    com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.6.7
    software.amazon.ion/ion-java 1.0.2
    org.apache.httpcomponents/httpclient 4.5.5
      commons-logging/commons-logging 1.2
lib/lib ..
  clj-http/clj-http 3.9.1
    commons-codec/commons-codec 1.11
    org.apache.httpcomponents/httpasyncclient 4.1.3
      org.apache.httpcomponents/httpcore-nio 4.4.6
    slingshot/slingshot 0.12.2
    commons-io/commons-io 2.6
    org.apache.httpcomponents/httpcore 4.4.9
    org.apache.httpcomponents/httpclient-cache 4.5.5
    potemkin/potemkin 0.4.5
      clj-tuple/clj-tuple 0.2.2
      riddley/riddley 0.1.12
    org.apache.httpcomponents/httpmime 4.5.5
It is different and all I did was change the name. What is going on here?

Alex Miller (Clojure team)21:11:59

the ordering is somewhat dependent on traversal order as to which one is encountered first, but you shouldn’t be getting a dep that is excluded

Alex Miller (Clojure team)21:11:32

there are a couple tickets out there that I’ve looked at and there are a couple issues to resolve - it’s likely this is the same as one of them

kenny21:11:51

Ok. Which tickets?

seancorfield21:11:17

They're only different because org.apache.httpcomponents/httpclient is coming in via two dependencies, not just one.

seancorfield21:11:28

In the integrations case, httpclient and logging come in via clj-http. In the lib case, httpclient and logging are coming in via aws cloudwatch (via aws core)

kenny21:11:29

The inconsistency is quite misleading though.

Alex Miller (Clojure team)21:11:22

TDEPS-58 (and TDEPS-79)

kenny21:11:11

Yep that sounds like it.

seancorfield21:11:23

If you have the exclusion on clj-http, it won't stop it being pulled in if the cloudwatch dep is walked first -- since it won't have seen the exclusion at that point.

seancorfield21:11:15

We've had to be very aggressive with exclusions to stop up all the "holes" where certain things leak in...

Alex Miller (Clojure team)21:11:37

there have been some requests for “global” exclusions

kenny21:11:51

Aggressive meaning exclusions on a lot of your deps?

Alex Miller (Clojure team)22:11:01

I’m not necessarily opposed to that, but haven’t thought through all the implications

kenny22:11:08

I think Boot has that.

seancorfield22:11:46

Yes. We've had to add the same/similar exclusions on several deps across our subprojects in order to completely "hide" them.

kenny22:11:33

Would global exclusions solve your problem?

seancorfield22:11:52

We've used global exclusions with Boot. It's a bit of a sledgehammer. We used it to exclude Clojure and ClojureScript across everything.

seancorfield22:11:04

Yes, global exclusions would "solve" the problem but it's really a huge hammer to crack a little nut. And the fall out is that you then need to ensure you bring in all those things explicitly in the right subprojects -- which is a pain.

Alex Miller (Clojure team)22:11:07

seems like that would make it hard to use Clojure or ClojureScript :)

seancorfield22:11:39

You can bring them in at the top-level. It just ensures nothing else brings them in.

Alex Miller (Clojure team)22:11:48

so I’d say that’s global-except-at-top-level :)

seancorfield22:11:58

Yeah, well, Boot is nothing if not "pragmatic" 🙂

Alex Miller (Clojure team)22:11:20

I’m just saying, that’s a subtlety

kenny22:11:58

Dependency resolution wouldn't solve that for you?

Alex Miller (Clojure team)22:11:03

with Maven dependency, no

Alex Miller (Clojure team)22:11:32

Maven takes the first version it encounters

seancorfield22:11:35

Two things: 1. we wanted ClojureScript excluded completely for all our backend projects, 2. we run "pedantic" style checks (or, at least, we did in lein and boot) so if potentially conflicting versions came in, we would get an exception -- and we didn't want to add those exclusions to nearly every Clojure dependency, since everything depends on different versions of Clojure out there 🙂

kenny22:11:06

Anyway, thanks for the help. Excluding commons-logging from my other top level AWS deps fixed the issue. I voted and followed TDEPS-58.