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

Version 1.2.4 with Babashka throws an exception #253

Closed
rads opened this issue Aug 14, 2022 · 3 comments
Closed

Version 1.2.4 with Babashka throws an exception #253

rads opened this issue Aug 14, 2022 · 3 comments

Comments

@rads
Copy link

rads commented Aug 14, 2022

$ BABASHKA_PRELOADS="" bb --config <(echo "{:deps {zprint/zprint {:mvn/version \"1.2.3\"} org.babashka/spec.alpha {:git/url \"https://github.com/babashka/spec.alpha\" :git/sha \"8df0712896f596680da7a32ae44bb000b7e45e68\"}}}") -e "(require '[zprint.core :as z]) (z/czprint {:a 1})"
{:a 1}

$ BABASHKA_PRELOADS="" bb --config <(echo "{:deps {zprint/zprint {:mvn/version \"1.2.4\"} org.babashka/spec.alpha {:git/url \"https://github.com/babashka/spec.alpha\" :git/sha \"8df0712896f596680da7a32ae44bb000b7e45e68\"}}}") -e "(require '[zprint.core :as z]) (z/czprint {:a 1})"
----- Error --------------------------------------------------------------------
Type:     java.lang.Exception
Message:  of-node* does not exist
Location: zprint/zutil.cljc:3:3

----- Context ------------------------------------------------------------------
1: ;!zprint {:style :require-justify}
2: (ns ^:no-doc zprint.zutil
3:   (:require
     ^--- of-node* does not exist
4:     #?@(:bb []
5:         :clj [[zprint.macros :refer [do-redef-vars]]])
6:     clojure.string
7:     zprint.zfns
8:     #?@(:clj [[zprint.redef]])

----- Stack trace --------------------------------------------------------------
zprint.zutil   - zprint/zutil.cljc:3:3
zprint.rewrite - zprint/rewrite.cljc:2:3
zprint.config  - zprint/config.cljc:7:3
zprint.zprint  - zprint/zprint.cljc:6:3
zprint.core    - zprint/core.cljc:5:3
user           - <expr>:1:1
@kkinnear
Copy link
Owner

Yes, this is because zprint 1.2.4 upgraded its dependency on rewrite-clj, and since rewrite-clj deprecated edn*, zprint started using of-node*. But babashka hadn't updated to the new version of rewrite-clj, and which version zprint was using ended up being the built-in version of rewrite-clj in babashka. I asked how to solve this over at babashka, and the suggestion was to use a pre-release of babashka from here

When I used a binary from this release: v0.9.162-SNAPSHOT it all worked for me.

I'm sorry that you need use a pre-release of babashka to fix this problem -- I spent a good while trying to figure out how to exclude rewrite-clj from babashka, with no success. I'm also sorry that I didn't test 1.2.4 better, as I have a test for babashka which I neglected to run. I'll ensure that I don't do that again.

Thanks for bringing this up!

@rads
Copy link
Author

rads commented Aug 14, 2022

All good, just wanted to document it in case others were wondering in the mean time. Thanks for this awesome library!

@kkinnear
Copy link
Owner

The current babashka is babashka v1.0.169, which works fine with zprint.

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

No branches or pull requests

2 participants