diff --git a/.github/workflows/pkg-config.yaml b/.github/workflows/pkg-config.yaml index d9da189d..0739c8b0 100644 --- a/.github/workflows/pkg-config.yaml +++ b/.github/workflows/pkg-config.yaml @@ -39,7 +39,7 @@ jobs: run: make --file=Makefile.pkg-config PREFIX=${PREFIX} install - name: Build the client/server examples - run: PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig make --file=Makefile.pkg-config + run: PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig make --file=Makefile.pkg-config PROFILE=debug - name: Verify client is dynamically linked run: LD_LIBRARY_PATH=$PREFIX/lib ldd target/client | grep "rustls" @@ -48,4 +48,4 @@ jobs: run: LD_LIBRARY_PATH=$PREFIX/lib ldd target/server | grep "rustls" - name: Run the integration tests - run: LD_LIBRARY_PATH=$PREFIX/lib make --file=Makefile.pkg-config integration + run: LD_LIBRARY_PATH=$PREFIX/lib make --file=Makefile.pkg-config PROFILE=debug integration diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 11916543..a637bb72 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,9 +43,23 @@ jobs: toolchain: ${{ matrix.rust }} - env: CARGO_UNSTABLE_HTTP_REGISTRY: true - run: make CC=${{ matrix.cc }} PROFILE=release test integration + run: make CC=${{ matrix.cc }} PROFILE=debug test integration - name: Platform verifier connect test - run: make connect-test + run: make PROFILE=debug connect-test + - name: Verify debug builds were using ASAN + if: runner.os == 'Linux' # For 'nm' + run: | + nm target/client | grep '__asan_init' + nm target/server | grep '__asan_init' + - name: Build release binaries + run: | + make clean + make CC=${{ matrix.cc }} PROFILE=release + - name: Verify release builds were not using ASAN + if: runner.os == 'Linux' # For 'nm' + run: | + nm target/client | grep -v '__asan_init' + nm target/server | grep -v '__asan_init' valgrind: name: Valgrind @@ -56,7 +70,7 @@ jobs: persist-credentials: false - name: Install valgrind run: sudo apt-get update && sudo apt-get install -y valgrind - - run: VALGRIND=valgrind make test integration + - run: VALGRIND=valgrind make PROFILE=release test integration test-windows-cmake-debug: name: Windows CMake, Debug configuration diff --git a/Makefile b/Makefile index ff399ff3..08ec59c8 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,9 @@ CFLAGS := -Werror -Wall -Wextra -Wpedantic -g -I src/ PROFILE := release DESTDIR=/usr/local -ifeq ($(CC), clang) +ifeq ($(PROFILE), debug) CFLAGS += -fsanitize=address -fsanitize=undefined - LDFLAGS += -fsanitize=address + LDFLAGS += -fsanitize=address -fsanitize=undefined endif ifeq ($(PROFILE), release) diff --git a/Makefile.pkg-config b/Makefile.pkg-config index 14e15cbd..bfdcd3bf 100644 --- a/Makefile.pkg-config +++ b/Makefile.pkg-config @@ -15,9 +15,9 @@ CFLAGS := -Werror -Wall -Wextra -Wpedantic -g -I src/ PROFILE := release PREFIX=/usr/local -ifeq ($(CC), clang) +ifeq ($(PROFILE), debug) CFLAGS += -fsanitize=address -fsanitize=undefined - LDFLAGS += -fsanitize=address + LDFLAGS += -fsanitize=address -fsanitize=undefined endif ifeq ($(PROFILE), release)