amperity / lein-monolith

Leiningen plugin for working with monorepos.
Other
214 stars 18 forks source link

`lein monolith each :parallel N` cannot use globally defined aliases #36

Closed aengelberg closed 3 years ago

aengelberg commented 6 years ago

I've pushed a branch broken-example where I've changed the example/ projects slightly so that they inherit an alias version+ defined in the global project.

$ lein monolith each version+
Applying version+ to 3 subprojects...

Applying to example/lib-a
Leiningen 2.8.1 on Java 1.8.0_92 Java HotSpot(TM) 64-Bit Server VM
Completed example/lib-a (1/3) in 0:00.126

Applying to example/lib-b
Leiningen 2.8.1 on Java 1.8.0_92 Java HotSpot(TM) 64-Bit Server VM
Completed example/lib-b (2/3) in 0:00.008

Applying to example/app-a
Leiningen 2.8.1 on Java 1.8.0_92 Java HotSpot(TM) 64-Bit Server VM
Completed example/app-a (3/3) in 0:00.010

SUCCESS: Applied version+ to 3 projects in 0:00.400
$ lein monolith each :parallel 4 version+
Applying version+ to 3 subprojects...
'version+' is not a task. See 'lein help'.

Did you mean this?
         version
greglook commented 3 years ago

Aha, this is because in the parallel case lein-monolith tries to resolve the tasks ahead of time to prevent concurrent namespace loading, which is known to cause issues. It looks like resolve-tasks doesn't correctly expand aliases.