Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Valgrind and ASAN should by run with CMake #3995

Open
jmayclin opened this issue May 8, 2023 · 3 comments
Open

ci: Valgrind and ASAN should by run with CMake #3995

jmayclin opened this issue May 8, 2023 · 3 comments

Comments

@jmayclin
Copy link
Contributor

jmayclin commented May 8, 2023

Problem:

Valgrind and Asan CI jobs have more compiler warnings enabled, which results in the frustrating experience of a job succeeding locally, but failing in CI for compiler warnings.

Solution:

In this case, I would argue that the best approach is to just port the asan (and maybe the valgrind) job to cmake, which should make it significantly easier for developers to run them locally.

For this asan job we should enable the more pedantic warnings that the make files are currently using.

Requirements / Acceptance Criteria:

I should be able to easily verify on my local machine that my build won't fail for silly compiler warning reasons in CI.

Out of scope:

Any CI jobs that aren't valgrind and ASAN.

@jmayclin
Copy link
Contributor Author

jmayclin commented May 8, 2023

I'll also give my 2 cents that this should live in a toolchain file cmake/toolchains/sanitary.toolchain rather than the main CMakeLists.txt file. This minimizes bloat in the CMake file and should hopefully make the codebuild spec easier to read.

phases:
  build:
    on-failure: ABORT
    commands:
      - cmake . -Bbuild -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/sanitary.toolchain
      - cmake --build ./build -j $(nproc)
  post_build:
    on-failure: ABORT
    commands:
      - CTEST_PARALLEL_LEVEL=$(nproc) make -C build test

@jmayclin
Copy link
Contributor Author

jmayclin commented May 8, 2023

And yet another pile-on that we likely do not need to be running with different versions of the same compiler for these kinds of checks. Currently we run valgrind with gcc 6 and gcc 9, and it is not entirely clear why. We do not expect valgrind runs to have different results with different versions of the same compiler, and if there are differences it would be a bug in the compiler, not our code.

So we should cleanup the CI option matrix as part of this work.

@jmayclin
Copy link
Contributor Author

As part of this task, we should investigate whether the LD_PRELOAD allocator overrides can be removed. They are not used in the CMake unit tests.

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

No branches or pull requests

3 participants