babashka-sci-dev

lispyclouds 2022-04-15T11:39:11.652399Z

https://github.com/babashka/babashka/pull/1243

lispyclouds 2022-04-15T11:40:00.123509Z

missed out the damned =~ in the shell code 😞

❤️ 1
🚀 1
borkdude 2022-04-15T11:40:48.524069Z

at least we can blame bash again with their weird syntax!

lispyclouds 2022-04-15T11:42:36.243669Z

also for only having the arm ones and not amd, tested the env parsing bit locally, not sure was that related to this too?

borkdude 2022-04-15T11:42:53.290549Z

[clojure.string :as s] , can we use :as str ?

borkdude 2022-04-15T11:43:20.679059Z

well, before that everything still worked, so I think it was related to this PR?

borkdude 2022-04-15T11:43:47.522169Z

(def snapshot? (str/includes? image-tag "SNAPSHOT"))
(question mark + alias)

lispyclouds 2022-04-15T11:43:51.815359Z

> can we use :as str ? i can, just the the colouring gets a bit weird for me as it thinks its the core/str

lispyclouds 2022-04-15T11:44:00.419359Z

i can do full string?

borkdude 2022-04-15T11:44:12.940909Z

that's a problem of your tool, not of how people usually write clojure ;)

lispyclouds 2022-04-15T11:44:17.234609Z

yeah

lispyclouds 2022-04-15T11:47:17.033619Z

> def snapshot? i was following the recommendation of adding a ? only in preds

borkdude 2022-04-15T11:47:48.394579Z

I think it's clearer that way

lispyclouds 2022-04-15T11:47:52.052229Z

cool

borkdude 2022-04-15T11:48:21.578109Z

I've tried implementing a linter for the ? behavior but it's impossible, people use it in too many different ways

borkdude 2022-04-15T11:48:49.628879Z

e.g also in keywords/destructuring, while they're not predicates, I gave up enforcing anything around that

lispyclouds 2022-04-15T11:49:22.782469Z

makes sense, i too never understood the consistency of ! and ?

borkdude 2022-04-15T11:52:00.879589Z

I think the PR looks good now aside from those minor things. But how can we test if the arches are correct now since they weren't last time? Was the problem that the :latest image was now arm64 instead of amd64?

borkdude 2022-04-15T11:54:54.648529Z

Maybe add some debug printlns in there so we can follow more closely what it's doing?

borkdude 2022-04-15T11:55:24.972339Z

and then enable in your PR branch so we can test before merge

lispyclouds 2022-04-15T11:55:50.681799Z

yeah, but it gets lost in the buildx noise, what im trying to do is run this locally with some prints and the same env vars

lispyclouds 2022-04-15T11:55:56.419609Z

will add the prints too

borkdude 2022-04-15T11:56:05.284409Z

Ah, the original bash script checked if we were on master, but this script doesn't?

lispyclouds 2022-04-15T11:56:30.827259Z

thats the check we are enforcing from circle yaml anyways right?

lispyclouds 2022-04-15T11:56:37.399289Z

i thought thats redundant

borkdude 2022-04-15T11:57:22.647469Z

I think we should leave it in. Make minimal changes to the logic while porting

borkdude 2022-04-15T11:57:31.825069Z

stay as close as possible to the original

lispyclouds 2022-04-15T11:57:37.596009Z

right

lispyclouds 2022-04-15T12:05:59.367819Z

if you see https://circleci.com/api/v1.1/project/github/babashka/babashka/28238/output/106/0?file=true&allocation-id=62589614992d06610392c011-0-build%2FG2BIUGKC it is pushing all the relevant images. Search for Building and pushing

lispyclouds 2022-04-15T12:06:12.887179Z

this is the log when its merged to master

borkdude 2022-04-15T12:06:56.036959Z

Maybe amd64 latest was overwritten with arm64 latest?

lispyclouds 2022-04-15T12:07:52.007649Z

ah could be, and now if i put in the same checks as the shell, it wont run, will put it back along with the circle yaml

lispyclouds 2022-04-15T12:14:25.231109Z

yes i see the issue, the --platform in buildx is the whole comma separated string not each one

lispyclouds 2022-04-15T12:14:41.214819Z

the naming of the vars confused me

lispyclouds 2022-04-15T12:14:55.137089Z

the split is there only to make the folders

lispyclouds 2022-04-15T12:16:27.298749Z

and its not in the loop, my head hurts

borkdude 2022-04-15T12:19:56.582219Z

maybe the problem is that you think too much, just stay as close to the bash script as possible and don't think? :)

borkdude 2022-04-15T12:20:17.758479Z

