Skip to main content
Glama
linkables.bzl1.72 kB
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under both the MIT license found in the # LICENSE-MIT file in the root directory of this source tree and the Apache # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. load("@prelude//utils:expect.bzl", "expect") load( ":link_groups.bzl", "LinkGroupLibInfo", ) load( ":link_info.bzl", "MergedLinkInfo", ) load( ":linkable_graph.bzl", "LinkableGraph", "LinkableRootInfo", ) load( ":shared_libraries.bzl", "SharedLibraryInfo", ) # A record containing all provider types used for linking in the prelude. This # is essentially the minimal subset of a "linkable" `dependency` that user rules # need to implement linking, and avoids needing functions to take the heavier- # weight `dependency` type. LinkableProviders = record( link_group_lib_info = field(LinkGroupLibInfo), linkable_graph = field([LinkableGraph, None], None), merged_link_info = field(MergedLinkInfo), shared_library_info = field(SharedLibraryInfo), linkable_root_info = field([LinkableRootInfo, None], None), ) def linkable(dep: Dependency) -> LinkableProviders: expect(LinkGroupLibInfo in dep, str(dep.label.raw_target())) return LinkableProviders( shared_library_info = dep[SharedLibraryInfo], linkable_graph = dep.get(LinkableGraph), merged_link_info = dep[MergedLinkInfo], link_group_lib_info = dep[LinkGroupLibInfo], linkable_root_info = dep.get(LinkableRootInfo), ) def linkables(deps: list[Dependency]) -> list[LinkableProviders]: return [linkable(dep) for dep in deps if MergedLinkInfo in dep]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server