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)

# Conflicts:
#	.github/workflows/address-sanitizers.yaml
#	.github/workflows/config/asan_colcon.meta
#	.github/workflows/thread-sanitizer.yaml
  • Loading branch information
EduPonz authored and mergify[bot] committed Mar 15, 2024
1 parent 24fbedc commit b433933
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 9 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/address-sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -37,11 +43,20 @@ jobs:
FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || '2.13.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 +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: |
Expand Down Expand Up @@ -123,11 +140,23 @@ jobs:
DEFAULT_DISCOVERY_SERVER_BRANCH: ${{ github.event.inputs.discovery_server_branch || 'v1.2.2' }}

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
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
9 changes: 9 additions & 0 deletions .github/workflows/config/asan_colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,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))
5 changes: 5 additions & 0 deletions .github/workflows/config/tsan_colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,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.22.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.22.6'

Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/thread-sanitizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit b433933

Please sign in to comment.