that's what I've basically done with deps.clj too when porting the clojure bash script :P

lispyclouds 2022-04-15T12:21:13.234759Z

yeah its me more misreading the $p and $platform and the loops i think

lispyclouds 2022-04-15T12:21:41.468229Z

issue was $platform can both have one or more things

borkdude 2022-04-15T12:23:30.728259Z

maybe it should be renamed to platforms?

lispyclouds 2022-04-15T12:29:08.357829Z

yeah thats what i was trying the clojure side and messed up the loops

lispyclouds 2022-04-15T12:29:52.589389Z

i can rename the env var too if this works fine now

borkdude 2022-04-15T12:46:14.737229Z

Why is there is a replacement of / to - in the platform names? Why aren't they - in the first place?

cap10morgan 2022-04-15T16:37:51.704939Z

docker wants os/arch, tarballs need os-arch. that's all.

borkdude 2022-04-15T12:46:28.684679Z

Just a question, not a request for change

lispyclouds 2022-04-15T12:51:25.728409Z

my undesrstanding is that / is generally the way to specify it and we use - in the tar gz files

lispyclouds 2022-04-15T12:51:33.899999Z

we could keep it to -

lispyclouds 2022-04-15T12:52:57.889569Z

the / also aids a bit in putting the bins in the correct place and thats how the http://dockerfile.ci picks it up but all that can be changed to - too

borkdude 2022-04-15T12:53:51.402079Z

it's fine, let's not change too much

lispyclouds 2022-04-15T12:54:34.351389Z

yeah its mostly driven by the docker convention of / and mapping it to the names we are using in the releases

borkdude 2022-04-15T12:55:04.664129Z

ok, all set for merge now?

lispyclouds 2022-04-15T12:55:30.971319Z

adding the guards back

lispyclouds 2022-04-15T12:55:43.781029Z

docker hub looks okay i think: https://hub.docker.com/r/babashka/babashka/tags

borkdude 2022-04-15T12:56:12.947439Z

agreed

lispyclouds 2022-04-15T13:01:42.391759Z

should be good now

borkdude 2022-04-15T13:02:25.938759Z

hmm, clj-kondo should have caught that? https://github.com/babashka/babashka/commit/546ddbeae6b68d9b6c1dcd62751990b2379a1d02

lispyclouds 2022-04-15T13:03:04.523699Z

yeah my lsp inst triggering well

lispyclouds 2022-04-15T13:03:28.688489Z

probably wrong project root or something

borkdude 2022-04-15T13:03:42.993699Z

ok, let's ask @cap10morgan if he wants to glance over this PR as well https://github.com/babashka/babashka/pull/1243

👀 1
borkdude 2022-04-15T13:03:54.893759Z

after that, we merge

lispyclouds 2022-04-15T13:04:21.531619Z

yeah more people looking at it, the better

borkdude 2022-04-15T13:04:24.474629Z

thanks a lot for the extra work

lispyclouds 2022-04-15T13:04:36.686519Z

no worries, sorry for the bumps

❤️ 1
borkdude 2022-04-15T13:04:56.461799Z

any ideas when your talk is going to be out on video?

lispyclouds 2022-04-15T13:07:09.817109Z

well should be in https://novalug.org/presentations.html but yeah will drop them a mail about it

borkdude 2022-04-15T13:07:57.448319Z

don't mean to push them ;)

lispyclouds 2022-04-15T13:08:26.475219Z

yeah just a normal "we are excited to see it" mail 😛

lispyclouds 2022-04-15T13:43:28.188919Z

ah so if i add {:source-paths ["src" "test" ".circleci/script"]} to .lsp/config.edn the much needed linting and others work

lispyclouds 2022-04-15T13:43:52.051049Z

should this be checked in maybe?

borkdude 2022-04-15T13:44:33.981719Z

dunno, for me it always works

borkdude 2022-04-15T13:44:43.673149Z

regardless of source paths

lispyclouds 2022-04-15T13:45:20.220959Z

maybe its via flycheck not lsp?

borkdude 2022-04-15T13:46:14.225709Z

could be, but also navigation works for me on any script, even outside of source-paths

lispyclouds 2022-04-15T13:46:41.924809Z

yeah i can do that too, just that the linting bit doesnt work somehow 🤔

lispyclouds 2022-04-15T13:47:01.190369Z

i just have lsp, no dedicated kondo

borkdude 2022-04-15T13:47:02.430639Z

I use linting separately from clojure-lsp so that could be it

borkdude 2022-04-15T13:47:15.873159Z

