Rust codegen: @snap_client_toolchains//:compilation_mode_opt is missing in internal monorepo builds, breaking valdi_core_rust_cc analysis
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 77/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system
Research direction
Start in valdi_core/BUILD.bazel at the defines select on valdi_core_rust_cc, then compare the @snap_client_toolchains templates in client/bzl/toolchains/BUILD.sc_build_flags.tpl and BUILD.flags.tpl with the standalone stub bzl/toolchains/BUILD.bazel. Make the configuration setting available in internal builds and confirm Bazel analysis succeeds for //valdi_core:valdi_core_rust_cc there.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- C++
- Stars
- 16.4k
- Forks
- 539
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Snapchat/Valdi
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Rust codegen: RustMethodResolver fails to unwrap .nullable on optional interface/module methodsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepseek-ai/DeepGEMM-Ascend#49 ·
Maintainers usually reply within 1 day
-
bug needs testing platform:windows topic:buildsystem topic:platforms
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#126110 · 1 comment ·
Maintainers usually reply within 1 day
-
comp-s3queue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ClickHouse/ClickHouse#137649 ·
Maintainers usually reply within 1 day
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yugabyte/yugabyte-db#40355 ·
Maintainers usually reply within 1 day
-
Clear params.inputs in dials.indexPossibly taken @phyy-nx claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dials/dials#3361 · 1 comment ·
Maintainers usually reply within 1 day