Skip to content

Commit

Permalink
Pin CMake version and vm.mmap_rnd_bits in sanitizer workflows (#4558) (
Browse files Browse the repository at this point in the history
…#4568)

* Refs #20542: Fix CMake version in sanitizer workflows



* Refs #20542: Install correct version of Gtest



* fixup! Refs #20542: Fix CMake version in sanitizer workflows

* Refs #20542: Set number of random bits for mmap to 28



* Refs #20542: Fix asan_colcon.meta



* Refs #20542: Use CCache also for ASan DS



---------


(cherry picked from commit 0c439a0)

Signed-off-by: EduPonz <[email protected]>
Co-authored-by: Eduardo Ponz Segrelles <[email protected]>
  • Loading branch information
mergify[bot] and EduPonz authored Mar 17, 2024
1 parent 98fb9a9 commit 4712005
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 12 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/address-sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,20 @@ jobs:
FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || '2.10.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

Expand Down Expand Up @@ -72,10 +81,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: |
Expand Down Expand Up @@ -123,11 +134,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

Expand Down Expand Up @@ -162,10 +185,12 @@ jobs:
repository: eProsima/Discovery-Server
ref: ${{ env.DEFAULT_DISCOVERY_SERVER_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: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/config/asan.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
googletest-distribution:
type: git
url: https://github.com/google/googletest.git
version: release-1.12.1
5 changes: 5 additions & 0 deletions .github/workflows/config/asan_colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ names:
cmake-args:
- "-DCMAKE_BUILD_TYPE=Debug"
- "-DSANITIZER=Address"
googletest-distribution:
cmake-args:
- "-Dgtest_force_shared_crt=ON"
- "-DBUILD_SHARED_LIBS=ON"
- "-DBUILD_GMOCK=ON"
5 changes: 5 additions & 0 deletions .github/workflows/config/tsan_colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion .github/workflows/reusable-mac-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.22.6'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/thread-sanitizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,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

Expand Down Expand Up @@ -82,10 +91,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: |
Expand Down

0 comments on commit 4712005

Please sign in to comment.