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

Checkouts projects without :cljsbuild causes warnings #413

Open
henriklundahl opened this issue Sep 7, 2015 · 8 comments
Open

Checkouts projects without :cljsbuild causes warnings #413

henriklundahl opened this issue Sep 7, 2015 · 8 comments

Comments

@henriklundahl
Copy link

When you have a ClojureScript project with a non-ClojureScript checkouts project these warnings:

WARNING: no :cljsbuild entry found in project definition.
--------------------------------------------------------------------------------
WARNING: your :cljsbuild configuration is in a deprecated format.  It has been
automatically converted it to the new format, which will be printed below.
It is recommended that you update your :cljsbuild configuration ASAP.
--------------------------------------------------------------------------------
:cljsbuild
{:builds []}
--------------------------------------------------------------------------------
See https://github.com/emezeske/lein-cljsbuild/blob/master/README.md
for details on the new format.
--------------------------------------------------------------------------------

Happens in lein-cljsbuild 1.1.0, but not 1.0.6.

@mneise
Copy link
Collaborator

mneise commented Sep 10, 2015

@henriklundahl Could you provide a minimal setup where this issue can be reproduced?

@henriklundahl
Copy link
Author

Yes, see https://github.com/henriklundahl/lein-cljsbuild-issue-413. This is the steps I took:

  1. lein new reagent cljs-project
  2. lein new clj-project
  3. cd clj-project
  4. lein install
  5. mkdir ../cljs-project/checkouts
  6. cd ../cljs-project/checkouts
  7. ln -s ../../clj-project
  8. Change version of lein-cljsbuild to 1.1.0 in cljs-project/project.clj.
  9. Add clj-project as a dependency in cljs-project/project.clj.
  10. cd ..
  11. lein cljsbuild once

I should point out that everything seems to work despite of these warnings, so I don't think this is especially important to fix.

Thanks!

@mneise mneise added the Bug label Oct 12, 2015
@darwin
Copy link

darwin commented Nov 6, 2015

The problem is that project.clj of some project in checkouts directory does not contain proper :cljsbuild configuration.

Thoughts:

  1. It would be nice if lein-cljsbuild could print also relevant notice that warnings/errors are related to a specific checkouts directory project not to the root project.clj. In this case it leads to a great confusion.
  2. In my case problematic library is
    https://github.com/suprematic/khroma/blob/10bb18f848be2cb25c53a6ea0b404b1b5ce9e5e7/project.clj. This library does not configure cljsbuild for some reason (I'm unaware how they produce jar for clojars), but it can be consumed from checkouts directory just fine. I just have to include path/to/checkouts/khroma/src into my :source-paths in my active cljsbuild profile in root project.clj.

@mneise
Copy link
Collaborator

mneise commented Nov 7, 2015

Regarding 1), I agree, changing the warning to include the relevant project would be helpful. Additionally, the warning should not be shown when the project is Clojure only.

Regarding 2), currently, we use the cljsbuild config of checkouts to get the :source-paths from. I guess what we could do is to check if the project is a ClojureScript project (has *.cljs or *.cljc files only) and then either take the path from the general :source-paths config entry if it exists or use src as a default.

PRs are welcome 😉

darwin added a commit to binaryage/cljs-devtools that referenced this issue Dec 6, 2015
darwin added a commit to binaryage/chromex-sample that referenced this issue Dec 6, 2015
darwin added a commit to binaryage/chromex that referenced this issue Dec 6, 2015
@conan
Copy link

conan commented Feb 18, 2016

I have a project which experiences this error, but neither it nor any of its checkouts are not using the new format. It is the case that some of the projects only specify a :cljsbuild section in a profile rather than having one at the top level, and that profile may not be active for all leiningen tasks. It would be useful if the error message could explain which project is missing the :cljsbuild config, and what profiles are being applied to it.

@PetrGlad
Copy link

Here are actually three separate problems:

  1. When cljsbuild is run on project that lacks :cljsbuild section both "missing configuration" and conversion notice are issued. This is bug. Should not show conversion warning if no configuration found. And, BTW, vector in conversion sample config is misleading, since map is required.
  2. Probably there's good solution that could be implemented in Leiningen itself but there should be a message or hint that tells that these issues are found in checkouts/sub-pojects, not current one.
  3. I think that cljsbuild should probably ignore checkout projects that do not have cljsbuild plugin configured.

@PetrGlad
Copy link

Note that double warning issue is easily reproducible on a project without :cljsbuild section. No checkouts actually required to reproduce it (however we'll have one such message per project/checkout with missing config). To reproduce, use e.g. project.clj

(defproject cljsproj "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.8.51"]]
  :plugins [[lein-cljsbuild "1.1.3"]])

then run
lein cljsbuild once

@ghost
Copy link

ghost commented Mar 28, 2017

Does anyone have a patch to fix this?

@mneise mneise added this to the 1.1.8 milestone Jul 30, 2017
@mneise mneise removed this from the 1.1.8 milestone Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants