GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refs #12358 - CI-unixish.yml: added step which checks for AST and ValueFlow changes by firewave · Pull Request #7800 · cppcheck-opensource/cppcheck

Conversation

@firewave

@firewave firewave commented Sep 6, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@firewave
firewave force-pushed the selfcheck-out branch from 53bbd97 to d03a4c5 Compare September 6, 2025 14:53
@firewave

firewave commented Sep 6, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

Since simplecpp.cpp is standalone and not too small it makes for a good file to run on. It does not contain much modern code at the moment but I still think this makes for a nice smoketest for the AST and ValueFlow internals we usually only verify by the way the findings change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave force-pushed the selfcheck-out branch from d03a4c5 to 4e0fe3e Compare September 8, 2025 07:55
@firewave firewave mentioned this pull request Sep 8, 2025
do not set values if there is no expression #7295
Merged
@firewave
firewave force-pushed the selfcheck-out branch from 4e0fe3e to b7514bd Compare September 8, 2025 08:57
@firewave
firewave marked this pull request as ready for review September 8, 2025 08:57
@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2025

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave firewave mentioned this pull request Sep 8, 2025
fix #13714: only the first unused templated function is not being checked with --no-check-unused-templates #7802
Merged
@ludviggunne ludviggunne mentioned this pull request Sep 10, 2025
fix #14117: --no-check-unused-templates does not apply to templated functions with declaration specifiers #7811
Draft
danmar
danmar reviewed Sep 10, 2025
View reviewed changes

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I spontanously don't have a good feeling about this. such golden files are not easy to maintain. so if we fix various tokenizer, ast and valueflow problems we will potentially have to update the golden file even though nothing is wrong. We will not spot problems that exist in such big data.

Write tests that check if we do the right thing and don't need constant maintenance..

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@firewave

firewave commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator Author

I understand that but we need something like this. The test coverage is not enough and this makes e.f. ValueFlow optimization work safer. I had several cases where the output didn't change but it is was actually totally wrong. We need to catch such things before going in daca. And it might not even manifest in there.

I chose simplecpp since it is just a single file. So there is no need to manually edit files but just pull the newer version from the CI and overwrite it.

I wanted to maintain this externally but that will most certainly bitrot if it is not tied to the build.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 11, 2025
Fix #14134 Hang in valueFlowSymbolic() caused by unrelated template #7814
Merged
refs #13698 - exit early in Library::detect*() if token is a keyword #7820
Merged
ProgramMemory: avoid duplicated lookups / removed at() #7768
Open
@firewave

firewave commented Sep 15, 2025

Copy link
Copy Markdown
Collaborator Author

See #7768 (comment) for a case where this found a subtle bug I would have introduced.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 15, 2025
introduced a cache for followAllReferences() calls #7192
Merged
Fix 13930: False positive: valueflow and other variable #7827
Merged
@danmar

danmar commented Sep 23, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

See #7768 (comment) for a case where this found a subtle bug I would have introduced.

I fear that there is a lot of flux in the cppcheck repo and while the intention is good it inevitably introduces bugs.

In that PR the bug was found because you looked carefully at the diff. If we just copy the golden file without looking at it then it does not help but is only in the way.

Can you implement this test somehow else. Maybe generate selfcheck.exp automatically based on cppcheck git head or whatever the PR target branch is. how about just showing the diff in a PR comment so it can be resolved/dismissed..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danmar

danmar commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

I wanted to maintain this externally but that will most certainly bitrot if it is not tied to the build.

that sounds somewhat interesting imho. I am not sure if bitrot has to be a problem. we could write a script that will compile and run cppcheck on every commit in the git log for last X days and then shows some report about which commits change the output..

This report could be generated in a nightly build.

but would anybody look at the report then?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave

firewave commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator Author

Spoiler alert: I start to ramble in the later part of this comment because those realization just started coming in and I didn't feel like re-doing the whole post. Sorry about that.

Can you implement this test somehow else. Maybe generate selfcheck.exp automatically based on cppcheck git head or whatever the PR target branch is. how about just showing the diff in a PR comment so it can be resolved/dismissed..

The problem is that you need some kind of baseline. That means you need to build and run the previous version to generate that. We could store the binary and/or the output and pull that but I do want that dependency from a workflow into a previously build job (it might also not be reliable - we had issues with that within the same workflow in the same build). It would also increase the runtime and complexity of workflow if we have to pull and build the current version is it based off (and that also needs to consider branches and fork - maybe even more).

I thought about doing this as scheduled job (like IWYU or CSA) but that was with a much bigger scope (simplecpp is a more nicer contained example to use). That still would require the generation of the baseline and it would only be triggered periodically. And scheduling it off on each PR felt too disjoint and might only accumulate reports nobody even wants to check (see Coverity). The scheduled CSA is already piling up findings (it is only scheduled because it is too slow). IWYU is separate because it still has too many false positives (in simplecpp I was able to enable misc-include-cleaner from clang-tidy as it has a much smaller and manageable scope). And if those changes were made by one-off contributors those things might never be fixed because don't even know what the intended behavior is supposed to be.

I also thought about showing it as a comment instead without failing the build (IWYU does that) but that still doesn't solve the baseline. And not failing the build or having it disjoint will

I see it just like the results of any other test. If I change the output I need to adjust tests. I also feel this would make some things easier to track.

