Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
okellogg committed Apr 28, 2024
2 parents 1f2eff4 + d52f544 commit 5713322
Show file tree
Hide file tree
Showing 1,377 changed files with 164,179 additions and 68,467 deletions.
78 changes: 0 additions & 78 deletions .azure/codecov.yml

This file was deleted.

16 changes: 11 additions & 5 deletions .azure/coverity-scan.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright(c) 2021 ADLINK Technology Limited and others
# Copyright(c) 2021 ZettaScale Technology and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -18,16 +18,17 @@ trigger: none
pr: none

schedules:
- cron: "0 12 * * 0"
- cron: "0 12 * * *"
branches:
include: [ master ]
always: false

strategy:
matrix:
'Ubuntu 20.04 LTS with GCC 10 (Debug, x86_64)':
'Ubuntu 20.04 LTS with Clang 10 (Debug, x86_64)':
image: ubuntu-20.04
cc: gcc-10
cc: clang
cxx: clang++

pool:
vmImage: $(image)
Expand Down Expand Up @@ -79,7 +80,7 @@ steps:
- bash: |
set -e -x
echo "###vso[task.setvariable variable=scan_build;]cov-build --dir $(pwd)/cov-int"
cov-configure --template --compiler ${CC} --comptype gcc
cov-configure --clang
name: configure_coverity
- template: /.azure/templates/build-test.yml
## Submit to Coverity Scan
Expand All @@ -100,3 +101,8 @@ steps:
name: submit_to_coverity_scan
env:
token: $(COVERITY_SCAN_TOKEN)
## Save Coverity build log for debugging
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: cov-int/build-log.txt
artifactName: 'coverity-build-log.txt'
163 changes: 132 additions & 31 deletions .azure/templates/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright(c) 2021 ADLINK Technology Limited and others
# Copyright(c) 2021 to 2022 ZettaScale Technology and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -19,6 +19,13 @@ steps:
inputs:
versionSpec: '3.8'
name: install_python
- bash: |
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
sudo sysctl vm.mmap_rnd_bits=28
condition: eq(variables['Agent.OS'], 'Linux')
name: fix_kernel_mmap_rnd_bits
# Set defaults from steps to share them among pipelines
- bash: |
[[ -n "${ARCH}" ]] || \
Expand All @@ -28,96 +35,190 @@ steps:
name: setup
- bash: |
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/.cache/pip"
echo "###vso[task.setvariable variable=conan_cache;]${HOME}/.conan/data"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
sudo apt-get install -y clang-tools clang-tidy
sudo apt install -y clang clang-tools clang-tidy
condition: eq(variables['Agent.OS'], 'Linux')
name: setup_linux
- bash: |
set -e -x
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/Library/Caches/pip"
echo "###vso[task.setvariable variable=conan_cache;]${HOME}/.conan/data"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
brew install bison
condition: eq(variables['Agent.OS'], 'Darwin')
name: setup_macos
# Use PowerShell rather than Bash to ensure Windows-style paths
- pwsh: |
$python_bin = python -m site --user-base
Write-Host "###vso[task.setvariable variable=pip_cache;]${env:LOCALAPPDATA}\\pip\\Cache"
Write-Host "###vso[task.setvariable variable=conan_cache;]${env:USERPROFILE}\\.conan\\data"
Write-Host "###vso[task.setvariable variable=PATH;]$python_bin\\bin;${env:PATH}"
# Visual Studio is most likely used on Windows agents
if (${env:GENERATOR} -match "2019" -and -not ${env:PLATFORM}) {
# Make sure platform matches arch if not specified
if (${env:ARCH} -match "arm*") {
Write-Host "###vso[task.setvariable variable=platform;]ARM"
} elseif (${env:ARCH} -eq "x86") {
Write-Host "###vso[task.setvariable variable=platform;]x86"
Write-Host "###vso[task.setvariable variable=platform;]Win32"
} else {
Write-Host "###vso[task.setvariable variable=platform;]x64"
}
}
Write-Host "###vso[task.setvariable variable=build_tool_options;]-nologo -verbosity:minimal -maxcpucount:4 -p:CL_MPCount=4"
choco install winflexbison3
if (${env:GENERATOR} -match "Visual Studio") {
Write-Host "###vso[task.setvariable variable=build_tool_options;]-nologo -verbosity:minimal -maxcpucount:4 -p:CL_MPCount=4"
} else {
Write-Host "###vso[task.setvariable variable=build_tool_options;]-j 4"
}
#choco install -y openssl
condition: eq(variables['Agent.OS'], 'Windows_NT')
name: setup_windows
- task: Cache@2
inputs:
key: pip | 2 | $(Agent.OS)
path: $(pip_cache)
name: cache_pip
- task: Cache@2
inputs:
key: conan | 3 | $(Agent.OS) | $(arch) | $(build_type)
path: $(conan_cache)
name: cache_conan
- bash: |
set -e -x
pip install conan --user
conan profile new default --detect
name: install_conan
python -m pip install pip wheel setuptools --user --upgrade
python -m pip install pre-commit --user --upgrade
pre-commit run --all-files
name: run_pre_commit
- bash: |
python -m pip install gcovr==5.0 --user --upgrade
name: install_gcovr
- bash: |
set -e -x
sudo apt install libacl1-dev libncurses5-dev pkg-config
git clone --depth 1 \
--branch "${ICEORYX_BRANCH:-release_2.0}" \
"${ICEORYX_REPOSITORY:-https://github.com/eclipse-iceoryx/iceoryx.git}" \
iceoryx
mkdir iceoryx/build
cd iceoryx/build
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_BUILD_SHARED_LIBS=${SHAREDLIBS:-on} \
-DCMAKE_INSTALL_PREFIX=install \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ../iceoryx_meta
cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
condition: eq(variables['iceoryx'], 'on')
name: install_iceoryx
- bash: |
set -e -x
mkdir build-sharedlibs
cd build-sharedlibs
cmake -DCMAKE_INSTALL_PREFIX=install \
-DWERROR=on \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ..
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
cmake --build . --config ${BUILD_TYPE} --target package -- ${BUILD_TOOL_OPTIONS}
condition: eq(variables['sharedlibs'], 'off')
name: nonstatic_build_script
- bash: |
set -e -x
mkdir build
cd build
conan install -b missing -s arch=${ARCH} -s build_type=${BUILD_TYPE} ../${CONANFILE:-conanfile.txt}
prefix_path="${BUILD_SOURCESDIRECTORY}/iceoryx/build/install"
if [[ "${AGENT_OS}" == 'Darwin' ]] ; then
prefix_path="${prefix_path}:`brew --prefix openssl`"
# Azure sometimes adds a spurious ' to BUILD_TOOL_OPTIONS
BUILD_TOOL_OPTIONS="-j 4"
fi
crosscompiling=
if [[ "${SHAREDLIBS:-on}" == "off" ]] ; then
prefix_path="${BUILD_SOURCESDIRECTORY}/build-sharedlibs/install:${prefix_path}"
crosscompiling="-DCMAKE_CROSSCOMPILING=1 -DCMAKE_SYSTEM_NAME=${AGENT_OS}"
fi
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH="${prefix_path//:/;}" \
-DBUILD_SHARED_LIBS=${SHAREDLIBS:-on} \
${crosscompiling} \
-DANALYZER=${ANALYZER:-off} \
-DSANITIZER=${SANITIZER:-none} \
-DENABLE_SSL=${SSL:-on} \
-DENABLE_SECURITY=${SECURITY:-on} \
-DENABLE_LIFESPAN=${LIFESPAN:-on} \
-DENABLE_DEADLINE_MISSED=${DEADLINE_MISSED:-on} \
-DSKIP_DEADLINE_UPDATE={DEADLINE_UPDATE_SKIP:-off} \
-DENABLE_TYPELIB=${TYPELIB:-on} \
-DENABLE_TYPE_DISCOVERY=${TYPE_DISCOVERY:-on} \
-DENABLE_TOPIC_DISCOVERY=${TOPIC_DISCOVERY:-on} \
-DENABLE_COVERAGE=${COVERAGE:-off} \
-DBUILD_TESTING=on \
-DENABLE_ICEORYX=${ICEORYX:-off} \
-DBUILD_TESTING=${TESTING:-on} \
-DBUILD_IDLC_XTESTS=${IDLC_XTESTS:-on} \
-DBUILD_EXAMPLES=on \
-DWERROR=on \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ..
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target package -- ${BUILD_TOOL_OPTIONS}
cmake --build . --config ${BUILD_TYPE} --target package -- ${BUILD_TOOL_OPTIONS}
name: script
- bash: |
set -e -x
cd build
ctest -j 4 --output-on-failure -T test -E '^CUnit_ddsrt_random_default_random$' -C ${BUILD_TYPE}
[[ "${BUILD_TYPE}" != 'Release' ]] || \
${SHELL} ../src/tools/ddsperf/sanity.bash
[[ "${SSL:-on}" != 'on' || "${SECURITY:-on}" != 'on' ]] || \
diff --strip-trailing-cr ../etc/cyclonedds.rnc docs/cyclonedds.rnc && \
diff --strip-trailing-cr ../etc/cyclonedds.xsd docs/cyclonedds.xsd && \
diff --strip-trailing-cr ../docs/manual/options.md docs/manual/options.md
[[ "${SANTIZIER:-none}" == 'none' ]] || \
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
ctest -j 4 --output-on-failure -T test -E '^CUnit_ddsrt_random_default_random$' -C ${BUILD_TYPE}
condition: ne(variables['testing'], 'off')
name: test
displayName: Test
- bash: |
set -e -x
cd build
${SHELL} ../src/tools/ddsperf/sanity.bash
condition: and(and(ne(variables['build_type'], 'Release'), ne(variables['testing'], 'off')), ne(variables['coverage'], 'on'))
name: sanity_ddsperf
displayName: Sanity check ddsperf
- bash: |
set -e -x
cd build
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
[[ "${SANITIZER:-none}" == 'none' ]] || \
export CFLAGS="-fsanitize=${SANITIZER}" LDFLAGS="-fsanitize=${SANITIZER}"
INSTALLPREFIX="$(pwd)/install"
mkdir helloworld
cd helloworld
cmake -DCMAKE_PREFIX_PATH="${INSTALLPREFIX}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
${GENERATOR:+-G} "${GENERATOR}" "${INSTALLPREFIX}/share/CycloneDDS/examples/helloworld"
name: test
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" "${INSTALLPREFIX}/share/CycloneDDS/examples/helloworld"
cmake --build . --config ${BUILD_TYPE} -- ${BUILD_TOOL_OPTIONS}
${SHELL} ../../scripts/sanity_helloworld.bash
condition: ne(variables['sharedlibs'], 'off')
name: sanity_hello_world
displayName: Sanity check Hello World
- bash: |
set -e -x
cd build
x=symbol_export_test
d=bin
[ -d bin/${BUILD_TYPE} ] && d=bin/${BUILD_TYPE}
test -e $d/symbol_export_test
[[ "${BUILD_TYPE}" == 'Release' ]] || [[ "${AGENT_OS}" == 'Windows_NT' ]] || \
${SHELL} ../scripts/check_symbol_export.bash $d/symbol_export_test
condition: eq(variables['testing'], 'off')
name: sanity_symbol_export
displayName: Sanity check export symbols
- bash: |
set -e -x
cd build
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
cmake --build . --config ${BUILD_TYPE} --target gcov -- ${BUILD_TOOL_OPTIONS}
gcovr --exclude '.*/tests/.*' --root "${BUILD_SOURCESDIRECTORY}" --json "$(System.DefaultWorkingDirectory)/coverage-$(Agent.JobName).json"
name: generate_code_coverage
displayName: Generate coverage artifact
condition: and(succeededOrFailed(), eq(variables['coverage'], 'on'))
- publish: $(System.DefaultWorkingDirectory)/coverage-$(Agent.JobName).json
artifact: coverage-$(Agent.JobName)
displayName: Publish coverage artifact
condition: and(succeededOrFailed(), eq(variables['coverage'], 'on'))
- task: PublishTestResults@2
inputs:
testRunTitle: $(Agent.JobName)
testRunner: CTest
testResultsFiles: '**/Test.xml'
searchFolder: $(System.DefaultWorkingDirectory)/build/Testing
platform: $(arch)
configuration: $(build_type)
name: publish_test_results
displayName: Publish test results
condition: and(succeededOrFailed(), or(ne(variables['testing'], 'off'), ne(variables['idlc_xtests'], 'off')))
Loading

0 comments on commit 5713322

Please sign in to comment.