From 4ac5f708142d67853fad5515ae8c0e4c78422992 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Fri, 15 Mar 2024 18:03:03 +0100 Subject: [PATCH] [20542] Pin CMake version and vm.mmap_rnd_bits in sanitizer workflows (#4558) * Refs #20542: Fix CMake version in sanitizer workflows Signed-off-by: EduPonz * Refs #20542: Install correct version of Gtest Signed-off-by: EduPonz * fixup! Refs #20542: Fix CMake version in sanitizer workflows * Refs #20542: Set number of random bits for mmap to 28 Signed-off-by: EduPonz * Refs #20542: Fix asan_colcon.meta Signed-off-by: EduPonz * Refs #20542: Use CCache also for ASan DS Signed-off-by: EduPonz --------- Signed-off-by: EduPonz (cherry picked from commit 0c439a09a7a74c84976747ddc06ccce2fcbeebe6) # Conflicts: # .github/workflows/address-sanitizers.yaml # .github/workflows/config/asan_colcon.meta # .github/workflows/thread-sanitizer.yaml --- .github/workflows/address-sanitizers.yaml | 35 +++++++++++++++++++++-- .github/workflows/config/asan.repos | 5 ++++ .github/workflows/config/asan_colcon.meta | 9 ++++++ .github/workflows/config/tsan_colcon.meta | 5 ++++ .github/workflows/reusable-mac-ci.yml | 2 +- .github/workflows/reusable-ubuntu-ci.yml | 2 +- .github/workflows/reusable-windows-ci.yml | 2 +- .github/workflows/thread-sanitizer.yaml | 23 +++++++++++++-- 8 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/config/asan.repos diff --git a/.github/workflows/address-sanitizers.yaml b/.github/workflows/address-sanitizers.yaml index 9d9663a4313..ab577309282 100644 --- a/.github/workflows/address-sanitizers.yaml +++ b/.github/workflows/address-sanitizers.yaml @@ -19,6 +19,12 @@ on: - '**.md' - '**.txt' - '!**/CMakeLists.txt' +<<<<<<< HEAD +======= + + schedule: + - cron: '0 1 * * *' +>>>>>>> 0c439a09a ([20542] Pin CMake version and vm.mmap_rnd_bits in sanitizer workflows (#4558)) concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -37,11 +43,20 @@ jobs: FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || '2.6.x' }} steps: + # https://github.com/actions/runner-images/issues/9491 + - name: Fix kernel mmap rnd bits + run: sudo sysctl vm.mmap_rnd_bits=28 + - name: Install apt packages uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 @@ -72,10 +87,12 @@ jobs: cd ./src/fastrtps git checkout ${{ env.FASTDDS_BRANCH }} - - name: Install GTest - uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0 + - name: Fetch Fast DDS ASan dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - version: v1.12.1 + vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan.repos + destination_workspace: src + skip_existing: 'true' - name: Build workspace run: | @@ -123,11 +140,23 @@ jobs: DEFAULT_DISCOVERY_SERVER_BRANCH: ${{ github.event.inputs.discovery_server_branch || 'v1.2.1' }} steps: + # https://github.com/actions/runner-images/issues/9491 + - name: Fix kernel mmap rnd bits + run: sudo sysctl vm.mmap_rnd_bits=28 + - name: Install apt packages uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + - name: Install colcon uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 diff --git a/.github/workflows/config/asan.repos b/.github/workflows/config/asan.repos new file mode 100644 index 00000000000..78eb1aa1ac4 --- /dev/null +++ b/.github/workflows/config/asan.repos @@ -0,0 +1,5 @@ +repositories: + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.12.1 diff --git a/.github/workflows/config/asan_colcon.meta b/.github/workflows/config/asan_colcon.meta index f3861032c74..a3806a59646 100644 --- a/.github/workflows/config/asan_colcon.meta +++ b/.github/workflows/config/asan_colcon.meta @@ -17,3 +17,12 @@ names: cmake-args: - "-DCMAKE_BUILD_TYPE=Debug" - "-DSANITIZER=Address" +<<<<<<< HEAD +======= + googletest-distribution: + cmake-args: + - "-Dgtest_force_shared_crt=ON" + - "-DBUILD_SHARED_LIBS=ON" + - "-DBUILD_GMOCK=ON" + +>>>>>>> 0c439a09a ([20542] Pin CMake version and vm.mmap_rnd_bits in sanitizer workflows (#4558)) diff --git a/.github/workflows/config/tsan_colcon.meta b/.github/workflows/config/tsan_colcon.meta index bfecf695cbe..fe81d592e79 100644 --- a/.github/workflows/config/tsan_colcon.meta +++ b/.github/workflows/config/tsan_colcon.meta @@ -17,3 +17,8 @@ names: - "-DFASTDDS_STATISTICS=ON" - "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'" - "-DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'" + googletest-distribution: + cmake-args: + - "-Dgtest_force_shared_crt=ON" + - "-DBUILD_SHARED_LIBS=ON" + - "-DBUILD_GMOCK=ON" diff --git a/.github/workflows/reusable-mac-ci.yml b/.github/workflows/reusable-mac-ci.yml index e3c7196ded3..2ae6ca53761 100644 --- a/.github/workflows/reusable-mac-ci.yml +++ b/.github/workflows/reusable-mac-ci.yml @@ -55,7 +55,7 @@ jobs: python-version: '3.11' - name: Get minimum supported version of CMake - uses: lukka/get-cmake@latest + uses: eProsima/eProsima-CI/external/get-cmake@v0 with: cmakeVersion: '3.16.3' diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index a02f9021888..2e50568f863 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -49,7 +49,7 @@ jobs: ref: ${{ inputs.fastdds-branch }} - name: Get minimum supported version of CMake - uses: lukka/get-cmake@latest + uses: eProsima/eProsima-CI/external/get-cmake@v0 with: cmakeVersion: '3.16.3' diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index bb6fed4e9e7..d5272f2a6ab 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -49,7 +49,7 @@ jobs: ref: ${{ inputs.fastdds_branch }} - name: Get minimum supported version of CMake - uses: lukka/get-cmake@latest + uses: eProsima/eProsima-CI/external/get-cmake@v0 with: cmakeVersion: '3.16.6' diff --git a/.github/workflows/thread-sanitizer.yaml b/.github/workflows/thread-sanitizer.yaml index df1502bae72..70f94f9d8e5 100644 --- a/.github/workflows/thread-sanitizer.yaml +++ b/.github/workflows/thread-sanitizer.yaml @@ -23,6 +23,12 @@ on: - '**.txt' - '!**/CMakeLists.txt' +<<<<<<< HEAD +======= + schedule: + - cron: '0 1 * * *' + +>>>>>>> 0c439a09a ([20542] Pin CMake version and vm.mmap_rnd_bits in sanitizer workflows (#4558)) concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -47,11 +53,20 @@ jobs: CXX: g++-12 steps: + # https://github.com/actions/runner-images/issues/9491 + - name: Fix kernel mmap rnd bits + run: sudo sysctl vm.mmap_rnd_bits=28 + - name: Install apt packages uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 @@ -82,10 +97,12 @@ jobs: cd ./src/fastrtps git checkout ${{ env.FASTDDS_BRANCH }} - - name: Install GTest - uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0 + - name: Fetch Fast DDS CI dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - version: release-1.11.0 + vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos + destination_workspace: src + skip_existing: 'true' - name: Build workspace run: |