Open den1k opened 4 years ago
This post has a workaround that works, but I'll be the first to admit that it's a little janky...
There might be others but I have made a buildpack that supports tools.deps natively
Neat, thank you both! Ended up using dokku 😜
@den1k any chance you might consider reopening this, for the benefit those of us who are using Heroku?
@pmonks ☝
This post has a workaround that works, but I'll be the first to admit that it's a little janky...
As mentioned in the post, the clj
command will not work. With clojure
instead of clj
I can not build with tools.build
This seems to be a bug: The log says Installing rlwrap
and a few lines later Please install rlwrap for command editing or use "clojure" instead.
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Clojure app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Installing rlwrap...
remote: Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
remote: Get:2 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease [86.6 kB]
remote: Get:3 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages [349 kB]
remote: Get:4 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
remote: Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
remote: Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1,275 kB]
remote: Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
remote: Get:8 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,179 kB]
remote: Get:9 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [801 kB]
remote: Get:10 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,085 kB]
remote: Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,626 kB]
remote: Fetched 18.2 MB in 2s (7,593 kB/s)
remote: Reading package lists...
remote: Reading package lists...
remote: Building dependency tree...
remote: The following NEW packages will be installed:
remote: rlwrap
remote: 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
remote: Need to get 98.2 kB of archives.
remote: After this operation, 309 kB of additional disk space will be used.
remote: Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 rlwrap amd64 0.43-1build3 [98.2 kB]
remote: Fetched 98.2 kB in 0s (266 kB/s)
remote: Download complete and in download only mode
remote: -----> Installing Clojure 1.10.3.986 CLI tools
remote: Downloading and expanding tar
remote: Installing libs into /tmp/build_64e689d6/.heroku/clj/lib/clojure
remote: Installing clojure and clj into /tmp/build_64e689d6/.heroku/clj/bin
remote: Installing man pages into /tmp/build_64e689d6/.heroku/clj/share/man/man1
remote: Removing download
remote: Use clj -h for help.
remote:
remote: ! WARNING: No :min-lein-version found in project.clj; using 1.7.1.
remote: You probably don't want this!
remote:
remote: -----> Installing Leiningen
remote: Downloading: leiningen-1.7.1-standalone.jar
remote: To use Leiningen 2.x, add this to project.clj: :min-lein-version "2.0.0"
remote: Writing: lein script
remote: -----> Building with Leiningen
remote: Found bin/build; running it instead of default lein invocation.
remote: Running: bin/build
remote: Please install rlwrap for command editing or use "clojure" instead.
remote: ! Failed to build.
remote: ! Push rejected, failed to compile Clojure app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to morning-earth-25682.
remote:
To https://git.heroku.com/morning-earth-25682.git
@lhrb what's in your bin/build
file? Here's a working example, if that's helpful: https://github.com/pmonks/for-science/blob/main/bin/build
@pmonks thank you. I was using clj -T:build uber
and swapped it with clojure
which did not work out of the box.
#!/usr/bin/env bash
clojure -T:build uber
And what's the error with clojure
? Still the same thing (complaining about rlwrap
)?
No it says clojure.tools.reader
not found
clojure/tools/namespace/parse.cljc
clojure.tools.reader I don't know, maybe herokus default clojure version is < 1.4?
remote: Syntax error compiling at (clojure/tools/namespace/parse.cljc:55:19).
remote: No such var: reader/read
remote:
remote: Full report at:
remote: /tmp/clojure-1465252957741127728.edn
remote: ! Failed to build.
remote: ! Push rejected, failed to compile Clojure app.
Which version of org.clojure/clojure
are you using in your deps.edn
file?
I'm using org.clojure/clojure {:mvn/version "1.10.3"}
Lots of projects now use tools.deps with the Clojure CLI.
Personally, I haven't used leiningen in over a year and avoid uberjar whereever I can (and I very well can with tools.deps!)
If a project has a
deps.edn
it can be run directly (no uberjars needed):clj -m my-project.main
This is a much simpler, lightweight and flexible approach. It would be awesome if heroku supported it, especially given that it looks like the Clojure CLI is already installed by this buildpack.