Code Monkey home page Code Monkey logo

Comments (7)

metasoarous avatar metasoarous commented on May 22, 2024

Hi @viesti. Thanks for reporting!

This issue is rather strange... It's not clear to me where the example.core ns is coming from. Can you please post more of the stacktrace there? Do you have any code in this repo aside from deps.edn?

Thanks again

from oz.

viesti avatar viesti commented on May 22, 2024

So dabbled a bit further, might be a difference in how tools.deps.alpha resolves the classpath:

cli:

0% cat deps.edn
{:deps {metasoarous/oz {:mvn/version "1.5.2"}}}
0% clj
Clojure 1.10.0
user=> (require '[clojure.java.io :as io])
nil
user=> (io/resource "public/index.html")
#object[java.net.URL 0x37ddb69a "jar:file:/Users/kimmoko/.m2/repository/markdown-to-hiccup/markdown-to-hiccup/0.6.1/markdown-to-hiccup-0.6.1.jar!/public/index.html"]

lein

0% cat project.clj
(defproject viesti/oz-test "0.1.0"
  :dependencies [[metasoarous/oz "1.5.2"]])
0% lein repl
nREPL server started on port 57002 on host 127.0.0.1 - nrepl://127.0.0.1:57002
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.10.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_191-b12
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (require '[clojure.java.io :as io])
nil
user=> (io/resource "public/index.html")
#object[java.net.URL 0x3569b91f "jar:file:/Users/kimmoko/.m2/repository/metasoarous/oz/1.5.2/oz-1.5.2.jar!/public/index.html"]

So with the cli, a different index.html get's resolved 😱

from oz.

metasoarous avatar metasoarous commented on May 22, 2024

Woah! Bizzaro.

Seems then like this should be reported as bug in one of tools.deps.alpha or Clojure CLI?

Thanks again

PS Random aside; I see you live in Espoo. Do you by happenstance know Timo Erkkilä?

from oz.

viesti avatar viesti commented on May 22, 2024

Happened to have a quick chat at #tools-deps, Dominic there pointed out that since there is a resource with same name in the classpath, one could use a namespaced prefix for the oz resource.

It just happens that the order of the deps that Leiningen resolves, doesn't surface this problem.

Re: Random Aside. Sorry, doesn't ring a bell immediately, among the Timos I know :)

from oz.

viesti avatar viesti commented on May 22, 2024

Actually, looking at contents of markdown-to-hiccup-0.6.1.jar, it might contain unnecessary artifacts (a dev time cljs compiler output). Still, if Oz is used as a dependency in a project, there will be a conflict with public/index.html, if the said project also has a resource with this name in it's classpath.

So maybe it would be best to have a unique name for this index resource, or generate it via code in the ring handler, to avoid name clashes on the classpath.

from oz.

metasoarous avatar metasoarous commented on May 22, 2024

This should be fixed now. Thanks @viesti!

from oz.

viesti avatar viesti commented on May 22, 2024

Glad to help :)

from oz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.