clerk icon indicating copy to clipboard operation
clerk copied to clipboard

certain forms of "require" like dependency not detected by Clerk

Open behrica opened this issue 3 years ago • 3 comments

In using require-python from libpython-clj teh dependency detection is not working:

(require-python '[os :as os])
(os/getcwd)

fails with "os not found"

behrica avatar Mar 18 '22 22:03 behrica

Same for "import":

(import java.awt.image.BufferedImage
        java.awt.Color
        sun.java2d.SunGraphics2D)
        

behrica avatar May 10 '22 12:05 behrica

There are some more cases. Each time a clojure var is defined "dynamically" (and not via def(n), Clerk fails to detect it.

This is probably just a consequence of the static dependency parsing and cannot be solved completely. It should maybe documented n some form of list of "Clojure features not supported by Clerk evaluation"

behrica avatar May 11 '22 17:05 behrica

Yep, the require-python uses intern eventually which makes it hard to detect via static analysis. Thinking we could do something based on with-redefs however or at least detect that something depends on intern and warn.

The import issue is different and should be easily solvable. Feel free to move that to a separate issue.

mk avatar May 11 '22 19:05 mk