Rust codegen: generateEmptySourcesIfNeeded omits empty Rust outputs when nativeLanguage == .rust
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 86/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- build-system
调研方向
从compiler/compiler/Compiler/Sources/Processors/CombineNativeSourcesProcessor.swift开始,阅读generateEmptySourcesIfNeeded,并沿着现有的makeEmptySource调用和hasRust检查进行跟进。针对.rs、_ffi.h、_rust_link_apple.params和_rust_link_elf.params,添加issue中描述的Rust空输出分支;当没有导出原生声明的Rust模块生成全部四个已声明的Bazel输出时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Found while reviewing https://github.com/Snapchat/Valdi/pull/211 (native Rust code generation). Not blocking that PR.
generateEmptySourcesIfNeeded omits empty Rust outputs when nativeLanguage == .rust
File: compiler/compiler/Compiler/Sources/Processors/CombineNativeSourcesProcessor.swift
When a valdi_module sets native_language = "rust" and defines no @ExportModel, @ExportEnum, @ExportModule, @ExportFunction, or @ExportProxy declarations, Bazel fails the build with missing declared outputs. CombineNativeSourcesProcessor.generateEmptySourcesIfNeeded now restricts its empty C++ fallback to bundle.nativeLanguage == .cpp and does not emit empty Rust outputs.
Because valdi_compiled.bzl unconditionally declares <name>.rs, <name>_ffi.h, <name>_rust_link_apple.params, and <name>_rust_link_elf.params whenever emit_release is true and passes --only-generate-native-code-for-module, any Rust-enabled module without exported native symbols produces none of those four files.
Add an else if bundle.cppCodegenEnabled && bundle.nativeLanguage == .rust && !hasRust branch in generateEmptySourcesIfNeeded that calls makeEmptySource for .rs, _ffi.h, _rust_link_apple.params, and _rust_link_elf.params.
- 主要语言
- 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
-
Bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
bot-triaged enhancement module: fft triaged
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
-
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 天内回复