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

Should eval/sh be called without CLASSPATH? #46

Open
quoll opened this issue Feb 22, 2021 · 1 comment
Open

Should eval/sh be called without CLASSPATH? #46

quoll opened this issue Feb 22, 2021 · 1 comment

Comments

@quoll
Copy link

quoll commented Feb 22, 2021

When setting up simple modules, they each report:

WARNING: You have $CLASSPATH set, probably by accident.
It is strongly recommended to unset this before proceeding.

This is from the Leiningen script which checks if this is set. It then sets the CLASSPATH before launching the JVM. When lein-modules builds sub-modules, it does so by executing the leiningen command script in a shell via leiningen.core.eval/sh. Leiningen picks up the current environment (unless overridden by a dynamic binding) which has the CLASSPATH set in it now, hence the warnings.

I think that adding a new binding before executing the shell should solve the issue, but I wanted to ask before making a PR:

Lines 194-197

(binding [eval/*dir* (:root project)
          eval/*env* (with-meta (dissoc (into {} (System/getenv)) "CLASSPATH") {:replace true})]
  (let [exit-code (apply eval/sh (cons cmd args))]
    (when (pos? exit-code)
      (throw (ex-info "Subprocess failed" {:exit-code exit-code}))))
@jcrossley3
Copy link
Owner

Sounds reasonable to me -- PR away!

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

No branches or pull requests

2 participants