Open thenonameguy opened 1 year ago
hi, if I understood it, in theory you should be able to do that (use any aliases in a custom buildCommand
)
But there are some corner cases with maven I wasn't able to solve yet. Specifically, if one of your dependencies uses version ranges, sometime maven hits the network. What is the dependency giving you problems?
I remember in clojure-lsp, maven insisted on downloading a dependency even if it was excluded:
The solution was hacky, I added a file to the maven cache, so maven thought that the dependency was there: https://github.com/jlesquembre/clojure-lsp/blob/58947e43f51641b571682918a63e4e1e6b54bc4a/flake.nix#L36-L49
Can you share the problematic dependency to check if it's the same issue? I'd like to have a proper solution for this case, but unfortunately I didn't have too much time to work onclj-nix
lately.
One last question, are you sure that https://github.com/bevuta/clojure-nix-locker will work on your case? My understanding is that clojure-nix-locker
should face the same issue. If not, I'll take a look again to see how they fixed it.
This might be possible today, but I have yet to figure it out how it would be doable: I want to build 2 uberjars from my application code.
deps.edn
with no aliaes whatsoever.:test
and:dev
aliases from scratch.Use-case 1. works perfectly. For 2. I tried defining a custom
buildCommand
with abuild.clj
that callscreate-basis
with the necessary aliases. This didn't work as it tried resolving the maven dependency ranges during sandboxed build-time (network calls). https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/extensions/maven.clj#L79-L80From a preliminary look https://github.com/bevuta/clojure-nix-locker seems to be able to solve this problem using it's design, but I much prefer clj-nix conceptually and don't want to switch away for this reason. Is this a solveable problem using the current lock-file layout?