clj -Scp does not prevent classpath calculation

Description

clj -Scp is an option to provide an explicit classpath and override the classpath calculation. Right now, if the staleness checks fail, the classpath and other files will still be computed and cached in the .cpcache dir, but that shouldn't happen.

Need to fix the flag checks in the clojure script to avoid cp calculation if -Scp is set.

Environment

None

Activity

Show:
Hlöðver Sigurðsson
February 11, 2020, 11:24 PM

here’s a patch (TDEPS-150.patch) that worked for me on nixpkgs where any calls to maven were unwanted. By checking for emptieness (-z) of the -Scp data ($force_cp), it will skip the clojure.tools.deps.alpha.script.make-classpath2 section and make no attempts to make network requests to Maven.

Alex Miller
February 12, 2020, 5:41 PM

I did some more looking at this and the script is not the right place to fix this. Cutting off the tools call prevents correct operation of jvm and main opts as they get set up during the tools operation. So, have not applied the patch here.

However, fixed the actual fix in make-classpath2, which was a regression during some refactoring, and added a test. Will be in next build of tools.deps.

Alex Miller
February 14, 2020, 8:41 PM

Released in tools.deps.alpha 0.8.677

Fixed

Assignee

Hlöðver Sigurðsson

Reporter

Alex Miller

Labels

None

Approval

None

Patch

None

Priority

Major
Configure