babashka-sci-dev

cap10morgan 2022-03-21T17:27:00.369189Z

trying to write some tests for all this but getting an error from the resolver code that it can't find a pod for Mac / aarch64. what makes that fallback on x86_64 usually?

borkdude 2022-03-21T17:27:30.586389Z

@cap10morgan are you testing on m1?

cap10morgan 2022-03-21T17:27:35.558479Z

yeah

borkdude 2022-03-21T17:27:50.817969Z

from a JVM, not from bb right?

cap10morgan 2022-03-21T17:27:58.167269Z

oh, is it b/c the bb executable itself is x86_64 usually?

borkdude 2022-03-21T17:28:02.520509Z

yes

cap10morgan 2022-03-21T17:28:05.454519Z

makes sense

cap10morgan 2022-03-21T17:28:16.227029Z

I'll just run it under rosetta for now then

borkdude 2022-03-21T17:28:16.526849Z

maybe you can fake this by setting the system property yourself?

borkdude 2022-03-21T17:28:21.998239Z

yeah that's a safer bet

👍 1
borkdude 2022-03-21T17:29:06.943129Z

it does work for the org.babashka/go-sqlite3 pod btw, this was released today for mac m1 ;)

borkdude 2022-03-21T17:29:26.176359Z

eh no scratch that, it was linux aarch64

borkdude 2022-03-21T17:29:31.041279Z

never mind

cap10morgan 2022-03-21T17:29:52.119019Z

ohhh... you had me thinking you were using some early graal mac/arm64 stuff 🙂

borkdude 2022-03-21T17:30:14.866879Z

Still have to try this out: https://github.com/babashka/babashka/wiki/Compiling-for-M1

cap10morgan 2022-03-21T17:30:51.837739Z

oh nice. getting close!

cap10morgan 2022-03-21T18:04:21.909979Z

@borkdude Should we support an optional :args param for local pods?

borkdude 2022-03-21T18:44:39.083179Z

What's the use case for that?

cap10morgan 2022-03-21T18:47:28.365159Z

well, I noticed it when trying to load the test pod.clj file, which needs the --run-as-pod arg to go into "pod mode" and thought there might other times you'd want to pass args to pods. the existing load-pod approach supports that by passing a vector, but currently the declarative approach doesn't have a way to pass anything but the path to the pod executable

borkdude 2022-03-21T19:04:58.501479Z

usually that shouldn't be necessary, there is BABASHKA_POD=true which is set when a binary runs as a pod

borkdude 2022-03-21T19:05:18.441739Z

so normal CLIs can check that env var to see if they are invoked as a pod

borkdude 2022-03-21T19:05:51.670109Z

but we could support it, I don't see harm in that

borkdude 2022-03-21T19:08:12.449149Z

maybe that test can use that convention too

borkdude 2022-03-21T19:08:29.577359Z

the env var wasn't there yet, when that test got written

cap10morgan 2022-03-21T19:14:22.804219Z

gotcha

cap10morgan 2022-03-21T19:28:41.553929Z

OK I pushed a couple tests

cap10morgan 2022-03-21T19:28:50.589969Z

and marked the main PR ready for review

borkdude 2022-03-21T19:29:27.832799Z

we first need the pods PR merged right?

cap10morgan 2022-03-21T19:32:20.060509Z

yep

cap10morgan 2022-03-21T19:32:51.914499Z

oh, and I need to test uberjars too

borkdude 2022-03-21T19:33:56.653169Z

also uberscripts :)

borkdude 2022-03-21T19:34:22.975259Z

for uberscripts we probably want to so something special, but I can fix that post-merge as well

cap10morgan 2022-03-21T19:34:51.640389Z

looks like a bb executable isn't in PATH in CI

borkdude 2022-03-21T19:36:07.744669Z

correct, we don't use bb to do CI stuff for bb

borkdude 2022-03-21T19:36:30.976319Z

but we could use the bb uberjar or freshly built bb binary maybe

cap10morgan 2022-03-21T19:36:53.729259Z

that's how I made it able to run test-resources/pod.clj as a pod w/ just the path

cap10morgan 2022-03-21T19:37:11.931259Z

gave it a shebang of #!/usr/bin/env bb

borkdude 2022-03-21T19:38:48.502929Z

do you have a question?

borkdude 2022-03-21T19:38:54.364099Z

or is this just info

cap10morgan 2022-03-21T19:39:36.113719Z

just info. letting you know why it's suddenly looking for a bb in the path

👍 1
borkdude 2022-03-21T19:45:38.206069Z

so we are good with the pods PR but the bb side still needs work, right?

cap10morgan 2022-03-21T19:45:47.607569Z

I think so, yeah

borkdude 2022-03-21T19:50:19.080659Z

I updated the pods repo in branch declarative-pods and made your PR to merge to that branch

👍 1
borkdude 2022-03-21T19:51:49.164429Z

I'm not sure why I'm still seeing a diff in the pods submodule though

borkdude 2022-03-21T19:51:58.983129Z

since that should now be equal

borkdude 2022-03-21T19:52:23.557539Z

or maybe you can sort that out on your end

cap10morgan 2022-03-21T19:52:42.382279Z

probably just merge commit vs. former branch head commit

cap10morgan 2022-03-21T19:52:47.344599Z

I'll see if that resolves it

borkdude 2022-03-21T19:52:56.175159Z

ah yes

borkdude 2022-03-21T20:34:30.322449Z

still seeing a change in the pods submodule. perhaps you can merge with master

borkdude 2022-03-21T20:35:15.768719Z

but other than that, it looks good

borkdude 2022-03-21T20:37:04.584139Z

I'm ok with doing the uberjar and uberscript support as separate PRs

borkdude 2022-03-21T20:39:10.992279Z

eh I mean, merge with the declarative-pods branch

borkdude 2022-03-21T20:39:21.044869Z

oh and there's a failing test

cap10morgan 2022-03-21T21:08:02.747839Z

uberjar seems to work

cap10morgan 2022-03-21T21:08:12.364399Z

both registry and local

cap10morgan 2022-03-21T21:09:30.577279Z

merging w/ declarative-pods got rid of the pods submodule diff

cap10morgan 2022-03-21T21:10:52.972799Z

oh but uberjar only works if it's still in the project root ðŸĪŠ

cap10morgan 2022-03-21T21:15:09.371849Z

failing test is still the missing bb binary in CI. need to decide what we want to do there.

borkdude 2022-03-21T21:39:48.092859Z

can't you just call "./bb script.clj" ?

cap10morgan 2022-03-21T21:40:53.374699Z

not sure. it's not really a "path", so kind of abuses that attribute even if it does work

cap10morgan 2022-03-21T21:41:22.189639Z

right now the local pods path assumes you're pointing it at something the system can execute as a process directly

borkdude 2022-03-21T21:41:54.751819Z

I guess you can create a temporary bash/.bat wrapper

borkdude 2022-03-21T21:41:59.956859Z

and make that executable