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

Implement @optional annotation #4364

Open
wants to merge 134 commits into
base: master
Choose a base branch
from
Open

Implement @optional annotation #4364

wants to merge 134 commits into from

Conversation

tmayoff
Copy link
Contributor

@tmayoff tmayoff commented Nov 22, 2023

This is the first part of my adding support for the @optional annotation, this PR will not contain a custom implementation of optional for older compilers.

@jrw972
Copy link
Contributor

jrw972 commented Jan 18, 2024

@tmayoff Others have expressed interest in moving this PR forward and contributing to it. From your perspective, what else is left to do and/or what would help you the most (advice, guidance, code, design, etc.)?

@tmayoff
Copy link
Contributor Author

tmayoff commented Jan 18, 2024

For the most part I believe the code generation is all there, types should all be wrapped and accessed in an std::optional.

Right now the tests are failing but I think they might not be setup properly, I'm not sure how to deal with this, and the pub/subs are segfaulting due to not being able to get a domain participant.

After this fixing the tests, I think it's just dealing with edge cases and/or anything related to the MPC builds or compilers without support, like these errors

@mitza-oci
Copy link
Member

For the most part I believe the code generation is all there, types should all be wrapped and accessed in an std::optional.

Right now the tests are failing but I think they might not be setup properly, I'm not sure how to deal with this, and the pub/subs are segfaulting due to not being able to get a domain participant.

Looks like it's missing DDS_ROOT in the environment based on this line in the log:

Use of uninitialized value in subroutine entry at /home/runner/work/OpenDDS/OpenDDS/OpenDDS/bin/PerlDDS/Run_Test.pm line 37.

@tmayoff
Copy link
Contributor Author

tmayoff commented Jan 18, 2024

From this conversation, how can I skip the optional tests in MPC for compilers that don't support C++17

@jrw972 jrw972 added this to the 3.29 milestone Apr 17, 2024
@tmayoff
Copy link
Contributor Author

tmayoff commented Apr 29, 2024

Could someone give some pointers to help fix the new CI failures after that merge, it's all the KeyOnly_ tests

@jrw972
Copy link
Contributor

jrw972 commented Apr 30, 2024

Could someone give some pointers to help fix the new CI failures after that merge, it's all the KeyOnly_ tests

I'll take a look at it.

@jrw972
Copy link
Contributor

jrw972 commented Apr 30, 2024

@tmayoff It looks like you had some typos when merging.

@@ -0,0 +1,10 @@
###############
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated with an actual description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was previously mentioned that it might be better to move these tests to the xcdr test, but can't directly as it doesn't require C++17. If the tests don't need to be moved in this PR I can add a description and maybe a note to move the tests another time

};

@appendable
struct OptionalMembers {
boolean bool_field;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should boolean be optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally added to debug some issues with a struct with both optional and non-optional members, but can be made optional now.

tests/DCPS/Compiler/optional/main.cpp Outdated Show resolved Hide resolved
tests/DCPS/Compiler/optional/CMakeLists.txt Show resolved Hide resolved
tests/DCPS/optional/CMakeLists.txt Outdated Show resolved Hide resolved
@jrw972
Copy link
Contributor

jrw972 commented May 10, 2024

Once #4632 is merged, we can take out a lot of the workarounds for C++17 and move the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants