Skip to content

Conversation

@etwoo
Copy link
Contributor

@etwoo etwoo commented Aug 23, 2025

In my usage, infer run fails with a non-zero exit code even after I have suppressed all issues in my C project with @infer-ignore comments (along with appropriate .inferconfig settings).

I tracked this down to how fail_on_issue_epilogue() maps presence/absence of issues to the overall process exit code. The fix in this PR is to make Infer only return a non-zero exit code if one or more unsuppressed issues exist. In other words, Infer should treat a suppressed issue as equivalent to an entirely non-existent issue, for the purposes of the overall infer run exit code.

Please let me know if there are backwards-compatibility concerns that would require this behavior to be gated by an opt-in CLI argument. I am hoping it is acceptable to change the default behavior in this manner, in order to follow the principle of least surprise for people (like myself) using Infer in their CI pipelines.

I've added a test for this behavior, based on the existing fail_on_issue testcase. I hope the latter is an acceptable template for a new test; please let me know if a different testcase would make for a better starting point.

@martintrojer
Copy link
Contributor

@etwoo can you please rebase (to improve the ci signal somewhat)?

Infer should only return a non-zero exit code if one or more issues
exist with suppressed == false. In other words, Infer should treat a
suppressed issue as equivalent to an entirely non-existent issue, for
the purposes of the overall `infer run` exit code.
@etwoo etwoo force-pushed the bugfix/suppressed-issues-exit-code branch from 0ed4eb0 to aece004 Compare September 16, 2025 10:25
@etwoo
Copy link
Contributor Author

etwoo commented Sep 16, 2025

@etwoo can you please rebase (to improve the ci signal somewhat)?

@martintrojer : I've rebased the bugfix branch onto HEAD of main, 057c0af.

@facebook-github-bot
Copy link
Contributor

@martintrojer has imported this pull request. If you are a Meta employee, you can view this in D82616342.

@facebook-github-bot
Copy link
Contributor

@martintrojer merged this pull request in 16790f5.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants