Skip to content

Commit 1778cb1

Browse files
Windows platform fixes (#11)
* Refs #13947 swig fixes for windows Signed-off-by: Miguel Barro <miguelbarro@eprosima.com> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13380. Fix the examples for windows Signed-off-by: Miguel Barro <miguelbarro@eprosima.com> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13380. Fix the tests for windows. Signed-off-by: Miguel Barro <miguelbarro@eprosima.com> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Add Windows CI Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13384. Fix rebase Signed-off-by: Ricardo González <ricardo@richiware.dev> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13384. Fix importing library on windows in tests Signed-off-by: Ricardo González <ricardo@richiware.dev> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13384. Fix rebase Signed-off-by: Ricardo González <ricardo@richiware.dev> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13384. Remove comment Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #13384. Fix windows environment variable issue Signed-off-by: Miguel Barro <miguelbarro@eprosima.com> * Revert "Refs #13384. Fix windows environment variable issue" This reverts commit db8e984. The changes introduced in the above commit were only significant on docker windows and seem superfluos for the github action virtual machine. Signed-off-by: Miguel Barro <miguelbarro@eprosima.com> Co-authored-by: Ricardo González <ricardo@richiware.dev>
1 parent 694553d commit 1778cb1

14 files changed

Lines changed: 155 additions & 16 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,80 @@ on:
1010
- cron: '0 0 * * *'
1111

1212
jobs:
13+
windows-build-test:
14+
runs-on: windows-2019
15+
16+
env:
17+
CXXFLAGS: /MP
18+
OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64"
19+
20+
steps:
21+
22+
- name: install OpenSSL
23+
shell: pwsh
24+
run: |
25+
choco install openssl -yr --no-progress
26+
"System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} `
27+
| ls -Include libssl-*.dll | rm
28+
29+
- name: Install python build dependencies
30+
shell: pwsh
31+
run: >
32+
pip install -U colcon-common-extensions colcon-mixin vcstool;
33+
34+
- name: Install python tests dependencies
35+
shell: pwsh
36+
run: |
37+
cd (ni -Type Directory -Path "$Env:TMP\$(New-Guid)")
38+
$cr = "`n"
39+
'cmake_minimum_required(VERSION 3.5)' + $cr +
40+
'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr +
41+
'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr +
42+
'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' |
43+
Out-File CMakeLists.txt
44+
(cmake .) *>&1 | % {
45+
if($_ -Match "cmake detected python=>>>>>(?<exec>.*)<<<<<<")
46+
{
47+
$python_exec = $Matches.exec
48+
return
49+
}
50+
}
51+
& $python_exec -m pip install -U pytest pywin32
52+
53+
- uses: actions/checkout@v2
54+
with:
55+
path: src/fastdds_python
56+
57+
- name: Fetch repositories
58+
shell: pwsh
59+
run: |
60+
vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos
61+
62+
- name: Build workspace
63+
shell: pwsh
64+
run: |
65+
$installpath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
66+
$modulepath = "$installpath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
67+
Import-Module $modulepath
68+
Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath `
69+
-DevCmdArguments '/arch=x64 /host_arch=x64';
70+
$cargs = @("--event-handlers=console_direct+", `
71+
"--metas", "./src/fastdds_python/.github/workflows/test.meta")
72+
colcon build --executor parallel $cargs
73+
74+
- name: Run tests
75+
shell: pwsh
76+
run: |
77+
colcon test --packages-select fastdds_python --event-handlers=console_direct+ `
78+
--return-code-on-test-failure --ctest-args --timeout 60
79+
80+
- name: Upload Logs
81+
uses: actions/upload-artifact@v1
82+
with:
83+
name: colcon-logs-windows
84+
path: log/
85+
if: always()
86+
1387
ubuntu-build-test:
1488
runs-on: ubuntu-20.04
1589

@@ -24,8 +98,6 @@ jobs:
2498
sudo apt install -y \
2599
python3 \
26100
python3-pip \
27-
libasio-dev \
28-
libtinyxml2-dev \
29101
swig \
30102
libpython3-dev
31103
@@ -40,7 +112,8 @@ jobs:
40112
vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos
41113
42114
- name: Build workspace
43-
run: colcon build --event-handlers=console_direct+
115+
run: >
116+
colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta
44117
45118
- name: Run tests
46119
run: |

.github/workflows/test.meta

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"names":
3+
{
4+
"fastrtps" :
5+
{
6+
"cmake-args": [
7+
"-DTHIRDPARTY=ON",
8+
"-DSECURITY=ON",
9+
]
10+
}
11+
}
12+
}

fastdds_python/src/swig/fastdds/dds/core/Entity.i

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616
#include "fastdds/dds/core/Entity.hpp"
1717
%}
1818

19+
%ignore eprosima::fastdds::dds::Entity::Entity;
20+
%ignore eprosima::fastdds::dds::Entity::~Entity;
21+
%ignore eprosima::fastdds::dds::DomainEntity::DomainEntity;
22+
%ignore eprosima::fastdds::dds::DomainEntity::~DomainEntity;
23+
1924
%include "fastdds/dds/core/Entity.hpp"

fastdds_python/src/swig/fastdds/dds/core/condition/Condition.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#include "fastdds/dds/core/condition/GuardCondition.hpp"
1919
%}
2020

21+
// Ignore StatusCondition constructor
22+
%ignore eprosima::fastdds::dds::StatusCondition::StatusCondition;
23+
2124
%exception eprosima::fastdds::dds::Condition::to_status_condition()
2225
{
2326
try

fastdds_python/src/swig/fastdds/dds/domain/DomainParticipant.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
#include "fastdds/dds/domain/DomainParticipant.hpp"
1717
%}
1818

19+
%ignore eprosima::fastdds::dds::DomainParticipant::has_active_entities;
20+
%ignore eprosima::fastdds::dds::DomainParticipant::DomainParticipant;
21+
%ignore eprosima::fastdds::dds::DomainParticipant::~DomainParticipant;
22+
1923
%include "fastdds/dds/domain/DomainParticipant.hpp"

fastdds_python/src/swig/fastdds/dds/publisher/Publisher.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616
#include "fastdds/dds/publisher/Publisher.hpp"
1717
%}
1818

19+
%ignore eprosima::fastdds::dds::Publisher::Publisher;
20+
%ignore eprosima::fastdds::dds::Publisher::~Publisher;
21+
1922
%include "fastdds/dds/publisher/Publisher.hpp"

fastdds_python/src/swig/fastdds/dds/publisher/qos/WriterQos.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
#include "fastdds/dds/publisher/qos/WriterQos.hpp"
1717
%}
1818

19+
%ignore eprosima::fastdds::dds::WriterQos::clear;
20+
1921
%include "fastdds/dds/publisher/qos/WriterQos.hpp"

fastdds_python/src/swig/fastdds/dds/subscriber/Subscriber.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616
#include "fastdds/dds/subscriber/Subscriber.hpp"
1717
%}
1818

19+
%ignore eprosima::fastdds::dds::Subscriber::Subscriber;
20+
%ignore eprosima::fastdds::dds::Subscriber::~Subscriber;
21+
1922
%include "fastdds/dds/subscriber/Subscriber.hpp"

fastdds_python/src/swig/fastdds/dds/subscriber/qos/ReaderQos.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
#include "fastdds/dds/subscriber/qos/ReaderQos.hpp"
1717
%}
1818

19+
%ignore eprosima::fastdds::dds::ReaderQos::clear;
20+
1921
%include "fastdds/dds/subscriber/qos/ReaderQos.hpp"

fastdds_python/src/swig/fastdds/dds/topic/Topic.i

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616
#include "fastdds/dds/topic/Topic.hpp"
1717
%}
1818

19+
// Ignore get_inconsistent_topic_status which is not exported
20+
%ignore eprosima::fastdds::dds::Topic::get_inconsistent_topic_status;
21+
%ignore eprosima::fastdds::dds::Topic::Topic;
22+
%ignore eprosima::fastdds::dds::Topic::~Topic;
23+
1924
%include "fastdds/dds/topic/Topic.hpp"

0 commit comments

Comments
 (0)