datahike

Bruno do Nascimento Maciel 2024-02-13T12:07:01.158119Z

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 Maciel 2024-02-13T12:07:50.252219Z

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>311 Compiling Java classes saving them to 'target-http-server/classes'...%

timo 2024-02-13T15:29:11.187489Z

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

timo 2024-02-13T15:31:25.165329Z

Apple Silicon?

1
Bruno do Nascimento Maciel 2024-02-13T15:31:34.421939Z

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

timo 2024-02-13T15:34:10.921769Z

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.

timo 2024-02-13T15:34:32.486289Z

Maybe I broke something

timo 2024-02-13T15:35:28.169739Z

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

timo 2024-02-13T15:37:07.027689Z

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

Bruno do Nascimento Maciel 2024-02-13T15:38:38.272099Z

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

timo 2024-02-13T15:42:39.130869Z

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

timo 2024-02-13T15:44:49.193939Z

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

Bruno do Nascimento Maciel 2024-02-13T15:54:14.872819Z

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.

timo 2024-02-13T15:57:47.081449Z

ok, cool. thanks for putting in the effort

Bruno do Nascimento Maciel 2024-02-13T16:07:17.118999Z

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 Maciel 2024-02-13T16:07:58.931279Z

Also tried with versions after 0.1.2 with no success

timo 2024-02-13T16:14:08.043269Z

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 Maciel 2024-02-13T17:07:42.750319Z

Bruno do Nascimento Maciel 2024-02-13T17:07:49.640409Z

Now I am getting this exception while executing the jar

Bruno do Nascimento Maciel 2024-02-13T17:08:11.782829Z

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

Bruno do Nascimento Maciel 2024-02-13T17:08:26.047489Z

Do you know what this exception means?

Bruno do Nascimento Maciel 2024-02-13T17:14:50.197589Z

I am using the default config as documented.

whilo 2024-02-13T22:03:54.400759Z

Hey @brunodonascimentomaci. This happened to me before with this line https://github.com/replikativ/datahike/blob/main/src/datahike/tools.cljc#L155

whilo 2024-02-13T22:04:21.778949Z

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

whilo 2024-02-13T22:04:58.578309Z

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

Bruno do Nascimento Maciel 2024-02-14T00:23:26.462419Z

It worked!!

Bruno do Nascimento Maciel 2024-02-14T00:24:34.826119Z

I added the "resources" directory to :src-dirs https://github.com/replikativ/datahike/blob/4b3a87da8ce79eaa26d680c3bf91a9ed390b0c45/config.edn#L21-L30

Bruno do Nascimento Maciel 2024-02-14T00:25:22.812299Z

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

whilo 2024-02-14T00:25:30.828399Z

Sure! Thanks!

whilo 2024-02-14T00:25:51.156829Z

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

๐Ÿ‘ 1
Bruno do Nascimento Maciel 2024-02-14T01:30:24.851299Z

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 .

whilo 2024-02-14T01:42:38.436479Z

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

๐Ÿ‘ 1
borkdude 2024-02-14T16:52:37.485829Z

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

๐ŸŽ‰ 1
โœ… 2
2
Bruno do Nascimento Maciel 2024-02-14T18:01:05.722559Z

@borkdude It worked!

borkdude 2024-02-14T20:21:01.057859Z

๐Ÿ‘