Fork me on GitHub
#datahike
<
2024-02-13
>
Bruno do Nascimento Maciel12:02:01

Hey folks! I am getting an exception (`No matching method equals found taking 1 args for class java.io.File`) while trying to create jar bb http-server-uber on Mac ๐Ÿงต(Complete Stacke trace)

Bruno do Nascimento Maciel12:02:50

Cleaning up target directory 'target-http-server'...Done. ----- Error -------------------------------------------------------------------- Type: clojure.lang.ExceptionInfo Message: No matching method equals found taking 1 args for class java.io.File Data: {:type "class java.lang.IllegalArgumentException"} Location: /Users/bruno.nascimento/.gitlibs/libs/io.github.babashka/tools.bbuild/73e4d0a26c65cdf1d4c7bf7e9e46e6e5f1978a37/src/main/clojure/clojure/tools/build/util/pod.clj:1:29 ----- Context ------------------------------------------------------------------ 1: (ns clojure.tools.build.util.pod ^--- No matching method equals found taking 1 args for class java.io.File 2: (:require [clojure.string :as str])) 3: 4: (def windows? (str/starts-with? 5: (System/getProperty "os.name") 6: "Windows")) ----- Stack trace -------------------------------------------------------------- babashka.pods.impl/processor - <built-in> babashka.pods.sci/load-pod/fn--26975 - <built-in> clojure.tools.deps/create-basis - /Users/bruno.nascimento/.gitlibs/libs/io.github.babashka/tools.bbuild/73e4d0a26c65cdf1d4c7bf7e9e46e6e5f1978a37/src/main/clojure/clojure/tools/build/util/pod.clj:1:29 clojure.tools.deps/create-basis - /Users/bruno.nascimento/.gitlibs/libs/io.github.babashka/tools.bbuild/73e4d0a26c65cdf1d4c7bf7e9e46e6e5f1978a37/src/main/clojure/clojure/tools/build/util/pod.clj:1:1 clojure.tools.build.tasks.create-basis - /Users/bruno.nascimento/.gitlibs/libs/io.github.babashka/tools.bbuild/73e4d0a26c65cdf1d4c7bf7e9e46e6e5f1978a37/src/main/clojure/clojure/tools/build/tasks/create_basis.clj:30:6 ... (run with --debug to see elided elements) tools.build - /Users/bruno.nascimento/Documents/personal-projects/datahike/bb/src/tools/build.clj:24:21 clojure.tools.build.api/javac - /Users/bruno.nascimento/.gitlibs/libs/io.github.babashka/tools.bbuild/73e4d0a26c65cdf1d4c7bf7e9e46e6e5f1978a37/src/main/clojure/clojure/tools/build/api.clj:320:1 tools.build/compile-java - /Users/bruno.nascimento/Documents/personal-projects/datahike/bb/src/tools/build.clj:22:4 tools.build/compile-java - /Users/bruno.nascimento/Documents/personal-projects/datahike/bb/src/tools/build.clj:18:1 user-ce2c7348-f79c-4c30-8d89-11031dde2018 - <expr>:31:1 Compiling Java classes saving them to 'target-http-server/classes'...%

timo15:02:11

Hi @U0686RN9X0W. Did you ever use this command successfully?

timo15:02:25

Apple Silicon?

yes 1
Bruno do Nascimento Maciel15:02:34

It is the first time that I am trying to run this command. I was following the documentation https://cljdoc.org/d/io.replikativ/datahike/0.6.1555/doc/distribution#setup-datahikehttpserver

timo15:02:10

There might be a problem with tools-deps-native. I know this problem because I am trying to build datahike binaries for all the architectures and had to contribute something for tdn therefor.

timo15:02:32

Maybe I broke something

timo15:02:28

You could run the corresponding clojure tasks without babashka to build the http-server

timo15:02:07

it's quite tedious tbh but possible... sorry that this is the only answer for now

Bruno do Nascimento Maciel15:02:38

I am not sure how to do that but I am going to try

timo15:02:39

You could try bumping the tools.deps.native version to 0.1.5 maybe that works

timo15:02:49

it doesn't work for me on an intel machine unfortunately

Bruno do Nascimento Maciel15:02:14

Bumping the tools.deps.native version did not work, but I checked out to more old commits and it worked. I am going to try to find the exactly commit that introduced the break changes.

timo15:02:47

ok, cool. thanks for putting in the effort

Bruno do Nascimento Maciel16:02:17

The problem started at https://github.com/replikativ/datahike/commit/ce74c913987b8e0f4eff3191b775f490df4ce38b. I tried to apply the changes incrementally until I was able to reproduce the error. It turned out that bumping org.babashka/tools-deps-native from 0.1.1 to 0.1.2 caused the problem.

Bruno do Nascimento Maciel16:02:58

Also tried with versions after 0.1.2 with no success

timo16:02:08

yeah, that might be possible. I assume the mac binaries somehow got overwritten with some bad binary for mac aarch64 on release 0.1.2 but I don't know exactly if it worked with mac aarch64 in the first place because I didn't test it. but hopefully we will find the problem soon.

Bruno do Nascimento Maciel17:02:49

Now I am getting this exception while executing the jar

Bruno do Nascimento Maciel17:02:11

java -jar datahike-http-server.jar datahike.config.edn

Bruno do Nascimento Maciel17:02:26

Do you know what this exception means?

Bruno do Nascimento Maciel17:02:50

I am using the default config as documented.

whilo22:02:21

Maybe we have to handle this differently or make sure that it is packaged into the jar properly if it isn't.

whilo22:02:58

Can you put a logo file into your resources and retry?

Bruno do Nascimento Maciel00:02:22

If you let me I can open a PR with this change.

whilo00:02:30

Sure! Thanks!

whilo00:02:51

I would also love to hear how you are doing with the server once it is up.

๐Ÿ‘ 1
Bruno do Nascimento Maciel01:02:24

I filled out a https://github.com/replikativ/datahike/issues/663 to document the problem and the rational for the fix. Opened a https://github.com/replikativ/datahike/pull/664 downgrading org.babashka/tools-deps-native from 0.1.2 to 0.1.1 and adding the resources directory to :src-dirs .

whilo01:02:38

@U4GEXTNGZ I greenlighted the PR, but I will wait for your feedback on tools-deps-native.

๐Ÿ‘ 1
borkdude16:02:37

@U0686RN9X0W are you the one on a mac aarch64 machine? try deleting ~/.babashka/pods/repository/org.babashka/tools-deps-native/ and try again

yes 2
โœ… 2
๐ŸŽ‰ 1