Skip to content

Conversation

@not-matthias
Copy link
Member

  • Fixed build on MUSL targets (added compat.h header)
  • Using zig cc compiler (based on clang) to easily cross-compile

Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

This doesn't totally match what we want.
We need to check the build of this library against multiple compilers: clang, GCC, and a few of their versions. I think using zig cc instead of those compilers is a big discrepancy with what happens in the consumers
Checking against multiple targets is interesting, though, and a good first step. However, if that becomes a blocker to support those with the compilers, we should prioritize checking aarch64 and x86_64.

To use newer versions of GCC and clang, you can use the Docker images and the GitHub actions integration:
https://hub.docker.com/_/gcc

Didn't find anything for clang/LLVM, but I guess we can find something

Copy link
Member

art049 commented Oct 14, 2025

Actually for clang/llvm: https://hub.docker.com/r/silkeh/clang
Edit: this might also be of interest https://apt.llvm.org/

@not-matthias not-matthias force-pushed the cod-1495-add-regression-tests-for-instrument-hooks branch 4 times, most recently from 760b81b to 77c1ad3 Compare October 15, 2025 13:03
@not-matthias
Copy link
Member Author

@art049 Added compilation tests of the C example using clang+gcc with the docker images you linked. Works quite well.

Also disabled the mandb to make the tests with valgrind a bit faster.

@not-matthias not-matthias requested a review from art049 October 15, 2025 13:20
Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

Looking much better!

            -Wno-builtin-declaration-mismatch \
            -Werror \
            -Wno-incompatible-library-redeclaration \
            -Werror \

Is it expected to have different flags for each compiler? It might complicate each integration if we have to conditionnaly swp flags.
In this workflow we could just have a var INSTRUMENT_HOOKS_CFLAGS

@not-matthias not-matthias force-pushed the cod-1495-add-regression-tests-for-instrument-hooks branch 2 times, most recently from 9f90f1b to 505dbda Compare October 15, 2025 14:29
@not-matthias
Copy link
Member Author

not-matthias commented Oct 15, 2025

Looking much better!

            -Wno-builtin-declaration-mismatch \
            -Werror \
            -Wno-incompatible-library-redeclaration \
            -Werror \

Is it expected to have different flags for each compiler? It might complicate each integration if we have to conditionnaly swp flags. In this workflow we could just have a var INSTRUMENT_HOOKS_CFLAGS

The reason we had this, was because clang and gcc have different errors/flags. But I realized that we could remove the root issue (passing the wrong types to printf) to solve this.

Now we only get an error in clang about the format string security which can be ignored. I also added it to GCC to be sure it works (but we don't need it).

EDIT: Also enabled -Wall to catch more warnings that would also be exposed in the integrations. This way we can whitelist them manually.

@not-matthias not-matthias force-pushed the cod-1495-add-regression-tests-for-instrument-hooks branch 7 times, most recently from 7d627d7 to e5b3064 Compare October 15, 2025 15:13
@not-matthias not-matthias requested a review from art049 October 15, 2025 15:24
@not-matthias not-matthias force-pushed the cod-1495-add-regression-tests-for-instrument-hooks branch from e5b3064 to 8d979d7 Compare October 15, 2025 15:25
Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

we can group those in a global variable or a define to clearly state that these are the expected flags but otherwise lgtm

@not-matthias not-matthias force-pushed the cod-1495-add-regression-tests-for-instrument-hooks branch from 0ad3ac3 to 9916862 Compare October 17, 2025 08:51
@not-matthias not-matthias force-pushed the cod-1495-add-regression-tests-for-instrument-hooks branch from 9916862 to b260b17 Compare October 17, 2025 08:54
@not-matthias not-matthias merged commit b260b17 into main Oct 17, 2025
46 checks passed
@not-matthias not-matthias deleted the cod-1495-add-regression-tests-for-instrument-hooks branch October 17, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants