Fork me on GitHub
#hyperfiddle
<
2023-09-02
>
wei00:09:59

I'm working on a electric/xtdb/fly.io starter example (https://github.com/yayitswei/electric-xtdb-starter-fly-io), currently troubleshooting an uberjar issue in this #xtdb thread: https://clojurians.slack.com/archives/CG3AM2F7V/p1693613079965599?thread_ts=1677430221.688989&amp;cid=CG3AM2F7V. lmk if you have any insights, thanks!

Dustin Getz00:09:51

move user.clj off classpath uberjar build, put it in src-dev or something and adjust deps.edn accordingly

👀 2
Dustin Getz00:09:22

this has been addressed in the starter app i believe or if not is about to be in the next version

Dustin Getz00:09:58

i cannot explain the issue but search this channel for the NoClassDefError

wei19:09:54

thanks for the tip, that did the trick. working deployment at https://electric-xtdb-starter.fly.dev/

wei19:09:07

took longer to troubleshoot because the cljs build was failing but the deployment continued. any good way to stop the build on cljs compilation failure?

wei19:09:18

for that matter, i'm having a hard time seeing the full build log. I'm using NO_COLOR=1 but still seeing the truncated logs -- are there any other tricks to see the full log?

Dustin Getz19:09:09

builds are getting redone, file any issues on the repo and i’ll confirm when we fan out the changes to all the starter repos

👍 2
wei19:09:15

(understand this is more of a http://fly.io question, i can ask around as well)

wei19:09:00

sg thanks!

Dustin Getz19:09:10

i don’t really understand the question about build logs, i think we use github actions for our builds so we go there for the logs? is this a docker question?

Dustin Getz19:09:44

fly sends runtime logs to any configured cloud logger service, but i don’t think build logs would go there

wei19:09:09

iiuc the electric starter app is configured to build on a http://fly.io machine. i can see runtime logs on http://fly.io, but not build logs, it just flies by in that truncated format. i copied the electric starter app deploy configuration for the xtdb starter.

Dustin Getz19:09:50

[deleted confused replies]

Dustin Getz20:09:00

You can use this snippet to fail the shadow build, until we get it landed everywhere:

(as->
        (shadow-api/release :prod
          {:debug debug,
           :verbose verbose,
           :config-merge
           [{:compiler-options {:optimizations (if optimize :advanced :simple)}
             :closure-defines {'hyperfiddle.electric-client/ELECTRIC_USER_VERSION electric-user-version}}]})
        shadow-status (assert (= shadow-status :done) "shadow-api/release error")) ; fail build on error

Dustin Getz20:09:24

you'll need to adapt it to look like whatever your app has in build.clj, this has other changes

Dustin Getz20:09:19

I have not fully tested it, iiuc an exception is sufficient but you can add a (System/exit 1) if CI needs us to "fail harder"

wei20:09:00

that's helpful, thanks! i ended up running the build locally in docker to find out what the cljs compiler was complaining about