Fork me on GitHub

Launchpad 0.9.49-alpha is out, a Clojure nREPL launcher offering quality of life and fewer REPL restarts. • allow specifying additional alias definitions in deps.local.edn (also hot-reloads) • kill the clojure process when launchpad dies, and vice versa

🚀 16
arohner19:10:25 is now stable. rules_clojure adds Clojure support to Bazel, the multi-language build tool. Bazel supports test caching and Remote Build Execution for dramatically faster build and test times

🙌 10
👀 2
🎉 7
Jungwoo Kim09:07:41

Hi! I would like to inquire about the rules_clojure example. You can find the reproduced rules_clojure example repository at this link: My intention is to create mono-repo examples based on this repository. The repository consists of three dummy projects, each with slight differences: 1. The bazel-super-simple-example project is identical to your example. 2. The bazel-simple-example project has a minor difference: it does not have its own WORKSPACE file. 3. The bazel-example project is a real-world example that includes resources, deps, and src. My primary objective is to build the bazel-example project using rules_clojure. However, I encountered an issue when attempting to build the bazel-super-simple-example project:

#error {
 :cause Assert failed: couldn't find nses: #{example}
(= (count nses) (count compile-nses))
Do you have any ideas why this error is occurring?


That error is because the ns wasn’t found on the classpath. clojure rules is built on top of bazel’s java rules, which require using the maven layout. If you don’t want to use the maven layout (we don’t at Griffin), you’ll have to use resource_strip_prefix



load("@rules_clojure//:rules.bzl", "clojure_library")

    name = "example",
    srcs = ["example.clj"],
    aot = ["example"],
    resource_strip_prefix = "bazel-super-simple-example"


That worked for me, but then complained about not having a clojure dependency on the classpath.


You can either use gen_src described in the README to parse a deps.edn, or if you want stay in pure bazel

Jungwoo Kim08:07:03

I had no prior knowledge of the Maven layout, but thanks to you, I now understand it. Your explanation helped me progress. By the way, in my repository, the simple-example project is functioning correctly. However, the example project is throwing an error:

Could not locate jungwoo/bazel_example/web/middleware/formats__init.class, jungwoo/bazel_example/web/middleware/formats.clj, or jungwoo/bazel_example/web/middleware/formats.cljc on the classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
Interestingly, all of the files have correct dashes (-) in their names, except for that specific file which is causing trouble. Do you have any insights into this issue? Could it be related to a bug in rules_clojure?


idiomatically, Java bazel expects the BUILD file to be in the same directory as the source files. resource_strip_prefix uses the current directory to figure out the destination path. I haven’t experimented with the layout you’re using, with one BUILD at the src root

Jungwoo Kim08:07:21

> idiomatically, Java bazel expects the BUILD file to be in the same directory as the source files. That's TIL. Thanks again. But still, moving the BUILD file into the src files wouldn't resolve the problem. the problem is the specific file has a problem. Seems pretty weird. With experiments, I changed all namespaces with no dashes but the same error occurs with formats.clj files. (

Jungwoo Kim12:07:03

Plus, I want to ask you idiomatic ways to configure clojure in monorepo. I'm guessing things from your mention, you would only use a single deps.edn in the root where WORKSPACE is located and no other deps.edn in the each directories(projects)? FYI) I'm a beginner of bazel but i'm familiar with Clojure and polylith.

Jungwoo Kim13:07:42

By the way, I just the function gen_srcs and I expected generating a BUILD files in gen-example and example directory. It generates BUILD.bazel but it couldn't actually build it; worker failed


Neil, a CLI tool to add common aliases and features to deps.edn-based projects. 0.1.46 (2022-10-12) • Introduce neil dep upgrade API for upgrading existing dependencies. By and • Add nix flake. By • neil version improvements. By Repo: Channel: #babashka-neil

🎉 13
👍 1