Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20051] Fix redefinition of _wrap___eq__ (backport #73) #77

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 167 additions & 74 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,140 @@ name: test

on:
workflow_dispatch:
inputs:
foonathan_memory_vendor_branch:
description: 'foonathan_memory_vendor branch to be used'
required: false
default: 'master'
fastcdr_version:
description: 'Fast CDR branches to be used'
required: false
default: '1.1.x'
fastdds_branch:
description: 'Fast DDS branch to be used'
required: false
default: '2.6.x'
pull_request:
push:
branches:
- main
- 1.1.x
schedule:
- cron: '0 0 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
windows-build-test:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
foonathan_memory_vendor_version:
- ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
fastcdr_version:
- ${{ github.event.inputs.fastcdr_version || '1.1.x' }}
fastdds_version:
- ${{ github.event.inputs.fastdds_branch || '2.6.x' }}

env:
CXXFLAGS: /MP
OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64"

steps:

- name: install OpenSSL
- uses: eProsima/eProsima-CI/windows/install_openssl@v0

- name: Install Asio and TinyXML2
shell: pwsh
run: |
choco install openssl -yr --no-progress
"System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} `
| ls -Include libssl-*.dll | rm

- name: Install python build dependencies
mkdir "$pwdpath/choco_packages"
Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/asio.1.12.1.nupkg -OutFile "$pwdpath/choco_packages/asio.1.12.1.nupkg"
Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/tinyxml2.6.0.0.nupkg -OutFile "$pwdpath/choco_packages/tinyxml2.6.0.0.nupkg"
choco install -y -s "$pwdpath/choco_packages" asio tinyxml2
Set-Item -Force -Path "env:PATH" -Value "C:\ProgramData\chocolatey\lib\asio;C:\ProgramData\chocolatey\lib\tinyxml2;C:\ProgramData\chocolatey\lib\tinyxml2\lib;$env:PATH"
echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install swig
shell: pwsh
run: >
pip install -U colcon-common-extensions colcon-mixin vcstool;
run: choco install swig --allow-downgrade --version=4.0.2.04082020

- name: Install python tests dependencies
shell: pwsh
run: |
cd (ni -Type Directory -Path "$Env:TMP\$(New-Guid)")
$cr = "`n"
'cmake_minimum_required(VERSION 3.5)' + $cr +
'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr +
'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr +
'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' |
Out-File CMakeLists.txt
(cmake .) *>&1 | % {
if($_ -Match "cmake detected python=>>>>>(?<exec>.*)<<<<<<")
{
$python_exec = $Matches.exec
return
}
}
& $python_exec -m pip install -U pytest pywin32

- uses: actions/checkout@v2
- name: Setup Python version
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: pytest pywin32

- name: Install colcon
uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

- name: Checkout Fast DDS Python
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/fastdds_python

- name: Fetch repositories
- name: Checkout foonathan memory vendor
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/foonathan_memory_vendor
path: src/foonathan_memory_vendor
ref: ${{ matrix.foonathan_memory_vendor_version }}

- name: Checkout Fast CDR
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-CDR
path: src/fastcdr
ref: ${{ matrix.fastcdr_version }}

- name: Checkout Fast DDS
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-DDS
path: src/fastdds
ref: ${{ matrix.fastdds_version }}

- name: Setup CMake version
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: 3.22.6

- name: Setting ninja
id: ninja
if: github.event.schedule == ''
shell: pwsh
run: |
vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos
echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT

- name: Setup ccache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
with:
windows_compile_environment: msvc

- name: Build workspace
shell: pwsh
run: |
$installpath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
$modulepath = "$installpath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Import-Module $modulepath
Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath `
-DevCmdArguments '/arch=x64 /host_arch=x64';
$cargs = @("--event-handlers=console_direct+", `
"--metas", "./src/fastdds_python/.github/workflows/test.meta")
colcon build --executor parallel $cargs
uses: eProsima/eProsima-CI/windows/colcon_build@v0
with:
colcon_meta_file: ./src/fastdds_python/.github/workflows/test.meta
colcon_build_args: --executor parallel --mixin ccache ${{ steps.ninja.outputs.cmake_generator }}
colcon_build_args_default: --event-handlers console_direct+ desktop_notification-
cmake_build_type: RelWithDebInfo
cmake_args_default: ' '
workspace: ${{ github.workspace }}

