Yak package for R7 and R8

Hi all.

I have a GH plugin built for Net48 and Net7.0 that needs to be installed for R7 and R8.
If I follow this structure and build the package using the last version from here I have blabla-0.0.1-any-any.yak, if I install this package in R7, the package will install, but GH will not load the library, which will instead work for R8.

Considering from Rhino 8 onwards, Yak also supports multi-targeted apps

Do we have to build 2 independent yak packages for R7 and R8 or one package targeting only Net48? Are these the only solutions, or am I missing something?

@CallumSykes, I know you have an answer for this :slight_smile:

The other thing I noticed is.
Suppose I use yak as suggested here. I am constantly having this type of result blabla-0.0.1-any-any.yak even if I build into the specific folders for net48 or net7.0. In that case, it seems not able to define if rh7 or rh8 instead; if I use the compiled downloadable version, and I use it in a folder net48, I will have this type of result blabla-0.0.1-rh7_32-any if I use it into a folder net7.0 I will have this result blabla-0.0.1-rh8_13-any so I have a better result keep using the downloadable version.

Ideally you need two packages.

Rhino 7
Build for net48 only with the manifest.yml besides the .rhp/.gha

Rhino 8
Build for net48 and/or net7.0 with the manifest in the parent directory to the net48/net7.0 directories

I’m not sure about this one. I’ll do some testing and get back to you with the current status.

Is it recommended to use the yak.exe package with Rhino8, or can I use the downloadable one?

In general, if you have Rhino installed I’d recommend using the yak.exe in the System directory. The downloadable yak.exe is meant for situations where Rhino is not installed, such as building and publishing packages on a build server.

I’m not sure why the Rhino version isn’t being populated when building a multi-targeted .NET plug-in package. We’ll have to look into that.

In your case, I’d recommend doing the following, using the yak.exe that ships with Rhino 8.

  1. From the directory above the net48 and net7.0 folders, build your package. If the package filename ends with “-any-any.yak”, rename it to “-rh8_13-any.yak” (the “rh” version should be the version of RhinoCommon that you built against, i.e. Rhino 8 SR13).
  2. Copy the contents of net48/ to a new directory (just to keep things clean!) and also copy the manifest.yml file. Then build another package from this directory. You should get something that ends with “-rh7_32-any.yak”, based on what you shared earlier.
  3. You should now have two package files – one for Rhino 8 with net48 and net7.0 versions of your plug-in, and one for Rhino 7 (net48 only). They should both have the same package name and package version, e.g. “blabla-0.0.1-rh8_13-any.yak” and “blabla-0.0.1-rh7_32-any.yak”.
  4. Publish both package files! They can both be published side-by-side to make use of the “distributions” feature of the package system.

I would prefer to use the downloadable yak.exe because I am creating the package using NUKE and GitHub actions and pushing it to a shared server.

This “-any-any.yak” if I use yak as suggested here. So, I extracted the yak.exe and DLLs from the Rhino8 system folder into a separate folder, and I have the any-any result, but if I run the yak.exe in the Rhino8 system folder, I have the rh8_13-any result.
I can also get the rh8_13-any if I use the downloadable version.

Based on your suggestions, this seems to be the best solution for now.
Downloadable yak.exe.
Build a multi-target package for Rh8, then build a package for Rh7. The final result will be.
“blabla-0.0.1-rh8_13-any.yak” and “blabla-0.0.1-rh7_32-any.yak” .

@will
This is the warning I get when I use the downloadable version or copy the Yak files into a separated folder.

Found manifest.yml for package: blabla (0.0.1)
WARNING: No files found that could be inspected
Creating blabla-0.0.1-any-any.yak

If I use yak.exe from Rhino8 System folder.

Found manifest.yml for package: blabla (0.0.1)
Inspecting content: blabla.gha
Creating blabla-0.0.1-rh8_13-any.yak

Do we need a net7.0-windows?
Or net7.0 is enough?

net7.0 is fine for most cases.

1 Like