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

How to use this lib #10

Open
TealerLinkGuo opened this issue Mar 19, 2021 · 19 comments
Open

How to use this lib #10

TealerLinkGuo opened this issue Mar 19, 2021 · 19 comments

Comments

@TealerLinkGuo
Copy link

I want a document on how to use it,thank you!

@Dolu1990
Copy link
Member

Dolu1990 commented Apr 1, 2021

There is none yet, right @Snoopy87 ?

@Snoopy87
Copy link
Member

Snoopy87 commented Apr 1, 2021

There is a wiki page about SpinalCrypto . @TealerLinkGuo, if it miss something in the doc tell me and sorry for the delay, I didn't see the issue.

@Dolu1990
Copy link
Member

Dolu1990 commented Apr 1, 2021

Hooo cool ! I wasn't ware :D

@dnltz
Copy link
Contributor

dnltz commented Apr 6, 2022

@Dolu1990 Can we push this repo to maven as well? Cloning and pushing to the local packages is a little bit awkward when deploying a project.

@Dolu1990
Copy link
Member

Dolu1990 commented Apr 7, 2022

@dnltz Ahhh in general, instead of pushing to local packages, i'm integrating libraries as SBT module :
https://github.com/SpinalHDL/SpinalTemplateSbtDependencies/blob/superproject/build.sbt#L19

It is more flexible, less heavy weight on release schedule.

Would that be good ?

@dnltz
Copy link
Contributor

dnltz commented Apr 7, 2022

@Dolu1990 Well, yes ... that will actually work and indeed it's more flexible.

@Dolu1990
Copy link
Member

Dolu1990 commented Apr 8, 2022

I added a reference in to the doc about this SpinalTemplate repository as an alternative.

@xueweiwujxw
Copy link

@dnltz Ahhh in general, instead of pushing to local packages, i'm integrating libraries as SBT module : https://github.com/SpinalHDL/SpinalTemplateSbtDependencies/blob/superproject/build.sbt#L19

It is more flexible, less heavy weight on release schedule.

Would that be good ?

I cloned this project, and I excute sbt bloopInstall with scala(metals) extension of vscode. I found the following error

2022.04.20 17:37:55 INFO  [warn] 
2022.04.20 17:37:55 INFO  [warn] 	Note: Unresolved dependencies path:
2022.04.20 17:37:55 INFO  [error] Couldn't run bloopGenerate for root-test
2022.04.20 17:37:55 INFO  [error] Couldn't run bloopGenerate for root
2022.04.20 17:37:55 INFO  [success] Total time: 2 s, completed 2022-4-20 17:37:55
2022.04.20 17:37:55 INFO  time: ran 'sbt bloopInstall' in 8.51s
2022.04.20 17:37:55 WARN  Build server is not auto-connectable.

@dnltz
Copy link
Contributor

dnltz commented Apr 20, 2022

@xueweiwujxw - This might be because of #15
Have you added the dependency for this project as recommended in https://github.com/SpinalHDL/SpinalCrypto/wiki/Getting-started#using-the-library-without-publishlocal?

@xueweiwujxw
Copy link

@dnltz I tried https://github.com/SpinalHDL/SpinalTemplateSbtDependencies, and modified build.sbt as following:

val spinalVersion = "1.6.4"

lazy val root = (project in file("."))
  .settings(
    inThisBuild(List(
      organization := "com.github.spinalhdl",
      scalaVersion := "2.11.12",
      version      := "0.1.0-SNAPSHOT"
    )),
    name := "superproject",
    libraryDependencies ++= Seq(
      "com.github.spinalhdl" % "spinalhdl-core_2.11" % spinalVersion,
      "com.github.spinalhdl" % "spinalhdl-lib_2.11" % spinalVersion,
      compilerPlugin("com.github.spinalhdl" % "spinalhdl-idsl-plugin_2.11" % spinalVersion)
    )
  ).dependsOn(vexRiscv)

//For dependancies localy on your computer : 
//lazy val vexRiscv = RootProject(file("./ext/VexRiscv"))

//For dependancies on a git : 
lazy val vexRiscv = RootProject(uri("git://github.com/SpinalHDL/VexRiscv.git"))

//For dependancies on a git with a specific commit : 
//lazy val vexRiscv = RootProject(uri("git://github.com/SpinalHDL/VexRiscv.git#commitHash"))


fork := true

sbt run worked well, but scala(metals) extension of vscode did not work.
error: Fatal recursive dependency detected in 'root': List(root, root)
It might be because of Fatal recursive dependency

Maybe pusing this repo to maven can solve this problem.
Integrating libraries as SBT module is indeed more flexible.

@Dolu1990
Copy link
Member

If i understand well you are running SpinalHDL with scala metal, I never tried and have no idea how well it will go.

What "scala(metals) extension of vscode" do ?

@xueweiwujxw
Copy link

If i understand well you are running SpinalHDL with scala metal, I never tried and have no idea how well it will go.

What "scala(metals) extension of vscode" do ?

Yes... It's an extension of vscode. I use it for code hint. Maybe it does hace some problems. Thanks a lot anyway.
And I cloned SpinalCrypto and pushed it to the local packages temporarily. This did work well.

@Dolu1990
Copy link
Member

Else, there is intellij with the scala plugin. Not perfect at all, but ho well XD

@MarekPikula
Copy link

Would it be possible to publish this library on Maven?

@Dolu1990
Copy link
Member

For this repo, what's about adding instead an mill buildscript in parallel to the SBT one ? to easy its integration directly from source ?

I mean, overall, if each project need to be published to maven, things realy get heavyweight in terms of management XD

@MarekPikula
Copy link

Yeah, I have it set up like that, but I guess since it's one of the projects published in SpinalHDL namespace it would be nice to have it published to central repo as well. This would make it much more accessible and maybe more development could happen.

When I see a library which is not published anywhere, I consider it somewhat experimental, and I have an “avoid if possible” flag in my head. Actually, if I wasn't using it for a non-critical function in the project, I would probably not use it at all.

If you think that things become heavyweight in terms of management, maybe it's time to incorporate more sophisticated CD into the project? One that would publish snapshots on development branch to snapshot repo (as discussed here) and publish versions basing on git tag.

@Dolu1990
Copy link
Member

maybe it's time to incorporate more sophisticated CD into the project? One that would publish snapshots on development branch to snapshot repo (as discussed SpinalHDL/SpinalHDL#793) and publish versions basing on git tag.

I guess it could. So in a first time, to automate the CD of SpinalHDL itself, once it work we could try on this repo ?
Do you feel up for trying getting the CD working on SpinalHDL repo itself ?

@MarekPikula
Copy link

Yeah, I guess we can go with this approach. I could set up CD for SpinalHDL for sure. Next week I will be away on holidays, but I could work on that for sure in the beginning of September.

@Dolu1990
Copy link
Member

ok :)

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

6 participants