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

Explicit URL using from not working as expected #5418

Open
hvesalai opened this issue Feb 4, 2020 · 4 comments
Open

Explicit URL using from not working as expected #5418

hvesalai opened this issue Feb 4, 2020 · 4 comments

Comments

@hvesalai
Copy link
Contributor

hvesalai commented Feb 4, 2020

steps

We have the following dependency (note the intentional misspelling of the module name, added there to better demonstrate the issue)

    "org.bytedeco.javacpp-presets" % "opencv-linuxy" % "3.1.0-1.2" from "https://ourthing/" +
      "maven2/org/bytedeco/javacpp-presets/opencv-linux/3.1.0-1.2/opencv-linux-3.1.0-1.2.jar"

problem

the from rule does not work. sbt does not download the artifact using the given url. Furthermore it tries to resolve the dependency using other URLs. Here's the log:

[error] sbt.librarymanagement.ResolveException: Error downloading org.bytedeco.javacpp-presets:opencv-linuxy:3.1.0-1.2
[error]   Not found
[error]   Not found
[error]   not found: /home/hvesalai/.ivy2/local/org.bytedeco.javacpp-presets/opencv-linuxy/3.1.0-1.2/ivys/ivy.xml
[error]   not found: https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linuxy/3.1.0-1.2/opencv-linuxy-3.1.0-1.2.pom
[error]   not found: https://ourthing/ivy/org.bytedeco.javacpp-presets/opencv-linuxy/3.1.0-1.2/ivys/ivy.xml
[error]   opencv-linux-3.1.0-1.2.jar not found under https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linux/3.1.0-1.2/
[error]         at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:246)
[error]         at lmcoursier.CoursierDependencyResolution.$anonfun$update$34(CoursierDependencyResolution.scala:215)
[error]         at scala.util.Either$LeftProjection.map(Either.scala:573)
[error]         at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:215)
[error]         at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error]         at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:52)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:102)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:69)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:115)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:115)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:96)
[error]         at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:129)
[error]         at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2947)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error]         at sbt.Execute.work(Execute.scala:290)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (trademarkproxy / update) sbt.librarymanagement.ResolveException: Error downloading org.bytedeco.javacpp-presets:opencv-linuxy:3.1.0-1.2
[error]   Not found
[error]   Not found
[error]   not found: /home/hvesalai/.ivy2/local/org.bytedeco.javacpp-presets/opencv-linuxy/3.1.0-1.2/ivys/ivy.xml
[error]   not found: https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linuxy/3.1.0-1.2/opencv-linuxy-3.1.0-1.2.pom
[error]   not found: https://ourthing/ivy/org.bytedeco.javacpp-presets/opencv-linuxy/3.1.0-1.2/ivys/ivy.xml
[error]   opencv-linux-3.1.0-1.2.jar not found under https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linux/3.1.0-1.2/

At the end it says opencv-linux-3.1.0-1.2.jar not found under https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linux/3.1.0-1.2/ even though it surely is (and sbt will happily download it if I remove the y from the module name added there to trigger this).

expectation

I would have expected the from to work and further more, I would not have expected it to try to resolve it from other sources. The point of from for me is to be able to override the normal resolving and point to an exact artifact. It should fail if the artifact is not there. At the moment it doesn't fail if I use the correct artifact id, but wrong from url.

[error] not found: https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linuxy/3.1.0-1.2/opencv-linuxy-3.1.0-1.2.pom
[error] not found: https://ourthing/ivy/org.bytedeco.javacpp-presets/opencv-linuxy/3.1.0-1.2/ivys/ivy.xml

notes

Could it be that sbt is trying to use https://ourthing/maven2/org/bytedeco/javacpp-presets/opencv-linux/3.1.0-1.2/ as a directory name?

@hvesalai hvesalai added the Bug label Feb 4, 2020
@eed3si9n eed3si9n added the area/library_management library management label Feb 4, 2020
@dwijnand
Copy link
Member

dwijnand commented Feb 5, 2020

The is a follow-on from the Gitter chat, that starts here and ends here, where you say:

it seems the from has never worked since the URL I had there had been wrong all along (so it had downloaded the artifact using the normal resolution). Thus the change is somewhere else.

So in this issue you're tracking the fact that from isn't overriding the default behaviour, as of sbt 1.3 / Coursier, right?

@hvesalai
Copy link
Contributor Author

hvesalai commented Feb 5, 2020

We added the from there when we upgraded out deployment from sbt-launch to coursier. I don't exactly recall why I added it since obviously it had worked without/despite it. We didn't use from with earlier versions of sbt, so I don't know if the from has ever worked as I expect.

The description of the issue above is using a correct URL, but bogus module name (to prevent sbt/coursier from using the default behavior).

@SethTisue
Copy link
Member

I have used from successfully in sbt versions ranging from 0.13.x to 1.2.8, haven't tried it more recently than that. perhaps it regressed in 1.3

@eed3si9n eed3si9n changed the title from not working as expected Explicit URL using from not working as expected Feb 6, 2021
@eed3si9n
Copy link
Member

eed3si9n commented Feb 6, 2021

If this is a regression starting sbt 1.3.x, could you report this to coursier/coursier please? I'm not sure if there's much we can do on sbt's side beyond suggesting useCoursier := false for the problematic subprojects.

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

4 participants