jlesquembre / clj-nix

Nix helpers for Clojure projects
https://jlesquembre.github.io/clj-nix/
Eclipse Public License 2.0
139 stars 20 forks source link

Artifact downloads limited by max-jobs #73

Open bendlas opened 1 year ago

bendlas commented 1 year ago

When the jar and pom files for a classpath are not in /nix/store, the resulting downloads are treated as regular builds and can be very slow if max-jobs is low.

This is essentially the same problem https://github.com/nix-community/yarn2nix/issues/9#issuecomment-437074958

Possible workarounds

jlesquembre commented 1 year ago

A command that pre-builds just the classpath and adds --option max-jobs 256

That's for sure an option. Is your use case to speed up CI builds?

If not on CI, there is an option to add the dependencies to the nix store when you generate the lock file, search for CLJNIX_ADD_NIX_STORE in the README:

CLJNIX_ADD_NIX_STORE=true nix run github:jlesquembre/clj-nix#deps-lock

Probably I should add a flag to the CLI to do that.

bendlas commented 1 year ago

That's for sure an option. Is your use case to speed up CI builds?

Yes, also

Probably I should add a flag to the CLI to do that.

Interesting, a flag to just transfer to nix store - without updating any versions - would also solve these cases, right?

jlesquembre commented 1 year ago

@bendlas to clarify it, a new CLI command, like

add-clj-deps deps-lock.json

which adds all the dependencies to the nix store, solves your use case, right?

bendlas commented 1 year ago

Yes, a cli command like preload-deps to fast-track all the dependency downloads would solve my use cases neatly.