Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI and tools.deps support #75

Open
den1k opened this issue Mar 6, 2020 · 12 comments
Open

CLI and tools.deps support #75

den1k opened this issue Mar 6, 2020 · 12 comments

Comments

@den1k
Copy link

den1k commented Mar 6, 2020

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.

@pmonks
Copy link

pmonks commented Jun 27, 2020

This post has a workaround that works, but I'll be the first to admit that it's a little janky...

@raymcdermott
Copy link

There might be others but I have made a buildpack that supports tools.deps natively

https://github.com/raymcdermott/heroku-deps-build-pack

@den1k
Copy link
Author

den1k commented Aug 2, 2021

Neat, thank you both! Ended up using dokku 😜

@pmonks
Copy link

pmonks commented Oct 12, 2021

@den1k any chance you might consider reopening this, for the benefit those of us who are using Heroku?

@den1k den1k reopened this Oct 13, 2021
@den1k
Copy link
Author

den1k commented Oct 13, 2021

@pmonks

@lhrb
Copy link

lhrb commented Oct 24, 2021

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

@pmonks
Copy link

pmonks commented Oct 24, 2021

@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

@lhrb
Copy link

lhrb commented Oct 24, 2021

@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

@pmonks
Copy link

pmonks commented Oct 24, 2021

And what's the error with clojure? Still the same thing (complaining about rlwrap)?

@lhrb
Copy link

lhrb commented Oct 24, 2021

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.

@pmonks
Copy link

pmonks commented Oct 24, 2021

Which version of org.clojure/clojure are you using in your deps.edn file?

@lhrb
Copy link

lhrb commented Oct 25, 2021

I'm using org.clojure/clojure {:mvn/version "1.10.3"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants