Fork me on GitHub
#tools-deps
<
2020-09-18
>
Saikyun08:09:25

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.

Saikyun08:09:53

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?

dominicm09:09:08

@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.

dominicm09:09:01

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

Saikyun09:09:20

thanks for the example 🙂

dominicm09:09:21

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

Saikyun09:09:22

the target computer is on windows btw :x

borkdude09:09:44

@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)

Saikyun09:09:07

@borkdude thanks, something like that is what I wanted 🙂 what is the analogue to ~ on windows?

borkdude09:09:27

%USERPROFILE%

borkdude09:09:47

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

Saikyun09:09:31

cool, thanks

Saikyun09:09:04

where do you get deps.exe from?

borkdude09:09:28

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

Saikyun09:09:08

yeah, thanks a lot.

Saikyun09:09:39

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

borkdude09:09:26

also works from cmd.exe, no PS needed

Saikyun09:09:39

okay, cool 🙂

Saikyun09:09:48

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

Saikyun09:09:03

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

Saikyun09:09:27

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...

borkdude09:09:49

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

Saikyun09:09:22

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

borkdude09:09:17

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

Saikyun09:09:27

okay, that makes sense

Saikyun10:09:32

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

Saikyun10:09:44

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

Saikyun10:09:37

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

Saikyun12:09:40

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 🙂

Saikyun12:09:44

thanks a lot for the help

borkdude12:09:10

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

Alex Miller (Clojure team)12:09:33

Yes, with :mvn/local-repo

👍 3
borkdude12:09:39

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

Alex Miller (Clojure team)14:09:38

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

Alex Miller (Clojure team)14:09:55

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

Saikyun06:09:26

ahh, thanks for the tip! great to know 🙂

Saikyun06:09:46

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

borkdude07:09:27

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

Saikyun07:09:33

ah, good point. will keep that in mind

just.sultanov19:09:43

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

seancorfield19:09:26

@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".

seancorfield19:09:51

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

just.sultanov19:09:03

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

Alex Miller (Clojure team)19:09:31

doesn't use it right now