Add main opts to -Sdescribe output. This could simply be a new :main-opts key along with a string value representing the content of the main opts cache file, if one exists, or an empty string otherwise.
Rationale
Downstream execution environments can make use of the main opt information when using clojure for dependency download, classpath construction, and main opt selection via aliases. Another way to look at this is that, in the same way that -Spath provides useful information when composing clojure with other executable environments that can consume classpaths, access to the main opts is also similarly useful when composing. This need probably isn't sufficiently strong to warrant polluting the options list with a new -Smain-opts flag; putting this into -Sdescribe output is likely sufficient.
A secondary rationale might be that this could be useful to humans for debugging purposes.
Implementation Considerations
This could be as simple as a single new line in the script, perhaps placed after the line that emits :main-aliases in the -Sdescribe output.
:main-opts "$(cat "$main_file")"
This would work for most normal use cases, but could perhaps be dependent upon what happens with TDEPS-56, where there might end up being some platform-specific changes made to properly handle the case when a main opt has a space embedded in it. (Perhaps in light of this, clojure could take the stance that :main-opts isn't guaranteed to be final; this is consistent with things still being in alpha, and perhaps also consistent with -Sdescribe not really being formal API.)
Enhancement Description
Add main opts to
-Sdescribe
output. This could simply be a new:main-opts
key along with a string value representing the content of the main opts cache file, if one exists, or an empty string otherwise.Rationale
Downstream execution environments can make use of the main opt information when using
clojure
for dependency download, classpath construction, and main opt selection via aliases. Another way to look at this is that, in the same way that-Spath
provides useful information when composingclojure
with other executable environments that can consume classpaths, access to the main opts is also similarly useful when composing. This need probably isn't sufficiently strong to warrant polluting the options list with a new-Smain-opts
flag; putting this into-Sdescribe
output is likely sufficient.A secondary rationale might be that this could be useful to humans for debugging purposes.
Implementation Considerations
This could be as simple as a single new line in the script, perhaps placed after the line that emits
:main-aliases
in the-Sdescribe
output.:main-opts "$(cat "$main_file")"
This would work for most normal use cases, but could perhaps be dependent upon what happens with TDEPS-56, where there might end up being some platform-specific changes made to properly handle the case when a main opt has a space embedded in it. (Perhaps in light of this,
clojure
could take the stance that:main-opts
isn't guaranteed to be final; this is consistent with things still being in alpha, and perhaps also consistent with-Sdescribe
not really being formal API.)