And I just realized that fail the builds on linting stuff like formatting. That has no impact on the behavior and we require immediate mitigation. You could argue that we just do a clean up step when the release is done - but since it is enforced in the CI we don't have to. It is kind of similar to the translations files - that should be kept in line so they are actually correct. But we have it disabled since there is currently too much noise from unrelated changes. That does not apply in this case since you only need to adjust the file if you actually did something to the ValueFlow. It does not just change because you fixed a random bug.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave

firewave commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator Author

It could also help to expose gaps in the unit tests. The issue it found in the changes I did was not caught by those but unfortunately I was not able to reduce it into a test (yet - I will give it another try). Having that test might have helped to determine if the changes in #7827 accidentally introduced the same "issue" (I raised that but it was not acknowledged at all).

That would be preferable to get it to the customer/daca, check the validity, reduce the example and bail it down to an unintentional ValueFlow change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danmar

danmar commented Oct 1, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

I fear this will not be a practical test for us.

  • I don't like huge golden file tests. My experience with golden files is that we will not care about the diffs. it will only require extra maintenance people will overwrite the exp.. and nobody will look at the diffs.
  • I want that no maintenance is required the exp should be generated. It should be possible using ${{ github.base_ref }} to generate it.

one more thing I think is extra maintenance is the ts files: the updates of the ts files is a pain. I feel it should be fixed. If I build the gui with qt creator then the ts files are modified.. then I make some fix in cppcheck unrelated to the gui.. and then I commit.. now I have ts artifacts to cleanup.. it worked great before when I generated them during the releases.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave

firewave commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator Author

The translation files will only change when you change the GUI and that is expected. This is no different from the Makefile or any other test output.

You could argue that there is no need to update any tests, fix crashes, false positives/negatives or build failures and just defer that to when you are about to release or when you decide that ti is important to do so.

An additional git commit is no hassle at all and it prevents from collecting technical debt or bugs over time.

Take a look at the amount of changes the files has accumulated since September and you see that is not much. But there is no way to tell if any of those changes are intentional or what caused them. If we would have added that step it would be clearer.

The caching I am currently looking at is also introducing subtle differences which are not covered by the unit tests and are only detected as potential issues in drive-by tests like the selfcheck or taking a closer look at the function calls in the profiler.

This would also lead to more tests which will lead to much better coverage and less bugs being introduced in the future.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave force-pushed the selfcheck-out branch from b7514bd to f7cf213 Compare January 21, 2026 19:35
This was referenced Jan 21, 2026
refs #10765/#11262 - Token: introduced cache for isMutableExpression() calls #8145
Merged
refs #10765/#11262 - Token: introduced cache for isAliasOf() calls #8138
Draft
@danmar

danmar commented Jan 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Can the golden file be stored somehow else not in the repo. It might as well be stored in the github cache right?
we could store just the crc checksum in the action.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave force-pushed the selfcheck-out branch from f7cf213 to ea3058e Compare February 13, 2026 09:01
@sonarqubecloud

sonarqubecloud Bot commented Feb 13, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave firewave mentioned this pull request Feb 13, 2026
ValueFlow: avoid various unnecessary copies #8207
Merged
@firewave

firewave commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator Author

Can the golden file be stored somehow else not in the repo. It might as well be stored in the github cache right? we could store just the crc checksum in the action.

That would defeat the purpose of also documenting the changes the tests did not catch. Also the caches on GitHub have been essentially broken for months now because runs are no longer in sequential order if multiple merged PRs queue builds (I think that's the reason why the scriptcheck action sometimes no longer finds its previously cached binary).

I really need to report this upstream - I saw this called out in a news article as one of the reasons why someone switched to Codeberg.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danmar
danmar previously approved these changes Feb 14, 2026
View reviewed changes

@danmar danmar left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

alright lets see how it goes. I am not entirely positive.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@firewave
firewave dismissed danmar’s stale review via 89ab402 May 2, 2026 04:38
@firewave
firewave force-pushed the selfcheck-out branch from ea3058e to 89ab402 Compare May 2, 2026 04:38
@firewave
firewave force-pushed the selfcheck-out branch from 89ab402 to 4da5259 Compare May 26, 2026 12:13
danmar
danmar approved these changes Jun 2, 2026
View reviewed changes
@firewave
firewave marked this pull request as draft June 2, 2026 10:08
@firewave

firewave commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator Author

Nice. Thanks.

Needs to be rebased first. Will also wait for some of the in-flight PRs to be merged to avoid breakage.

In a perfect world I would go back and try to bisect all of the changes so they can be attributed to specific commits. I might still do that for the more recent ones.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

firewave added 5 commits June 5, 2026 16:59
@firewave
refs #12358 - CI-unixish.yml: added step which checks for AST and Val…
0ce2bb1
…ueFlow changes
@firewave
updated selfcheck.exp [skip ci]
0105306
@firewave
updated selfcheck.exp [skip ci]
ccd2689
@firewave
updated selfcheck.exp [skip ci]
9622cd8
@firewave
updated selfcheck.exp [skip ci]
01828fc
@firewave
firewave force-pushed the selfcheck-out branch from 4da5259 to 01828fc Compare June 5, 2026 15:02
@firewave

firewave commented Jun 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

Maybe let's start with it in simplecpp as that sees less changes: cppcheck-opensource/simplecpp#533

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@danmar danmar danmar approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@firewave @danmar
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.