Skip to content

build: remove unused .zig codegen outputs#30915

Closed
springmin wants to merge 1 commit into
oven-sh:mainfrom
springmin:pr/codegen-cleanup
Closed

build: remove unused .zig codegen outputs#30915
springmin wants to merge 1 commit into
oven-sh:mainfrom
springmin:pr/codegen-cleanup

Conversation

@springmin
Copy link
Copy Markdown

The codegen system generates .zig files alongside the actually-used .rs/.cpp/.h files. These .zig files are legacy artifacts from the Zig era - they are no longer compiled or consumed. Removing them reduces codegen steps from 95 to 78.

The codegen system generates .zig files as legacy artifacts from the
Zig era. These files are no longer compiled or consumed by anything
(the Rust build uses .rs counterparts). Removing them reduces codegen
steps from 95 to 78 (-18%).

Removed outputs:
- ErrorCode.zig, ZigGeneratedClasses.zig
- cpp.zig (companion to cpp.rs)
- ci_info.zig (entire emitCiInfo step removed)
- ResolvedSourceTag.zig, GeneratedBindings.zig, GeneratedJS2Native.zig
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 27961ec3-d0a7-4694-9537-58365f9d2a3e

📥 Commits

Reviewing files that changed from the base of the PR and between 112f305 and 40e19b6.

📒 Files selected for processing (1)
  • scripts/build/codegen.ts

Walkthrough

scripts/build/codegen.ts removes legacy .zig codegen artifact declarations throughout the codebase. The exported zigFilesGeneratedIntoSrc constant and bindgenV2Zig field from CodegenOutputs are deleted, and all six code emitters stop declaring .zig outputs in their Ninja build steps. The main emitCodegen orchestration no longer invokes emitCiInfo.

Changes

Remove legacy Zig codegen artifacts

Layer / File(s) Summary
Public contract and exported artifacts
scripts/build/codegen.ts
Deleted the exported zigFilesGeneratedIntoSrc constant that previously listed Zig-side generated paths. Removed the bindgenV2Zig: string[] field from the public CodegenOutputs interface.
Codegen orchestration updates
scripts/build/codegen.ts
Updated emitCodegen to remove initialization of the now-deleted bindgenV2Zig field. Removed the emitCiInfo(ctx) invocation from the standard emission sequence.
Emitter implementations
scripts/build/codegen.ts
Updated emitErrorCode, emitGeneratedClasses, emitCppBind, emitJsModules, emitBindgenV2, and emitBindgen to remove .zig artifacts from Ninja build declarations and output bookkeeping, while preserving C++ headers and Rust source outputs.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete. While it explains what the PR does, it does not follow the required template structure with both 'What does this PR do?' and 'How did you verify your code works?' sections. Ensure the description follows the template by adding a 'How did you verify your code works?' section that documents the testing approach or verification method used.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'build: remove unused .zig codegen outputs' accurately and concisely summarizes the main change: removing legacy .zig files from the codegen system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@springmin
Copy link
Copy Markdown
Author

Closing — this fix has been incorporated into PR #30917 (feat: add initial HarmonyOS support), which contains all OHOS changes in a single cohesive PR.

@springmin
Copy link
Copy Markdown
Author

Superseded by #30917

@springmin springmin closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant