tools.tools install-latest throws sha error with :coord and never upgrades with :tool

Description

Per https://ask.clojure.org/index.php/13882/tools-tools-install-latest-throws-error-coord-never-upgrades

Thanks for https://clojure.atlassian.net/browse/TDEPS-253 , however I noticed it doesn't quite work as expected for a fresh install (with :coord); I get an error due to a missing sha, contrary to the doc string "git coords may omit sha".

clj -Ttools install-latest \ :lib org/tool-name \ :coord '{:git/url "git@gitlab.int.org.com:group/subgroup/tool-name.git"}' \ :as tool-name => Execution error (ExceptionInfo) at clojure.tools.deps.extensions.git/eval1656$fn (git.clj:79). Library org/tool-name has coord with missing sha

I also found upgrading a tool with saved coordinates (clj -Ttools install-latest :tool tool-name) always results in "Skipping, newest installed" (because passing the coord returned by parse-install-latest-args to install-1 means ext/find-all-versions is never evaluated). Looks like this issue would affect tools with auto resolved git urls too.

 

Cause: 

If tools.tools.api/install-1 is a provided coord that coord is used as is without finding the latest release. If this coord did not contain a sha, which was encouraged by the install-latest docstring, it would return the "coord with missing sha" error message.

Approach:

If a coord is provided to install-1 it is used in the call to find-all-versions to filter out the latest release. 

Patch:

tdeps-265-tools.tools-1.patch contains the update to install-1 and a small test suite run by a GitHub actions.

Environment

None

Attachments

1
  • 20 Nov 2024, 06:41 PM

Activity

Show:

Alex Miller November 21, 2024 at 10:14 PM

Released in Clojure CLI 1.12.0.1488

Fixed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Created June 5, 2024 at 7:35 PM
Updated November 21, 2024 at 10:14 PM
Resolved November 21, 2024 at 10:14 PM