-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cdac-build-tool] Add baseline parsing and comparison support #121337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add --baseline-name option to ComposeCommand - Update Builder to accept optional baseline name override - Implement ParseBaseline to load and parse baseline JSON files - Add baseline comparison logic to output only differences from baseline - Cache JsonSerializerOptions to avoid creating new instances Co-authored-by: max-charlamb <[email protected]>
- Create test project for cdac-build-tool - Add tests for baseline name override feature - Add tests for empty baseline support - Update ParseBaseline to check baseline file content for empty status - Mark non-empty baseline parsing as TODO for future work Co-authored-by: max-charlamb <[email protected]>
- Add --baseline-name empty to cdac-build-tool invocation in CMakeLists - This allows overriding the baseline scraped from object files - Tested with successful CLR build Co-authored-by: max-charlamb <[email protected]>
- Include baseline name in error message for better debugging - Add comment explaining empty baseline behavior with null _baselineModel Co-authored-by: max-charlamb <[email protected]>
|
@copilot , the baseline name should not be passed in. It is found using the object being parsed by cdac-built-tool |
The baseline should be read from the scraped object file, not passed as a command line argument. Reverted changes that added the --baseline-name option and removed associated tests. Co-authored-by: max-charlamb <[email protected]>
You're right - I've removed the |
|
@copilot , now the changes are missing. We still want to use the baseline name to find the baseline json and create the datadescriptor json using the difference between the baseline and scrapped object file. |
- Add baseline file parsing for empty baselines (version 0) - Implement baseline comparison logic to compute differences - Add ComputeTypeDifferences, ComputeGlobalDifferences, and ComputeContractDifferences methods - Only differences from baseline are included in output JSON for compact representation - Baseline name is read from scraped object file as intended Co-authored-by: max-charlamb <[email protected]>
I've restored the baseline parsing and difference computation logic. The tool now:
For empty baselines (version 0), all data is included since there's nothing in the baseline to compare against. Committed in 234f4f1. |
Summary
This PR adds support for parsing baseline files and computing differences to generate compact JSON output for data contract descriptors.
Changes
Baseline processing
CDAC_BASELINEmacro)ParseBaseline()validates baseline files and loads empty baselines (version 0)ComputeTypeDifferences(),ComputeGlobalDifferences(), andComputeContractDifferences()How it works
-bflagUsage
# Baseline name comes from CDAC_BASELINE macro in the object file cdac-build-tool compose -b /path/to/baselines -i template.c.in -o output.c input.oTesting
Tested with existing object files - the tool correctly:
Note
Non-empty baseline parsing (version 1+) deferred to future work. Requires custom JSON converters for the compact array format (
"Field1": [0, "uint32"]). Current implementation supports empty baselines, which covers the initial workflow.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.