tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
Saikyun 2020-09-18T08:53:25.002Z

is there a way to get clj working on a machine without access to internet? specifically I'd want clj + project dependencies on a machine behind a very restrictive firewall. I'm able to transfer files to it, and when building I use uperdeps.

Saikyun 2020-09-18T08:53:53.002700Z

I know that with leiningen I could download a jar-file and a bat-file, then it didn't need access to internet. is it possible to do something like that with clj?

dominicm 2020-09-18T09:06:08.004300Z

@saikyun the installer just downloads a couple jar files and puts them on the filesystem, then puts a script in /bin/ to run that jar.

dominicm 2020-09-18T09:07:01.004800Z

The void linux install script is the simplest version I know of, but others might have good examples too πŸ™‚ https://github.com/SevereOverfl0w/void-packages/blob/master/srcpkgs/clojure/template#L15-L23

dominicm 2020-09-18T09:07:21.005300Z

One idea might be to run the installer into a directory with the -p flag.

Saikyun 2020-09-18T09:07:22.005400Z

the target computer is on windows btw :x

borkdude 2020-09-18T09:18:44.006800Z

@saikyun Alternative if you end up running into issues: with deps.clj it's just a matter of downloading the executable and placing the tools jar in ~/.deps.clj (as documented here: https://github.com/borkdude/deps.clj/issues/20)

Saikyun 2020-09-18T09:24:07.007700Z

@borkdude thanks, something like that is what I wanted πŸ™‚ what is the analogue to ~ on windows?

borkdude 2020-09-18T09:24:27.007900Z

%USERPROFILE%

Saikyun 2020-09-18T09:24:30.008100Z

thanks

borkdude 2020-09-18T09:33:47.008900Z

@saikyun Here is one user working around firewalls copying his .m2 deps with bb: https://twitter.com/MrGung1/status/1305906562746253315

Saikyun 2020-09-18T09:34:31.009700Z

cool, thanks

Saikyun 2020-09-18T09:35:04.010200Z

where do you get deps.exe from?

borkdude 2020-09-18T09:35:09.010500Z

Github releases: https://github.com/borkdude/deps.clj/releases

borkdude 2020-09-18T09:36:28.011100Z

or install via scoop etc, but since you're having firewall issues, Github releases is probably the easiest

Saikyun 2020-09-18T09:37:08.011400Z

yeah, thanks a lot.

Saikyun 2020-09-18T09:37:39.011900Z

and it's enough for deps.exe to be on PATH, right?

borkdude 2020-09-18T09:38:09.012100Z

yes

borkdude 2020-09-18T09:38:26.012300Z

also works from cmd.exe, no PS needed

Saikyun 2020-09-18T09:38:39.012600Z

okay, cool πŸ™‚

Saikyun 2020-09-18T09:38:48.013Z

I'm getting this error now:

Error building classpath. Failed to read artifact descriptor for org.clojure:clojure:jar:1.10.1
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:ja
r:1.10.1

Saikyun 2020-09-18T09:39:03.013400Z

this is what prompted me to try to install tools.deps in an alternative way in the first place

Saikyun 2020-09-18T09:39:27.014Z

I wonder if there's some old stuff lying around, trying to find tools.deps in the directory specified when I ran the .ps1 installation script...

borkdude 2020-09-18T09:39:49.014400Z

probably there's something wrong with your .m2 stuffs?

Saikyun 2020-09-18T09:40:22.015100Z

oh, right, I guess I need to put clojure in the .m2 folder? (e.g. by using -p...?)

borkdude 2020-09-18T09:41:17.015900Z

tools.deps is going to the internets when the dep is not yet in .m2

Saikyun 2020-09-18T09:41:27.016100Z

okay, that makes sense

Saikyun 2020-09-18T09:45:20.016300Z

thanks for the example πŸ™‚

Saikyun 2020-09-18T10:14:32.017100Z

when running clj -P , where do the dependencies end up? I'm looking in ~/.m2 but can't find clojure :S

Saikyun 2020-09-18T10:14:44.017400Z

I have clojure as an explicit dependency in deps.edn as well

Saikyun 2020-09-18T10:15:37.017900Z

nvm, it was in .m2/org/clojure.. , not .m2/clojure...

Saikyun 2020-09-18T12:01:40.018700Z

got it all working by removing my local, existing .m2, then ran clj -P, then I copied my new local .m2 to the firewalled machine and now it works πŸ™‚

Saikyun 2020-09-18T12:01:44.018900Z

thanks a lot for the help

borkdude 2020-09-18T12:21:10.019200Z

I think the .m2/repository is also configurable in deps.edn (can't remember it from the top of my head)

Saikyun 2020-09-22T06:57:26.036100Z

ahh, thanks for the tip! great to know πŸ™‚

Saikyun 2020-09-22T06:57:46.036300Z

I’m setting up a dev environment on a pretty locked down production machine, so these things are invaluable

borkdude 2020-09-22T07:00:27.037400Z

One issue I had while developing on a train is that I forgot to download deps for certain aliases

Saikyun 2020-09-22T07:01:33.037600Z

ah, good point. will keep that in mind

alexmiller 2020-09-18T12:40:33.020900Z

Yes, with :mvn/local-repo

πŸ‘ 1
borkdude 2020-09-18T12:47:39.021300Z

which probably also works with -Sdeps? then that could be used for populating an ad hoc repo @saikyun

alexmiller 2020-09-18T12:49:01.021600Z

Yep

alexmiller 2020-09-18T14:10:38.021800Z

I use this for testing "clean cache" cases all the time

alexmiller 2020-09-18T14:10:55.022Z

(without having to muck with my actual ~/.m2/repository)

just.sultanov 2020-09-18T19:09:43.022500Z

Hi all! Does clojure take MAVEN_OPTS from environment variables? I can’t use keystore with clojure, but it’s work with mvn (directly)

seancorfield 2020-09-18T19:14:26.023400Z

@just.sultanov I just grepped the source of brew-install, homebrew-tools, and tools.deps.alpha and didn't see that var in any files so I would say "no".

seancorfield 2020-09-18T19:15:51.024100Z

It does handle ~/.m2/settings.xml for Maven stuff tho' so maybe you could put credentials in there?

just.sultanov 2020-09-18T19:24:03.024800Z

I need to use keystore.jks with self-signed corp certificates. I don’t have problems with credentials. Maven by default pick up settings from .mavenrc and MAVEN_OPTS, but I didn’t see any usages in sources of tools.deps

alexmiller 2020-09-18T19:44:31.025Z

doesn't use it right now

alexmiller 2020-09-18T19:45:50.025400Z

you can log the request at https://ask.clojure.org