tools-build

emccue 2025-08-18T12:45:22.020959Z

Very in the weeds question but: why basis over something like runtime-configuration ?

Alex Miller (Clojure team) 2025-08-18T12:50:27.386229Z

you mean, as a word?

emccue 2025-08-18T12:51:05.125209Z

yeah

Alex Miller (Clojure team) 2025-08-18T12:51:38.011199Z

well it's a lot shorter :)

emccue 2025-08-18T12:52:35.629179Z

(Just got the image in my head of a clojure team meeting, but everyone is walking in dressed like a priest. Just instead of a bible its Marriam-webster)

emccue 2025-08-18T12:52:39.164959Z

Alex Miller (Clojure team) 2025-08-18T12:52:42.436529Z

seemed like a better semantic match and without most of the associations people will add to "config" etc

Alex Miller (Clojure team) 2025-08-18T12:52:51.603269Z

you're not wrong

emccue 2025-08-18T12:53:11.597879Z

i'll make a joke about this later i'm sure

emccue 2025-08-18T12:53:43.492399Z

so then from there - why basis over runtime-basis, does basis imply in context what it is for?

emccue 2025-08-18T12:54:12.879809Z

and what are some of the associations that exist for "config" that aren't applicable

Alex Miller (Clojure team) 2025-08-18T12:56:12.017869Z

what does "runtime" add over basis?

Alex Miller (Clojure team) 2025-08-18T12:56:35.710639Z

basis is a starting point, a context

Alex Miller (Clojure team) 2025-08-18T12:57:24.768679Z

it's really not about configuration (what I set) as much as the resulting resolved libraries and classpath, which forms the context for runtime execution

emccue 2025-08-18T12:58:05.469089Z

so the primary focus is the resolved libraries and classpath, not so much the jvm flags

emccue 2025-08-18T12:58:14.536649Z

even though they do get wrapped into the same thing

Alex Miller (Clojure team) 2025-08-18T12:58:58.656259Z

the focus is on the libraries and classpath

emccue 2025-08-18T12:59:20.112639Z

I think "runtime" might contextualize it as being "a basis for the launching of the jvm runtime"

emccue 2025-08-18T12:59:42.279209Z

but i guess the distinction only matters in the presence of basis-es for launching other kinds of processes

Alex Miller (Clojure team) 2025-08-18T12:59:59.033029Z

https://clojure.org/reference/deps_edn#basis says "The runtime basis is a representation of the dependency environment when the Clojure runtime starts. It includes information about the dependencies, classpath, and how the basis was created."

emccue 2025-08-18T13:00:06.265409Z

and runtime-basis assumes the jvm part already

emccue 2025-08-18T13:00:18.170769Z

so its an uncomfortable middle ground

Alex Miller (Clojure team) 2025-08-18T13:00:36.573629Z

as someone that has to type it all the time, I'm happy to shorten it to "basis" :)

lread 2025-08-18T13:15:55.283209Z

What’s your basis for choosing basis? It’s succinct and only one word.

emccue 2025-08-18T13:28:51.147079Z

im choosing my own words for some of this stuff in one of my doodle projects, so im thinking about it a bit too hard

emccue 2025-08-18T13:07:05.135179Z

Is there a way i am missing to provide a custom prep step for a dependency? I want to take a thing.jmod file, extract its contents somewhere, and put the native code on the -Dsystem.library.path. So step 1 of that is "extract the contents somewhere," but from what i can tell prep steps are declared in the dependency itself.

seancorfield 2025-08-18T14:51:18.872969Z

I haven't verified it but based on a casual scan of the code, I think you can pass additional exec args on the command-line when you prep and they'll be passed into the prep fn in each dependency -- so if you control the dependency, you can make the prep fn accept a specific path? Does that help?

seancorfield 2025-08-18T14:52:35.790789Z

You can have a prep step in your own project too, BTW, although I'm not sure whether it would run before or after any given dependency (and then specify prep :current true, with :force true if you wanted to re-run it).

Alex Miller (Clojure team) 2025-08-18T15:46:01.043779Z

I don’t think you are going to be able to do what you’re asking for

Alex Miller (Clojure team) 2025-08-18T15:47:58.180289Z

Or at least not in one step - prep is about preparing the on-disk project files (primarily for compiling new things on to the classpath). You should be able to prep and expand the jmod file into your project somewhere, but prepping doesn’t affect the actual command being run

emccue 2025-08-18T15:49:14.129789Z

So basically prep is a way to turn --class-path <original artifact> to --class-path <processed artifact> , you can't turn <original artifact> into --class-path <processed artifact A> -Dsystem.library.path <processed artifact B>

seancorfield 2025-08-18T15:53:53.842059Z

I was wrong about passing options/arguments into the prep fn, it seems. That's kind of both understandable from a security p.o.v. but also disappointing 🙂

Alex Miller (Clojure team) 2025-08-18T15:55:57.212329Z

yeah, that's just not sensible - prepping happens potentially across many libs so passing args to all of them wouldn't make sense

Alex Miller (Clojure team) 2025-08-18T15:56:50.062019Z

and correct, you are not affecting the system properties, just the effective classpath

emccue 2025-08-18T15:58:17.171459Z

(I am being a good boy and not making this about the --module-path)

