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

Can't add local or git dependencies #35

Open
nmk456 opened this issue Aug 13, 2023 · 4 comments
Open

Can't add local or git dependencies #35

nmk456 opened this issue Aug 13, 2023 · 4 comments

Comments

@nmk456
Copy link

nmk456 commented Aug 13, 2023

I am attempting to copy the changes from SpinalTemplateSbtDependencies to my build.sbt in a project based on SpinalTemplateSbt. When I compile, I get the following error:

[warn]
[warn]  Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.github.spinalhdl:vexriscv_2.12:2.0.0
[error]   Not found
[error]   Not found
[error]   not found: /home/nathan/.ivy2/localcom.github.spinalhdl/vexriscv_2.12/2.0.0/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/github/spinalhdl/vexriscv_2.12/2.0.0/vexriscv_2.12-2.0.0.pom
[error]         at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:345)
[error]         at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:314)
[error]         at scala.util.Either$LeftProjection.map(Either.scala:573)
[error]         at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:314)
[error]         at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error]         at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:59)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:133)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:146)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:146)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:127)
[error]         at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:160)
[error]         at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3690)
[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:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[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:750)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.github.spinalhdl:vexriscv_2.12:2.0.0
[error]   Not found
[error]   Not found
[error]   not found: /home/nathan/.ivy2/localcom.github.spinalhdl/vexriscv_2.12/2.0.0/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/github/spinalhdl/vexriscv_2.12/2.0.0/vexriscv_2.12-2.0.0.pom
[error] Total time: 1 s, completed Aug 12, 2023 5:07:58 PM

I'm able to reproduce this on a fresh project created from this template with the following changes:

diff --git a/build.sbt b/build.sbt
index 0ced33a..b208157 100644
--- a/build.sbt
+++ b/build.sbt
@@ -11,6 +11,8 @@ lazy val projectname = (project in file("."))
   .settings(
     Compile / scalaSource := baseDirectory.value / "hw" / "spinal",
     libraryDependencies ++= Seq(spinalCore, spinalLib, spinalIdslPlugin)
-  )
+  ).dependsOn(vexRiscv)
+
+lazy val vexRiscv = RootProject(uri("git://github.com/SpinalHDL/VexRiscv.git"))

 fork := true

Steps:

  1. git clone https://github.com/SpinalHDL/SpinalTemplateSbt
  2. Apply the diff above
  3. cd SpinalTemplateSbt
  4. sbt compile

I've also tried pointing it at a local copy of VexRiscv and got the same error.

I'm not really sure if this is an issue with the template, VexRiscv, sbt, or something else. I can move this somewhere else if necessary.

@nmk456
Copy link
Author

nmk456 commented Aug 13, 2023

Looks like this is an issue with the Scala version. 2.12.16 (used in this repo) produces the error, 2.11.12 (used in the dependency template repo) doesn't. It looks like VexRiscv uses 2.11.12 so that's where the mismatch is.

@Dolu1990
Copy link
Member

Hi, yes you are right, you need to downgrade to 2.11.12 :)

@nmk456
Copy link
Author

nmk456 commented Aug 20, 2023

Is there any chance that the VexRiscv Scala version could be upgraded to 2.12 or higher? It seems like 2.11 has issues with the latest version of Metals (scalameta/metals#5561), so autocomplete no longer works.

@Dolu1990
Copy link
Member

Did you tried updating https://github.com/SpinalHDL/VexRiscv/blob/master/build.sbt#L7 to scala 2.12 ?
It should normaly work fine.

Then, could try a multi version build.sbt, but seems that it often break people stuff easily XD
So maybe a master_2.12 branch could be added ?

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