but if nav works then why doesn't linting work, maybe ask in #lsp

borkdude 2022-04-15T13:47:29.171239Z

nav depends on clj-kondo analysis

lispyclouds 2022-04-15T13:47:46.431349Z

yeah i'll find a minimal repro

borkdude 2022-04-15T14:33:55.827589Z

Unintended effect of re-running 0.8.0 release :/ https://github.com/babashka/babashka/issues/1244

borkdude 2022-04-15T14:35:27.617249Z

I wouldn't be surprised if other package managers will also be affected by this

borkdude 2022-04-15T14:35:40.722129Z

Anyway :)

lispyclouds 2022-04-15T14:37:38.570299Z

yeah, more reminders for the amount of side effects 😕

lispyclouds 2022-04-15T14:39:19.265049Z

cant believe its all down to me not noticing the extra ~ in the =

borkdude 2022-04-15T14:45:07.999649Z

Arguably this is one of the most dangerous scripts to mess with, but now you've nailed it, the compile script should be far less error prone, as the test suite still comes after that

borkdude 2022-04-15T14:45:36.766369Z

don't know what other bash shit we have left

borkdude 2022-04-15T14:46:01.248349Z

the uberjar script is quite a monster too, I'll probably rewrite that to tools.build some day

borkdude 2022-04-15T14:46:23.771189Z

(we have uberjar + uberjar.bat, both a are pain)

lispyclouds 2022-04-15T14:46:29.659679Z

yeah dont think that can be bootstrapped with a bb jar i suppose

lispyclouds 2022-04-15T14:46:37.445369Z

compile yes

lispyclouds 2022-04-15T14:47:29.059839Z

if it can be moved to tools.build would be nicely cross platform too i hope

borkdude 2022-04-15T14:48:13.591199Z

yes

borkdude 2022-04-15T14:48:28.994079Z

also can get rid of lein completely then

borkdude 2022-04-15T14:48:42.727809Z

but I'll probably save that for a rainy Sunday

borkdude 2022-04-15T14:48:55.239169Z

or a boring train trip or so

lispyclouds 2022-04-15T14:49:51.162919Z

yeah im just more interested in purging the shell things

lispyclouds 2022-04-15T14:50:21.911109Z

bb src itself is the reason bb was built.

borkdude 2022-04-15T14:50:54.694969Z

bourne again bb

borkdude 2022-04-15T14:52:17.274719Z

W0000t! https://www.youtube.com/watch?v=ZvOs5Ele6VE

lispyclouds 2022-04-15T14:52:18.399239Z

would tools.build work well on windows? i could maybe take a crack at making compile+uberjar to that?

lispyclouds 2022-04-15T14:52:35.853299Z

aha

borkdude 2022-04-15T14:52:41.361899Z

We only need tools.build for the uberjar. The compile step should be separate.

borkdude 2022-04-15T14:53:21.847429Z

The reason to migrate would be the feature flag stuff which leads to complex shell scripts, but with tools.build this would be easy

borkdude 2022-04-15T14:54:36.477339Z

I guess the vid is still being rendered or so by youtube

lispyclouds 2022-04-15T14:55:19.285999Z

yeah, all of the intro to the talk is foreshadowing of the fuck ups i did yesterday 😛

🔥 1
borkdude 2022-04-15T15:00:50.098689Z

The video is a bit blurry but hopefully youtube is rendering it still for higher quality or so

lispyclouds 2022-04-15T15:02:35.519119Z

awesome! thanks a lot!

lispyclouds 2022-04-15T17:34:28.870849Z

docker hub looks good to me @borkdude @cap10morgan

🎉 1
lispyclouds 2022-04-15T17:35:19.660819Z

@cap10morgan for your context, this was the issue: https://clojurians.slack.com/archives/CLX41ASCS/p1650020392797919

borkdude 2022-04-15T19:18:57.337549Z

@rahul080327 @cap10morgan I'm doing a 0.8.1 release now, let's pay attention to dockerhub

borkdude 2022-04-15T19:19:03.369669Z

in 10 minutes or so

lispyclouds 2022-04-15T19:19:38.861849Z

on it

lispyclouds 2022-04-15T19:23:26.399649Z

thats a weird failure

borkdude 2022-04-15T19:23:51.736359Z

you mean the JVM? it happens sometimes, don't know why

lispyclouds 2022-04-15T19:23:57.320599Z

yeah

borkdude 2022-04-15T19:23:58.666979Z

I will re-run from failure

borkdude 2022-04-15T19:24:04.153849Z

when the others are done

borkdude 2022-04-15T19:24:20.140019Z

it happens especially when you want to release

