cashapp/hermit

Force unpack to move the archive, rather than unpack it

cgruber opened this issue · 3 comments

In some cases, "unpack" is the wrong metaphor, as the package being downloaded, while a package, should not be expanded (such as a .jar file, which can be made into an executable). Allowing a configuration where is not expanded, but just moved as-is into a pkg directory, which can then be linked-to, would be very useful.

As a use-case, grabbing ktfmt from the maven-all-deps artifact, the expander blows up, trying to extract it. It should be able to be told to just move it into .../Caches/hermit/pkg/ktfmt-0.41/ktfmt-0.41-jar-with-dependencies.jar which can then be manipulated to make it an executable jar (prefix a shebang script) and then linked and chmoded.

Aha, interesting! Somehow, even though we have existing JVM tools like Gradle this is the first time this has come up, but it does seem like a good idea. To actually execute it we'd typically ship a wrapper script that gets installed into the Hermit env. This would be included in the hermit-packages repo alongside the package definition.

Is there any way to hijack the unpack event now, even if it's not a first-class solution?

I think Gradle worked because gradle ships a zip containing its scripts and things, not a single .jar that can be executed by itself.