- name: Run tests
shell: pwsh
run: |
colcon test --packages-select fastdds_python --event-handlers=console_direct+ `
--return-code-on-test-failure --ctest-args --timeout 60
id: test
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
with:
colcon_test_args: --packages-select fastdds_python --return-code-on-test-failure
colcon_test_args_default: --event-handlers console_direct+ desktop_notification-
ctest_args_default: --timeout 60
workspace: ${{ github.workspace }}
workspace_dependencies: ${{ github.workspace }}

- name: Upload Logs
uses: actions/upload-artifact@v1
Expand All @@ -85,46 +145,79 @@ jobs:
if: always()

ubuntu-build-test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
foonathan_memory_vendor_version:
- ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
fastcdr_version:
- ${{ github.event.inputs.fastcdr_version || '1.1.x' }}
fastdds_version:
- ${{ github.event.inputs.fastdds_branch || '2.6.x' }}


steps:
- uses: actions/checkout@v2
- name: Checkout Fast DDS Python
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/fastdds_python

- name: Install apt dependencies
run: |
sudo apt update
sudo apt install -y \
python3 \
python3-pip \
swig \
libpython3-dev

- name: Install python dependencies
run: |
sudo pip3 install -U \
vcstool \
colcon-common-extensions
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev libpython3-dev swig

- name: Fetch repositories
run: |
vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos
- name: Install colcon
uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

- name: Checkout foonathan memory vendor
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/foonathan_memory_vendor
path: src/foonathan_memory_vendor
ref: ${{ matrix.foonathan_memory_vendor_version }}

- name: Checkout Fast CDR
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-CDR
path: src/fastcdr
ref: ${{ matrix.fastcdr_version }}

- name: Checkout Fast DDS
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-DDS
path: src/fastdds
ref: ${{ matrix.fastdds_version }}

- name: Setup CMake version
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: Build workspace
run: >
colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ./src/fastdds_python/.github/workflows/test.meta
colcon_build_args: --executor parallel --mixin ccache
colcon_build_args_default: --event-handlers console_direct+
cmake_build_type: RelWithDebInfo
cmake_args_default: ''
workspace: ${{ github.workspace }}

- name: Run tests
run: |
source install/setup.bash && \
colcon test \
--packages-select fastdds_python \
--event-handlers=console_direct+ \
--return-code-on-test-failure \
--ctest-args \
--output-on-failure \
--timeout 60
id: test
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
with:
colcon_test_args: --packages-select fastdds_python --return-code-on-test-failure
colcon_test_args_default: --event-handlers console_direct+
ctest_args_default: --timeout 60
workspace: ${{ github.workspace }}

- name: Upload Logs
uses: actions/upload-artifact@v1
Expand Down
4 changes: 4 additions & 0 deletions fastdds_python/src/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ SWIG_ADD_LIBRARY(${PROJECT_NAME}
SOURCES ${${PROJECT_NAME}_FILES}
)

if(MSVC OR MSVC_IDE)
target_compile_options(${PROJECT_NAME} PRIVATE /bigobj)
endif()

if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set_property(TARGET ${PROJECT_NAME} PROPERTY SWIG_COMPILE_DEFINITIONS SWIGWORDSIZE64)
endif()
Expand Down
3 changes: 3 additions & 0 deletions fastdds_python/src/swig/fastrtps/types/TypesBase.i
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
%ignore eprosima::fastrtps::types::TypeFlag::deserialize;
%ignore eprosima::fastrtps::types::TypeFlag::getCdrSerializedSize;

%ignore eprosima::fastrtps::types::operator==;
%ignore eprosima::fastrtps::types::operator!=;

%include "fastrtps/types/TypesBase.h"

%extend eprosima::fastrtps::types::ReturnCode_t {
Expand Down
Loading