You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue with shadow failing on MS-Windows when the project root directory and a library downloaded via deps.edn wiht git are in different drives (e.g. D: and C: respectively):
d:\clj\issues\issue-shadow-cljs-rel-path>powershell -command clojure -M:shadow watch browser
Downloading: thheller/shadow-cljs/2.16.6/shadow-cljs-2.16.6.pom from clojars
Downloading: thheller/shadow-cljs/2.16.6/shadow-cljs-2.16.6.jar from clojars
[2021-12-04 16:17:14.341 - WARNING] TCP Port 9630 in use.
[2021-12-04 16:17:14.355 - WARNING] TCP Port 9631 in use.
failed to start service
{:id :classpath}
ExceptionInfo: failed to start service
shadow.runtime.services/start-many/fn--9691 (services.clj:135)
...
clojure.main.main (main.java:40)
Caused by:
IllegalArgumentException: 'other' has different root
sun.nio.fs.WindowsPath.relativize (WindowsPath.java:404)
sun.nio.fs.WindowsPath.relativize (WindowsPath.java:42)
shadow.build.classpath/project-rel-path (classpath.clj:719)
shadow.build.classpath/project-rel-path (classpath.clj:718)
shadow.build.classpath/find-fs-resources* (classpath.clj:767)
shadow.build.classpath/find-fs-resources* (classpath.clj:764)
shadow.build.classpath/find-fs-resources (classpath.clj:792)
shadow.build.classpath/find-fs-resources (classpath.clj:791)
shadow.build.classpath/find-resources (classpath.clj:801)
shadow.build.classpath/find-resources (classpath.clj:795)
shadow.build.classpath/index-path* (classpath.clj:1034)
shadow.build.classpath/index-path* (classpath.clj:1031)
...
shadow.build.classpath/index-classpath/fn--11375/fn--11376 (classpath.clj:1167)
...
shadow.build.classpath/index-classpath/fn--11375 (classpath.clj:1167)
shadow.build.classpath/index-classpath (classpath.clj:1166)
shadow.build.classpath/index-classpath (classpath.clj:1161)
shadow.build.classpath/index-classpath (classpath.clj:1163)
shadow.build.classpath/index-classpath (classpath.clj:1161)
shadow.cljs.devtools.server.common/fn--16790 (common.clj:95)
shadow.cljs.devtools.server.common/fn--16790 (common.clj:93)
...
This is because it cannot find a relative path between the Project and the downloaded git library.
To reproduce on MS-Windows, create the below project on a different drive (say somewhere on drive D:) than clojure cli stores the github dependencies (normally stored on drive C: under C:\Users\<username>\.gitlibs):
e.g. under D:\clj\issues\issue-shadow-cljs-rel-path\
The cause of the issue is that shadow is trying to find a relative path from the project to the dep with shadow.build.classpath/project-rel-path, but it cannot and throws the above example. There is no relative path because there is no common root between D:\clj\issues\issue-shadow-cljs-rel-path and C:\Users\ikappaki\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src (one starts with D: the other with C:).
If we relocate the project on the C drive, then the above succeeds, since there is a relative path between the two C:\clj\issues\issue-shadow-cljs-rel-path and C:\Users\ikappaki\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src, namely ..\..\..\Users\ikappaki\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src. The same works on *nix, because there is always a common root / amongst any absolute paths, thus a relative path with ../... can always be created.
It is not obvious to me what the correct solution is, have shadow.build.classpath/project-rel-path return nil? Though the callers appear to always make use of the return value.
Thanks!
The text was updated successfully, but these errors were encountered:
Tried running an Athens dev build on Windows and ran into thheller/shadow-cljs#966, which is solved by updating Shadow-CLJS.
Shadow-CLJS and CLJS have to be updated together because that's just how Shadow-CLJS works.
Tick had to be updated because it broke when updating the other two.
Hi,
I've encountered an issue with shadow failing on MS-Windows when the project root directory and a library downloaded via
deps.edn
wiht git are in different drives (e.g.D:
andC:
respectively):This is because it cannot find a relative path between the Project and the downloaded git library.
To reproduce on MS-Windows, create the below project on a different drive (say somewhere on drive
D:
) than clojure cli stores the github dependencies (normally stored on driveC:
underC:\Users\<username>\.gitlibs
):e.g. under
D:\clj\issues\issue-shadow-cljs-rel-path\
The above error is returned.
The cause of the issue is that shadow is trying to find a relative path from the project to the dep with
shadow.build.classpath/project-rel-path
, but it cannot and throws the above example. There is no relative path because there is no common root betweenD:\clj\issues\issue-shadow-cljs-rel-path
andC:\Users\ikappaki\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src
(one starts withD:
the other withC:
).If we relocate the project on the C drive, then the above succeeds, since there is a relative path between the two
C:\clj\issues\issue-shadow-cljs-rel-path
andC:\Users\ikappaki\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src
, namely..\..\..\Users\ikappaki\.gitlibs\libs\re-frame\re-frame\8cf68c30722a4c6f8f948a134c900d7a656ecad4\src
. The same works on *nix, because there is always a common root/
amongst any absolute paths, thus a relative path with../...
can always be created.It is not obvious to me what the correct solution is, have shadow.build.classpath/project-rel-path return nil? Though the callers appear to always make use of the return value.
Thanks!
The text was updated successfully, but these errors were encountered: