Add option to symlink Clojure dependencies during build#165
Add option to symlink Clojure dependencies during build#165kenranunderscore wants to merge 1 commit intojlesquembre:mainfrom
Conversation
|
For a before/after you can check out what I changed in this example project: |
c33214a to
de27a59
Compare
|
Is that CI failure due to flakiness? I saw the same error in some other commits' runs. |
|
We could create a
Would that be something you'd consider? I might add an example implementation in my fork to use in my showcase project and check how it feels. |
Absolutely. I currently have very little time for clj-nix, which is why I haven't commented before. Thank you for your PR; this one is more involved than the others, so I want to think a bit about it before merging it |
|
Oh, and yes, there's some flakiness on CI |
|
@jlesquembre Thanks for the answer! I'll convert this one into a draft as I have a working local copy that creates
Before making this PR so we can talk about it I'd have another question: To be absolutely sure I don't destroy anything I'd love to upstream some integration tests for Leiningen projects, as Sorry for the wall of text 😅 And no need to hurry! |
I'm often finding myself building projects that use Clojure + ClojureScript (with
shadow-cljs), with an artifact uberjar that contains the Clojure backend and some compiled JavaScript code for the frontend. In order for the build commands to be identical for both local development and Nix builds, I'm usually building the frontend stuff in mybuild.clj. This involves usingnpmat some point during thebuildPhase.npmexpects$HOMEto point to a mutable location, butclj-nixsets$HOMEto the immutable location of the Clojure dependencies. This PR introduces an option to symlink the Clojure dependencies to thepwd(and settingHOMEto that) during thebuildPhaseinstead, making it possible to usemkCljBinto build such projects instead of having to reverse enginner it :)Note that I didn't touch the
leiningen-specific part of the build, as I don't have anything to test that with. I don't think it should interfere in any way, though, especially since the default did not change.