Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :deps/prep-lib support for git dependencies #7

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Conversation

DerGuteMoritz
Copy link
Contributor

@DerGuteMoritz DerGuteMoritz commented Sep 13, 2022

Source dependencies may require a "prep" step e.g. to compile Java source[1]. This patch adds support for this but only for git dependencies since that's the only dependency type which implements this at the moment anyway[2]. This is achieved by extracing the necessary info from deps.edn to the lockfile. A second pass over the constructed Clojure home derived from the lockfile then picks out all the git libs which need prepping, runs the respective command for them and finally constructs a new home with the prepped libs.

1: See https://clojure.org/guides/deps_and_cli#prep_libs
2: Technically, :local/root dependencies also implement it but
clojure-nix-locker doesn't have to handle these.

default.nix Outdated Show resolved Hide resolved
utils.nix Show resolved Hide resolved
locker.py Show resolved Hide resolved
Copy link
Member

@whentze whentze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've commented an idea on your babashka/PATH question. Other than that, lgtm 👍🏼

I also verified that the example and one of our own projects still builds correctly with this.

locker.py Outdated Show resolved Hide resolved
default.nix Outdated Show resolved Hide resolved
default.nix Outdated Show resolved Hide resolved
@DerGuteMoritz DerGuteMoritz force-pushed the prep-support branch 2 times, most recently from dd29bc6 to c7a089a Compare September 13, 2022 13:29
Source dependencies may require a "prep" step e.g. to compile Java
source[1]. This patch adds support for this but only for git
dependencies since that's the only dependency type which implements
this at the moment anyway[2]. This is achieved by extracing the
necessary info from `deps.edn` to the lockfile. A second pass over the
constructed Clojure home derived from the lockfile then picks out all
the git libs which need prepping, runs the respective command for them
and finally constructs a new home with the prepped libs.

1: See https://clojure.org/guides/deps_and_cli#prep_libs
2: Technically, :local/root dependencies also implement it but
   `clojure-nix-locker` doesn't have to handle these.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants