rv32emu icon indicating copy to clipboard operation
rv32emu copied to clipboard

Introduce Infer static analyzer to the CI pipeline

Open henrybear327 opened this issue 1 year ago • 6 comments

The Infer Docker Image in use is hosted on Docker Hub, which was built and pushed to sysprog21 by us since Infer's latest upstream release is very outdated at the time of writing.

The docker image size is around 470 MB, after numerous attempts to reduce its size from 3GB.

This PR also fixes issues reported by Infer. (The value written to &target_reg is never used.)

henrybear327 avatar Mar 11 '24 07:03 henrybear327

Skip Arm64 based host during static analysis.

I am unaware that the Arm64-based host will be run during the static analysis phase, as I didn't specify arch: aarch64. Or maybe I am mistaken?

henrybear327 avatar Mar 11 '24 07:03 henrybear327

The docker image size is around 470 MB, after numerous attempts to reduce its size from 3GB.

Can you rebuild Infer static analysis tool with -Os set? And then, strip the ELF files accordingly.

jserv avatar Mar 11 '24 08:03 jserv

The docker image size is around 470 MB, after numerous attempts to reduce its size from 3GB.

Can you rebuild Infer static analysis tool with -Os set? And then, strip the ELF files accordingly.

I can give this a try, but I have no guarantee on this.

henrybear327 avatar Mar 11 '24 08:03 henrybear327

If Clang scan-build already makes sense to CI, do we need Infer? Can you show the considerations?

jserv avatar Mar 11 '24 09:03 jserv

The build-infer.sh invokes autogen.sh, which generates GNU Automake style scripts. At the moment, only C and Python are required for static analysis.

Reference: The Growth of the OCaml Distribution

jserv avatar Mar 11 '24 09:03 jserv

The build-infer.sh invokes autogen.sh, which generates GNU Automake style scripts. At the moment, only C and Python are required for static analysis.

Reference: The Growth of the OCaml Distribution

The previous Docker Image contained only C and Python analysis capability, but now with the release build, Java is also included.

Based on prior experience, Java can be excluded by passing in parameters, but some changes to create_binary_release.sh will be required as I am now using create_binary_release.sh to build a standalone binary instead of invoking build-infer.sh directly like before.

henrybear327 avatar Mar 11 '24 09:03 henrybear327

The infer image pipeline broke recently (node11 now has strict internet bandwidth restrictions), and the effort to maintain an image is a bit cumbersome. Thus, closing this PR for now.

henrybear327 avatar May 21 '24 20:05 henrybear327