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

JVM incompatibility #25

Open
borkdude opened this issue Dec 3, 2020 · 2 comments
Open

JVM incompatibility #25

borkdude opened this issue Dec 3, 2020 · 2 comments

Comments

@borkdude
Copy link
Contributor

borkdude commented Dec 3, 2020

When using this library on the JVM, there appears to be a problem with the bootleg pod that does not manifest with babashka native.

(ns html  (:require [babashka.curl :as curl]
                    #_[pl.danieljanus.tagsoup :as html]
                    [babashka.pods :as pods]
                    ))
;;; use pods to load bootleg for html parsing: https://github.com/retrogradeorbit/bootleg#babashka-pod-usage
;;; Note that you have to install bht pod on the system first!
(pods/load-pod "bootleg")
(require '[pod.retrogradeorbit.bootleg.utils :as utils])
(utils/html->hiccup "<html><body><p>ahoj</p></body></html>")
{:aliases {:clj {:extra-deps {;; Additional libs for clojure to match babashka includes
                              org.clojure/tools.cli {:mvn/version "1.0.194"}
                              org.clojure/data.csv {:mvn/version "1.0.0"}
                              org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}
                              babashka/babashka.curl {:mvn/version "0.0.1"}
                              ;; used pods to load bootleg for HTML parsing: https://github.com/retrogradeorbit/bootleg#babashka-pod-usage
                              babashka/babashka.pods {:git/url "https://github.com/babashka/pods.git"
                                                      ;; https://github.com/babashka/pods/commit/1417f30fc4001cc9490b5f83c68630ea877d92d6
                                                      :sha "9d363c7d3c740b2f333a58eafb9afaa25b09aaca"}
                              cheshire/cheshire {:mvn/version "5.10.0"}}
                 :extra-paths ["dev"]}}
 :paths ["src"]
 :deps {clj-tagsoup/clj-tagsoup {:mvn/version "0.3.0"}}}
$ clojure -M:clj bootleg.clj
Checking out: https://github.com/babashka/pods.git at 9d363c7d3c740b2f333a58eafb9afaa25b09aaca
Syntax error (ClassNotFoundException) compiling at (REPL:1:102).
clojure.zip

Full report at:
/var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/clojure-5852486966441112648.edn
@borkdude
Copy link
Contributor Author

borkdude commented Dec 3, 2020

This seems to be solved by adding a (require '[clojure.zip]):

(ns html  (:require [babashka.pods :as pods]))
(require '[clojure.zip])
(def pod (pods/load-pod "bootleg"))
(require '[pod.retrogradeorbit.bootleg.utils :as utils])
(prn (utils/html->hiccup "<html><body><p>ahoj</p></body></html>"))

(pods/unload-pod pod)
(shutdown-agents)

@retrogradeorbit Do you think the require could be added to the bootleg pod somehow to make it compatible with the JVM?

PS: note that I also have to unload the pod and call shutdown-agents to exit the JVM normally.

@retrogradeorbit
Copy link
Member

I missed this at the time. I wish github had webpush notifications for this stuff.
I will have a look at this.

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