#SDK

1 messages · Page 1 of 1 (latest)

distant phoenix
#

Damn, does not work out of the box with Dagger 0.15.2.

dense grove
#

Noted. Yeah, I'm on 0.15.1. Mind sharing the error?

distant phoenix
#

It is trying to pull your images on ghcr using the tag of the local Dagger engine version. So something along the lines of "cannot find image with tag 0.15.2".

dense grove
#

@distant phoenix Fixed. And I added a version-specific tag. dagger init --sdk=https://github.com/m-pixel/dagger/sdk/dotnet/module@dotnet0.15.2

distant phoenix
#

Awesome, thanks, will definitely try it out.

distant phoenix
#

That worked, yay!

Even got my own daggerverse module installed and put into use.
However, cannot figure out how to set default values for builtins - e.g. Directory.

dense grove
#

I should have included a Directory example in the template code.

You're looking for [DirectoryFromContext]. It's hierarchical:

// This sucks
public class MyMod
{
    public string Echo([DirectoryFromContext(DefaultPath = "/messages")] Directory messagesToEcho) => ...;
    public Container CurryEcho([DirectoryFromContext(DefaultPath = "/messages")] Directory messagesToEcho) => ...;
}

// This is better
[DirectoryFromContext(DefaultPath = "/messages")]
public class MyMod
{
    public string Echo([DirectoryFromContext] Directory messagesToEcho) => ...;
    public Container CurryEcho([DirectoryFromContext] Directory messagesToEcho) => ...;
}

You can set defaults at the assembly, class, function, and parameter level. And you can override either property (path, ignores) at each level.

For string, int, etc, set default values by setting default values:

public class MyMod
{
    // Dagger will treat bar as optional, having a default value of "baz"
    public void Foo(string bar = "baz") => ...;
}
distant phoenix
#

Awesome, thanks.

distant phoenix
#

@dense grove Would it be a bother to upgrade to 0.15.3?
Want to try it out again, but too much time would go with updating if I were to do it.

dense grove
#

Did just that last night. Didn't test pulling it down outside the dagger source repo yet though.

#

0.15.3 includes float/double support.