lispyclouds 2022-04-15T19:24:28.042289Z

😕

lispyclouds 2022-04-15T19:24:57.943429Z

i guess we need to update to the cimg circleci images sometime, that deprecation warning we are getting

borkdude 2022-04-15T19:25:07.921029Z

yeah as well

lispyclouds 2022-04-15T19:25:47.509899Z

well the docker should go through with the failure

borkdude 2022-04-15T19:26:14.522429Z

yeah

borkdude 2022-04-15T19:28:12.964889Z

why does it take 2 minutes to push binaries we already have to docker hub again?

borkdude 2022-04-15T19:29:10.170599Z

docker job successful, can you check docker hub?

lispyclouds 2022-04-15T19:29:18.877459Z

hub looks good

lispyclouds 2022-04-15T19:29:33.196299Z

all the arches look okay

borkdude 2022-04-15T19:30:03.672959Z

🎉

lispyclouds 2022-04-15T19:30:39.556389Z

> why does it take 2 minutes to push binaries we already have to docker hub again? its building it all over again, so i guess different hashes

borkdude 2022-04-15T19:32:00.584359Z

Some golang leaking through in the test output :P

Ran 197 tests containing 580 assertions.
0 failures, 0 errors.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x4f7946

borkdude 2022-04-15T19:32:13.684129Z

I guess we don't shut down the pod very nicely

lispyclouds 2022-04-15T19:32:27.687619Z

interesting

borkdude 2022-04-15T19:32:56.604489Z

maybe in the pods library there is a missing shutdown hook or so

lispyclouds 2022-04-15T19:32:56.771989Z

we dont have a handler for the exit is it?

borkdude 2022-04-15T19:33:03.704639Z

don't know

borkdude 2022-04-15T19:33:32.850299Z

this only happens on the jvm side so it might be in the jvm side of the pods lib

lispyclouds 2022-04-15T19:34:22.790829Z

right will check the go ones we have, if we all have a shutdown handler there too

borkdude 2022-04-15T19:34:55.856779Z

in sqlite's pod we might want to implement the shutdown op

lispyclouds 2022-04-15T19:35:02.103309Z

right

borkdude 2022-04-15T19:35:07.263059Z

if we don't have that

lispyclouds 2022-04-15T19:36:58.438699Z

yeah looks like its the sqlite one

lispyclouds 2022-04-15T19:37:31.620919Z

but then bb just sends a kill to the pod right? not sure why theres a segfault

borkdude 2022-04-15T19:39:18.694119Z

for some reason the linux static binary wasn't uploaded.

lispyclouds 2022-04-15T19:39:27.551979Z

awesome 🙏🏼

borkdude 2022-04-15T19:39:47.935729Z

awesome?

lispyclouds 2022-04-15T19:39:54.070239Z

ah missed it

borkdude 2022-04-15T19:39:57.745159Z

Uploading /tmp/release to release
Uploading /tmp/release/babashka-0.8.1-linux-amd64-static.tar.gz (23 MB): DONE
Uploading /tmp/release/linux-amd64-static-metabom.jar (35 kB): DONE

borkdude 2022-04-15T19:40:04.648609Z

in the logs it said it did

borkdude 2022-04-15T19:40:15.726589Z

I'll do that manually. what a fucking joke this automation is ;)

lispyclouds 2022-04-15T19:40:35.533879Z

well this part of the script im yet to explore

lispyclouds 2022-04-15T19:40:41.592339Z

which one is it again?

lispyclouds 2022-04-15T19:43:04.049459Z

well the tar was there and says its done, then what did it miss?

lispyclouds 2022-04-15T19:43:12.862859Z

some github api gaff?

borkdude 2022-04-15T19:43:51.448159Z

yeah think so

borkdude 2022-04-15T19:43:58.847149Z

same weirdness in the jvm step

borkdude 2022-04-15T19:44:08.652149Z

similar API call

borkdude 2022-04-15T19:44:19.675229Z

anyway, 0.8.1 is now released, we can call it a day ;)

lispyclouds 2022-04-15T19:44:30.437599Z

finally. happy easter 😛

borkdude 2022-04-15T19:44:43.761999Z

you too :)

lispyclouds 2022-04-15T19:50:21.261659Z

i guess adding :throw true to the calls here https://github.com/borkdude/gh-release-artifact/blob/main/src/borkdude/gh_release_artifact.clj#L177 could help a bit maybe?

lispyclouds 2022-04-15T19:50:49.115129Z

im guess one or more of them had some 400+ status

borkdude 2022-04-15T20:10:05.944209Z

yeah maybe