Rust codegen: @snap_client_toolchains//:compilation_mode_opt is missing in internal monorepo builds, breaking valdi_core_rust_cc analysis
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 77/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- build-system
调研方向
从 valdi_core/BUILD.bazel 中 valdi_core_rust_cc 的 defines select 开始,然后将 client/bzl/toolchains/BUILD.sc_build_flags.tpl 和 BUILD.flags.tpl 中的 @snap_client_toolchains 模板与独立的存根 bzl/toolchains/BUILD.bazel 进行比较。在内部构建中提供此配置设置,并确认其中 //valdi_core:valdi_core_rust_cc 的 Bazel 分析成功。
由索引模型根据 Issue 内容生成。
描述
Found while reviewing https://github.com/Snapchat/Valdi/pull/211 (native Rust code generation). Not blocking that PR.
@snap_client_toolchains//:compilation_mode_opt is missing in internal monorepo builds, breaking valdi_core_rust_cc analysis
File: valdi_core/BUILD.bazel
Configuring //valdi_core:valdi_core_rust_cc (or any target that depends on it, such as //valdi:test_integration or a valdi_module with native_language = "rust") in an internal monorepo workspace (client, android, phantom, banshee) fails Bazel analysis because @snap_client_toolchains//:compilation_mode_opt does not exist there. The defines select(...) on valdi_core_rust_cc references @snap_client_toolchains//:compilation_mode_opt.
Internal builds generate @snap_client_toolchains via setup_snap_cxx_toolchains in client/bzl/toolchains/setup.bzl using templates such as client/bzl/toolchains/BUILD.sc_build_flags.tpl and client/bzl/toolchains/BUILD.flags.tpl, none of which declare :compilation_mode_opt (it only exists in the standalone stub bzl/toolchains/BUILD.bazel). Because Bazel evaluates select keys during analysis in every workspace, referencing a label absent from the generated repo breaks target analysis on internal builds.
Define a local config_setting(name = "compilation_mode_opt", values = {"compilation_mode": "opt"}) in valdi_core/BUILD.bazel and select on ":compilation_mode_opt" (or use @snap_client_toolchains//:sc_build_flag_assert, which both toolchains define).
- 主要语言
- C++
- 星标
- 16.4k
- 派生
- 539
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Snapchat/Valdi 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
相似的 Issue
-
RTL-SDR: re-enumerating while streaming removes the in-use entry from the device selection dialog可能已有人在做 @dpc00 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
throneproj/Throne#2227 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
deepseek-ai/DeepGEMM-Ascend#49 ·
维护者通常 1 天内回复