Skip to main content
Glama
configure_env.bzl1.43 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//debugging:labels.bzl", "DBG_INFO_DISABLE_INCOMPATIBLE_SANITIZERS") load("@prelude//debugging:types.bzl", "UserMessage") ConfiguredEnv = record( env = field(dict[str, str]), messages = field(list[UserMessage]), ) _DISABLE_LEAK_DETECTION = "detect_leaks=0" def configure_env(env: dict[str, str], labels: list[str]) -> ConfiguredEnv: messages = [] if DBG_INFO_DISABLE_INCOMPATIBLE_SANITIZERS in labels: messages.append( UserMessage( title = "Leak sanitizer is disabled.", body = "You are trying to debug a binary with sanitizers. Certain sanitizers do not work under the debugger.\n", ), ) env = _inject_env(env, "ASAN_OPTIONS", _DISABLE_LEAK_DETECTION, lambda x: x + "," + _DISABLE_LEAK_DETECTION) return ConfiguredEnv(env = env, messages = messages) def _inject_env(env: dict[str, str], key: str, value: str, merge: typing.Callable[[str], str]) -> dict[str, str]: existing_env = env.get(key) if existing_env: env[key] = merge(existing_env) else: env[key] = value return env

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