-
Notifications
You must be signed in to change notification settings - Fork 2k
Restructure directories add 2.3.4 #8561
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
Merged
conan-center-bot
merged 12 commits into
conan-io:master
from
dotChris90:restructure_directories_add_2_3_4
Jan 6, 2022
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c28fca5
rename all folder to 2.3.X
dotChris90 88cd408
add 2.3.4 and adding better tests
dotChris90 993e4cc
exclude Macos
dotChris90 9df42ac
typo
dotChris90 83c2f67
increase to 30s
dotChris90 adcf538
rename back to all
dotChris90 6f95d42
Mac requires environment variables
dotChris90 4eb083d
removed again to check test now works on mac
dotChris90 569d01a
because conan internal functions shall not be used
dotChris90 94b78b5
just try execution on mac os
dotChris90 10df994
just eval assert on linux .... because windows sometimes error
dotChris90 cb98c69
simplify test according to PR commits
dotChris90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
recipes/fast-dds/2.3.X/patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8a9cb0209..400c681e7 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -225,8 +225,8 @@ if(NOT BUILD_SHARED_LIBS) | ||
endif() | ||
|
||
eprosima_find_package(fastcdr REQUIRED) | ||
-eprosima_find_thirdparty(Asio asio VERSION 1.10.8) | ||
-eprosima_find_thirdparty(TinyXML2 tinyxml2) | ||
+eprosima_find_thirdparty(asio REQUIRED) | ||
+eprosima_find_thirdparty(tinyxml2 REQUIRED) | ||
|
||
find_package(foonathan_memory REQUIRED) | ||
message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") | ||
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt | ||
index d26915242..f00e36ea6 100644 | ||
--- a/src/cpp/CMakeLists.txt | ||
+++ b/src/cpp/CMakeLists.txt | ||
@@ -456,7 +456,7 @@ elseif(NOT EPROSIMA_INSTALLER) | ||
# Link library to external libraries. | ||
target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory | ||
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} | ||
- ${TINYXML2_LIBRARY} | ||
+ tinyxml2::tinyxml2 | ||
$<$<BOOL:${LINK_SSL}>:OpenSSL::SSL$<SEMICOLON>OpenSSL::Crypto$<$<BOOL:${WIN32}>:$<SEMICOLON>crypt32.lib>> | ||
$<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi> | ||
${THIRDPARTY_BOOST_LINK_LIBS} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(HelloWorldExample) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
find_package(fastdds REQUIRED) | ||
|
||
include_directories(msg) | ||
|
||
add_executable(test_pub | ||
HelloWorld_pub.cpp | ||
msg/HelloWorld.cxx | ||
msg/HelloWorldPublisher.cpp | ||
msg/HelloWorldPubSubTypes.cxx | ||
msg/HelloWorldSubscriber.cpp | ||
) | ||
|
||
add_executable(test_sub | ||
HelloWorld_sub.cpp | ||
msg/HelloWorld.cxx | ||
msg/HelloWorldPublisher.cpp | ||
msg/HelloWorldPubSubTypes.cxx | ||
msg/HelloWorldSubscriber.cpp | ||
) | ||
|
||
set_property(TARGET test_sub PROPERTY CXX_STANDARD 11) | ||
set_property(TARGET test_pub PROPERTY CXX_STANDARD 11) | ||
|
||
target_link_libraries(test_sub | ||
fastrtps | ||
) | ||
|
||
target_link_libraries(test_pub | ||
fastrtps | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file HelloWorld_main.cpp | ||
* | ||
*/ | ||
|
||
#include "HelloWorldPublisher.h" | ||
#include "HelloWorldSubscriber.h" | ||
|
||
#include <fastrtps/Domain.h> | ||
#include <fastrtps/log/Log.h> | ||
|
||
using namespace eprosima; | ||
using namespace fastrtps; | ||
using namespace rtps; | ||
int main(int argc, char** argv) | ||
{ | ||
std::cout << "Starting "<< std::endl; | ||
|
||
int count = 5; | ||
long sleep = 100; | ||
|
||
HelloWorldPublisher mypub; | ||
if(mypub.init()) | ||
{ | ||
mypub.run(count, sleep); | ||
} | ||
else | ||
{ | ||
std::cout << "problems ... init didnt work" << std::endl; | ||
} | ||
Domain::stopAll(); | ||
Log::Reset(); | ||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file HelloWorld_main.cpp | ||
* | ||
*/ | ||
|
||
#include "HelloWorldPublisher.h" | ||
#include "HelloWorldSubscriber.h" | ||
|
||
#include <fastrtps/Domain.h> | ||
#include <fastrtps/log/Log.h> | ||
|
||
using namespace eprosima; | ||
using namespace fastrtps; | ||
using namespace rtps; | ||
int main(int argc, char** argv) | ||
{ | ||
std::cout << "Starting "<< std::endl; | ||
|
||
int count = 5; | ||
long sleep = 100; | ||
|
||
HelloWorldSubscriber mysub; | ||
if(mysub.init()) | ||
{ | ||
mysub.run(count); | ||
} | ||
else | ||
{ | ||
std::cout << "problems ... init didnt work" << std::endl; | ||
} | ||
Domain::stopAll(); | ||
Log::Reset(); | ||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import subprocess | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
from subprocess import Popen | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
bin_sub_cmd = os.path.join("bin", "test_sub") | ||
bin_pub_cmd = os.path.join("bin", "test_pub") | ||
sub_process = Popen([bin_sub_cmd],stdout=subprocess.PIPE) | ||
pub_process = Popen([bin_pub_cmd],stdout=subprocess.PIPE) | ||
sub_process.wait(30) | ||
pub_process.wait(30) | ||
msg_send = 'Message: HelloWorld with index: 5 SENT' in str(pub_process.stdout.read()) | ||
msg_received = 'HelloWorld 5 RECEIVED' in str(sub_process.stdout.read()) | ||
assert msg_send | ||
assert msg_received | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
167 changes: 167 additions & 0 deletions
167
recipes/fast-dds/2.3.X/test_package/msg/HelloWorldPublisher.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @file HelloWorldPublisher.cpp | ||
* | ||
*/ | ||
|
||
#include "HelloWorldPublisher.h" | ||
#include <fastrtps/participant/Participant.h> | ||
#include <fastrtps/attributes/ParticipantAttributes.h> | ||
#include <fastrtps/attributes/PublisherAttributes.h> | ||
#include <fastrtps/publisher/Publisher.h> | ||
#include <fastrtps/Domain.h> | ||
|
||
#include <thread> | ||
|
||
using namespace eprosima::fastrtps; | ||
using namespace eprosima::fastrtps::rtps; | ||
|
||
HelloWorldPublisher::HelloWorldPublisher() | ||
: mp_participant(nullptr) | ||
, mp_publisher(nullptr) | ||
{ | ||
} | ||
|
||
bool HelloWorldPublisher::init() | ||
{ | ||
m_Hello.index(0); | ||
m_Hello.message("HelloWorld"); | ||
ParticipantAttributes PParam; | ||
PParam.rtps.builtin.discovery_config.discoveryProtocol = DiscoveryProtocol_t::SIMPLE; | ||
PParam.rtps.builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = true; | ||
PParam.rtps.builtin.discovery_config.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = true; | ||
PParam.rtps.builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true; | ||
PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite; | ||
PParam.rtps.setName("Participant_pub"); | ||
mp_participant = Domain::createParticipant(PParam); | ||
|
||
if (mp_participant == nullptr) | ||
{ | ||
return false; | ||
} | ||
//REGISTER THE TYPE | ||
|
||
Domain::registerType(mp_participant, &m_type); | ||
|
||
//CREATE THE PUBLISHER | ||
PublisherAttributes Wparam; | ||
Wparam.topic.topicKind = NO_KEY; | ||
Wparam.topic.topicDataType = "HelloWorld"; | ||
Wparam.topic.topicName = "HelloWorldTopic"; | ||
Wparam.topic.historyQos.kind = KEEP_LAST_HISTORY_QOS; | ||
Wparam.topic.historyQos.depth = 30; | ||
Wparam.topic.resourceLimitsQos.max_samples = 50; | ||
Wparam.topic.resourceLimitsQos.allocated_samples = 20; | ||
Wparam.times.heartbeatPeriod.seconds = 2; | ||
Wparam.times.heartbeatPeriod.nanosec = 200 * 1000 * 1000; | ||
Wparam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; | ||
mp_publisher = Domain::createPublisher(mp_participant, Wparam, (PublisherListener*)&m_listener); | ||
if (mp_publisher == nullptr) | ||
{ | ||
return false; | ||
} | ||
|
||
return true; | ||
|
||
} | ||
|
||
HelloWorldPublisher::~HelloWorldPublisher() | ||
{ | ||
// TODO Auto-generated destructor stub | ||
Domain::removeParticipant(mp_participant); | ||
} | ||
|
||
void HelloWorldPublisher::PubListener::onPublicationMatched( | ||
Publisher* /*pub*/, | ||
MatchingInfo& info) | ||
{ | ||
if (info.status == MATCHED_MATCHING) | ||
{ | ||
n_matched++; | ||
firstConnected = true; | ||
std::cout << "Publisher matched" << std::endl; | ||
} | ||
else | ||
{ | ||
n_matched--; | ||
std::cout << "Publisher unmatched" << std::endl; | ||
} | ||
} | ||
|
||
void HelloWorldPublisher::runThread( | ||
uint32_t samples, | ||
uint32_t sleep) | ||
{ | ||
if (samples == 0) | ||
{ | ||
while (!stop) | ||
{ | ||
if (publish(false)) | ||
{ | ||
std::cout << "Message: " << m_Hello.message() << " with index: " << m_Hello.index() << " SENT" << | ||
std::endl; | ||
} | ||
std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); | ||
} | ||
} | ||
else | ||
{ | ||
for (uint32_t i = 0; i < samples; ++i) | ||
{ | ||
if (!publish()) | ||
{ | ||
--i; | ||
} | ||
else | ||
{ | ||
std::cout << "Message: " << m_Hello.message() << " with index: " << m_Hello.index() << " SENT" << | ||
std::endl; | ||
} | ||
std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); | ||
} | ||
} | ||
} | ||
|
||
void HelloWorldPublisher::run( | ||
uint32_t samples, | ||
uint32_t sleep) | ||
{ | ||
stop = false; | ||
std::thread thread(&HelloWorldPublisher::runThread, this, samples, sleep); | ||
if (samples == 0) | ||
{ | ||
std::cout << "Publisher running. Please press enter to stop the Publisher at any time." << std::endl; | ||
std::cin.ignore(); | ||
stop = true; | ||
} | ||
else | ||
{ | ||
std::cout << "Publisher running " << samples << " samples." << std::endl; | ||
} | ||
thread.join(); | ||
} | ||
|
||
bool HelloWorldPublisher::publish( | ||
bool waitForListener) | ||
{ | ||
if (m_listener.firstConnected || !waitForListener || m_listener.n_matched > 0) | ||
{ | ||
m_Hello.index(m_Hello.index() + 1); | ||
mp_publisher->write((void*)&m_Hello); | ||
return true; | ||
} | ||
return false; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of any change on the Macos machines, this should work as it was working before 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also extremely strange to me - but have no Mac - so cannot check reason ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just tried locally and it worked for me (apple-clang 13). I'll investigate it in a different PR here in CCI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the link: #8566. I'm also upgrading dependencies, to apply some meaningful change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgsogo thanks for supporting here :)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No but your test package is likely broken, you don't inject DYLD_LIBRARY_PATH by not relying on self.run with environment=True, so yes shared on Macos breaks obviously.
Why is it so complex now? test_package is not supposed to be a functional test of the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st thanks for pointing it out - yes -.- i forgot i start them with popen now -.- will adapt tomorrow.
2nd The reason for this huge test is a bug hard to detect but happened when one dependency (foonathan memory) was set with wrong default options. then sending messages from one thread to one other inside same process works fine but the communication between 2 process crash on runtime. Basically i want to check if 1 message can be sent by one process and received by 1 process. i dont want accidentally again a package with this misbehavior.