Component resolvers

Component resolvers extend the component framework through an environment to resolve a component URL into a component.

Component manager resolves component URLs by finding a resolver that supports a matching URL scheme in the relevant environment and sending a request using the fuchsia.component.resolution.Resolver protocol.

If resolution succeeds, the component resolver returns a ComponentDecl, the FIDL representation of a component manifest. If the component being resolved has an associated package, the component resolver also returns a fuchsia.io.Directory handle for the package directory.

Providing resolver capabilities

To provide a resolver capability, a component must declare a resolver capability, whose path designates a FIDL protocol implementing fuchsia.component.resolution.Resolver served from the component's outgoing directory .

{
    capabilities: [
        {
            resolver: "my_resolver",
            path: "/svc/fuchsia.component.resolution.Resolver",
        },
    ],
}

Component manager submits requests to resolve a component URL to this protocol.

Routing resolver capabilities

Components route resolver capabilities by exposing them to their parent and offering them to their children.

For more details on how the framework routes component capabilities, see capability routing.

Exposing

Exposing a resolver capability gives the component's parent access to that capability:

{
    expose: [
        {
            resolver: "my_resolver",
            from: "self",
        },
    ],
}

Offering

Offering a resolver capability gives a child component access to that capability:

{
    offer: [
        {
            resolver: "my_resolver",
            from: "self",
            to: [ "#child-a" ],
        },
    ],
}

Registering a component resolver

Component resolvers are made available to components through their environment. To register a new resolver within an environment, add a new entry to the resolvers section of the environments declaration:

environments: [
    {
        name: "my-environ",
        extends: "realm",
        resolvers: [
            {
                resolver: "my_resolver",
                scheme: "my-scheme",
                from: "parent",
            }
        ],
    },
]

The registered resolver will be used to resolve component URLs whose URL scheme matches the provided scheme.

For more details on how to apply environments to components, see the environments documentation.

Framework resolvers

Component framework provides the following built-in component resolvers to support standard Fuchsia URL schemes:

Resolver URL scheme
boot_resolver fuchsia-boot
base_resolver fuchsia-pkg
full-resolver fuchsia-pkg