Skip to content

Commit

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

* Refs #20542: Fix CMake version in sanitizer workflows

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20542: Install correct version of Gtest

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

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

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

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20542: Fix asan_colcon.meta

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20542: Use CCache also for ASan DS

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 0c439a0)
Signed-off-by: EduPonz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Mar 16, 2024
1 parent fa2c790 commit 13902cb
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 46 deletions.
18 changes: 0 additions & 18 deletions .github/actions/install-apt-packages/action.yml

This file was deleted.

51 changes: 35 additions & 16 deletions .github/workflows/address-sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@ jobs:
FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || '2.12.x' }}

steps:
- name: Install wget
# 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: wget
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,13 +81,12 @@ jobs:
cd ./src/fastrtps
git checkout ${{ env.FASTDDS_BRANCH }}
- name: Install apt packages
uses: ./src/fastrtps/.github/actions/install-apt-packages

- 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 @@ -126,10 +134,22 @@ jobs:
DEFAULT_DISCOVERY_SERVER_BRANCH: ${{ github.event.inputs.discovery_server_branch || 'v1.2.2' }}

steps:
- name: Install wget
# 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: wget
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 @@ -165,13 +185,12 @@ jobs:
repository: eProsima/Discovery-Server
ref: ${{ env.DEFAULT_DISCOVERY_SERVER_BRANCH }}

- name: Install apt packages
uses: ./src/fastrtps/.github/actions/install-apt-packages

- 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"
7 changes: 6 additions & 1 deletion .github/workflows/config/tsan_colcon.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
names:
fastcdr:
cmake-args:
- "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'",
- "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'"
- "-DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'"
fastrtps:
cmake-args:
Expand All @@ -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.20.6'

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.20.6'

Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/thread-sanitizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,19 @@ jobs:
CXX: g++-12

steps:
- name: Install wget
# 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: wget
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,13 +91,12 @@ jobs:
cd ./src/fastrtps
git checkout ${{ env.FASTDDS_BRANCH }}
- name: Install apt packages
uses: ./src/fastrtps/.github/actions/install-apt-packages

- 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 13902cb

Please sign in to comment.