This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-12
Channels
- # announcements (13)
- # aws (18)
- # babashka (60)
- # babashka-sci-dev (83)
- # beginners (32)
- # biff (18)
- # calva (22)
- # cider (8)
- # clj-on-windows (101)
- # clojure (59)
- # clojure-bay-area (2)
- # clojure-europe (36)
- # clojure-india (4)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (5)
- # conjure (1)
- # core-async (10)
- # cursive (7)
- # data-science (5)
- # datahike (10)
- # datalog (11)
- # datomic (3)
- # docker (3)
- # figwheel-main (2)
- # gratitude (3)
- # improve-getting-started (1)
- # introduce-yourself (5)
- # jobs (3)
- # joyride (12)
- # leiningen (1)
- # lsp (67)
- # malli (27)
- # off-topic (36)
- # random (1)
- # rdf (1)
- # re-frame (17)
- # reagent (21)
- # reitit (4)
- # releases (4)
- # remote-jobs (2)
- # ring (2)
- # sci (35)
- # shadow-cljs (28)
- # sql (3)
- # squint (9)
- # tools-deps (11)
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
https://github.com/lambdaisland/launchpad
https://github.com/griffinbank/rules_clojure 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
Hi! I would like to inquire about the rules_clojure example. You can find the reproduced rules_clojure example repository at this link: https://github.com/jungwookim/rules_clojure_example. 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))
error.
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
Try:
load("@rules_clojure//:rules.bzl", "clojure_library")
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 https://github.com/bazelbuild/rules_jvm_external if you want stay in pure bazel
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
> 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. (java.io.FileNotFoundException)
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.
By the way, I just https://github.com/jungwookim/rules_clojure_example/commit/a97fe8609fdd5ee015b303223746ad83ca893eaf 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 https://github.com/teodorlu and https://github.com/russmatney.
• Add nix flake. By https://github.com/jlesquembre.
• neil version
improvements. By https://github.com/rads.
Repo: https://github.com/babashka/neil
Channel: #babashka-neil