Alex Miller (Clojure team) 2025-08-18T15:58:18.886759Z

native stuff is kind of a special case - Maven (and lein) do automatic oss/arch selection via classifier, extraction, and inclusion on library path. this is an area that clj hasn't tackled yet

Alex Miller (Clojure team) 2025-08-18T15:58:53.658729Z

oh, is jmod modules not native?

emccue 2025-08-18T15:59:18.851769Z

what do you mean by native?

Alex Miller (Clojure team) 2025-08-18T15:59:31.894339Z

native libs

emccue 2025-08-18T16:00:25.538949Z

jmod modules are a directory structure like

classes/
  <class files + module-info.class>
legal/
  <a bunch of legal docs>
lib/
  <native libs>
bin/
  <launchers>
...

emccue 2025-08-18T16:01:03.154399Z

so they are meant to be used "at link time" to build out a JDK, but you could also just explode them and put classes on the --module-path and lib on the -Dsystem.library.path

Alex Miller (Clojure team) 2025-08-18T16:01:13.688009Z

I haven't dug into these, certainly clj/deps are not handling them

emccue 2025-08-18T16:02:42.551159Z

i think they are interesting in part because 1. They actually handle native code unlike jars which require ad-hoc extract at runtime strategies 2. add sources and docs and its basically "the library" as an artifact 3. They are planning on (based on my read of the leyden mailing list) adding a static-libs section which would let you jlink everything to a single exe without the closed world assumption of native image

emccue 2025-08-18T16:06:34.898139Z

i guess also 4. - from my time digging at jaxb recently it is annoying that xjc, that schema compiler, comes in a bin folder in some random zip file. It is strange that for a certain kind of dependency (things you put on the class path) you can use automatic resolution, but for others we use different mechanics

emccue 2025-08-18T16:06:40.956559Z

it just itches my brain constantly

emccue 2025-08-18T16:07:31.398279Z

--os-arch "x86_x64" --os-name "Mac OS X"
  --os-version "10.10.5" greetingsmod
They also have explicit OS metadata on them, unlike maven classifiers which just do something random

Alex Miller (Clojure team) 2025-08-18T16:13:49.232309Z

maven selectors have explicit tags for os and arch so I wouldn't say that's "random", but I don't have a good feel for how arbitrary it is

Alex Miller (Clojure team) 2025-08-18T16:15:05.419939Z

if you look at https://maven.apache.org/pom.html under Activation - this stuff is used to select a variant via classifier

emccue 2025-08-18T16:15:08.840139Z

you do the section based on those things, but which classifier to pick is undefined. You don't just say "I want library group/artifact/version" and it picks the one for your OS, you say "when os=.. and arch=.., I want group/artifact/version/classifier"

Alex Miller (Clojure team) 2025-08-18T16:16:32.916609Z

I guess that activation just ties you into profiles so there is indirection there

emccue 2025-08-18T16:16:38.234729Z

apologies for huge file, but this is how you get LWJGL in a pom if you want to support everything

emccue 2025-08-18T16:16:46.979919Z

Alex Miller (Clojure team) 2025-08-18T16:17:40.460609Z

hard to get away from huge files when you talk in pom ;)

emccue 2025-08-18T16:17:53.729819Z

so for this library the mac version has the classifier natives-macos and natives-macos-arm64

Alex Miller (Clojure team) 2025-08-18T16:18:09.112779Z

right

emccue 2025-08-18T16:18:31.932169Z

for a different library the classifiers will be different: you can't just interrogate the package repo and ask "is there a universal package, if not is there one specific for my platform"

✔️ 1
emccue 2025-08-18T16:25:55.551539Z

(while i got the rant ready) Another thing that is random is the artifact name. The uniqueness key for a maven library is the combination of Group + Artifact. So org.jetbrains/annotations is just different than com.example/annotations. Which makes it a bit of a headache when a different group decides to publish the same artifact and really you'd want to say "okay I see you get some-component both from org.jetbrains and com.example. You need to pick which one you want"

emccue 2025-08-18T16:26:36.010899Z

if you play the "rewind time, assume modules always existed" game - if artifact id == module id then you could actually do that

emccue 2025-08-18T16:27:28.251729Z

so org.jetbrains/org.jetbrains.annotations and com.example/org.jetbrains.annotations

emccue 2025-08-18T16:28:12.201289Z

just a different evolutionary path

emccue 2025-08-18T16:31:05.118859Z

AOT'd clojure code would take issue with being on the module path but we don't really distribute AOT things as libraries. Publishing a clojure library would require some new metadata but whatever

Alex Miller (Clojure team) 2025-08-18T16:49:26.360329Z

I think modules are probably the worst thing ever added late to Java (but would feel differently if they had existed from the beginning). serialization is probably the worst thing added early :)

emccue 2025-08-18T16:50:35.462569Z

I think <something> is going to happen with them

emccue 2025-08-18T16:51:47.035329Z

go on reddit and look for the posts from ron pressler (/u/pron98)

Alex Miller (Clojure team) 2025-08-18T16:52:26.319589Z

sounds excitingly terrible

emccue 2025-08-18T16:52:28.249959Z

I have a few ideas on what "Both of these aspects will soon change." might mean, but it sure does read like a threat