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

Deps import fails when using :default-deps #2517

Closed
cursive-ide opened this issue Mar 1, 2021 · 0 comments
Closed

Deps import fails when using :default-deps #2517

cursive-ide opened this issue Mar 1, 2021 · 0 comments
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@cursive-ide
Copy link
Owner

Reported by @favila in Slack:

When importing a project that looks somewhat like this (redacted):

{:aliases
  {:backend-defaults
   {:default-deps
    {io.clubhouse.module/logging
     {:local/root "../logging", :deps/manifest :deps},
     io.clubhouse.module/dev-shared
     {:local/root "../dev-shared", :deps/manifest :deps}}},
   :test
   {:extra-paths
    ["test"],
    :extra-deps
    {io.clubhouse.module/dev-shared nil}}},
  :paths
  ["src" "resources"]
  :deps
  {io.clubhouse.module/logging nil}}

Vars across :local/root deps.edn dependencies cannot be resolved, but their namespaces can (i.e. I can control-b the namespace and appear in the right one). Also I have deps with no names.

However refactoring the deps.edn to look like this works:

{:aliases
  {:backend-defaults
   {:default-deps {}},
   :test
   {:extra-paths
    ["test"],
    :extra-deps
    {io.clubhouse.module/dev-shared {:local/root "../dev-shared", :deps/manifest :deps}}}},
  :paths
  ["src" "resources"]
  :deps
  {io.clubhouse.module/logging 
     {:local/root "../logging", :deps/manifest :deps}}}

The problem seems to be that when deps are pulled in through :default-deps, deps doesn’t normalise the paths to absolute paths. Using the first (broken) example:

~/d/c/f/main> clj -Stree -A:backend-defaults:test
org.clojure/clojure 1.10.2
  . org.clojure/spec.alpha 0.2.194
  . org.clojure/core.specs.alpha 0.2.56
io.clubhouse.module/logging ../logging
io.clubhouse.module/dev-shared ../dev-shared

Using the second (working) example:

~/d/c/f/main> clj -Stree -A:backend-defaults:test
org.clojure/clojure 1.10.2
  . org.clojure/spec.alpha 0.2.194
  . org.clojure/core.specs.alpha 0.2.56
io.clubhouse.module/logging /Users/colin/dev/cursive-bugs/favila-deps-issue/logging
io.clubhouse.module/dev-shared /Users/colin/dev/cursive-bugs/favila-deps-issue/dev-shared

Here, the two libs come in via :extra-deps and top-level :deps, and they are both absolute.

@cursive-ide cursive-ide added this to the 1.10.2 milestone Mar 1, 2021
@cursive-ide cursive-ide modified the milestones: 1.10.2, 1.10.2-eap1 Mar 10, 2021
@cursive-ide cursive-ide added the bug Marks issues describing bugs label Mar 10, 2021
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

1 participant