fix: include C++ sources in program MD5 - #1011
Draft
manux81 wants to merge 1 commit into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
c_blocks.handc_blocks_code.cppsources in the program MD5 whenever the project contains C/C++ POUs.MD5(program.st)behavior for projects without C/C++ POUs.Why this is necessary
C/C++ POU bodies are extracted into the
originalCppPoussidecar before Structured Text transpilation. The transpiler replaces each C/C++ body with an ST bridge, while the actual user-authored code is generated separately asc_blocks_code.cpp.The pipeline previously calculated the MD5 from
program.stonly. As a result, changing only the C/C++ implementation while leaving the POU interface unchanged produced the sameprogram.stand therefore the same MD5. The compiled program could change without the runtime/debugger digest reflecting that change, defeating stale-program detection.Hashing the actual generated C/C++ sidecars together with
program.stensures every compiled user-program source contributes to the digest.Impact
PROGRAM_MD5.Validation
program.stcontent.npm test -- --runInBand --coverage=false src/backend/shared/compile/__tests__/pipeline.test.ts— 54 tests passed.git diff --checkpassed.