-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix windows compilation by setting right visibility attributes #550
Conversation
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #550 +/- ##
=======================================
Coverage 83.63% 83.64%
=======================================
Files 79 79
Lines 10211 10214 +3
=======================================
+ Hits 8540 8543 +3
Misses 1671 1671
|
Co-authored-by: Addisu Z. Taddese <[email protected]> Signed-off-by: Michael Carroll <[email protected]>
662af67
to
f4b52f8
Compare
Signed-off-by: Steve Peters <[email protected]> Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
The Windows failure here would indicate to me that the base class constructor isn't getting called?
gz-common/testing/src/CMakeTestPaths.cc Lines 26 to 37 in 983a1eb
|
also I'm not sure why that test works at all since it doesnt use the factory:
|
|
||
/// \brief Path to the root of the project source |
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.
restore this comment?
Printing a message in the constructor displays that it is being called:
Maybe the reason is somehow over here. |
The way that it should work is that we call the
The gz-common/testing/include/gz/common/testing/TestPaths.hh Lines 66 to 68 in 983a1eb
Which is a constexpr char, set here:
Ultimately set via: gz-common/testing/include/gz/common/testing/TestPaths.hh Lines 29 to 31 in 983a1eb
|
If I modified: diff --git a/testing/include/gz/common/testing/TestPaths.hh b/testing/include/gz/common/testing/TestPaths.hh
index b234a97..5348a1d 100644
--- a/testing/include/gz/common/testing/TestPaths.hh
+++ b/testing/include/gz/common/testing/TestPaths.hh
@@ -27,7 +27,7 @@
#include "gz/common/testing/Export.hh"
#ifndef TESTING_PROJECT_SOURCE_DIR
-#define TESTING_PROJECT_SOURCE_DIR ""
+#define TESTING_PROJECT_SOURCE_DIR "foo"
#endif
namespace gz::common::testing The test passes (failed a bit below in other ASSERTs as expected) which looks to me like the constructors are doing their job but we have a problem with Looking at building logs, I see the definition passed by the compiler when building the test:
Could it be that somehow the binary symbols generated by the
|
maybe? It's just strange that the visibility change caused this to surface. |
Looking at the build rules from Ninja
When |
It seems to work on other platforms as well, so maybe there is a difference in the way that inlining is happening. |
When i put this together, I think the goal was for the constructor to be only defined in the header such that when it was called, it would use the preprocessor definition at the point that it was used. This seems to have worked up until now, maybe there is a way to make this more robust? |
Yeah, this is puzzling. My understanding was that default arguments are handled at compile time, not at link time, so I would have thought that the |
This seems like a reasonable approach, not sure why I didn't do it this way before (maybe because it just worked with the symbol?) |
Signed-off-by: Jose Luis Rivero <[email protected]>
Well, that didn't work.
I added a print statement in the base constructor and it didn't get called, so that explains some things. |
Signed-off-by: Jose Luis Rivero <[email protected]> Signed-off-by: Michael Carroll <[email protected]> Co-authored-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
This reverts commit 7eb756f.
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Setting DCO to pass, I think enough merge/rebase/cherry-pick has happened here to confuse the checker. |
Good to go. Thanks @mjcarroll @azeey |
🦟 Bug fix
Fixes Windows compilation after #548
Summary
The PR restores the Windows compilation after it was broken on #548. There was a problem using method visibility declaration instead of class visibility that ended up being not easy to solve without warnings with the version of MSVC in the Jenkins nodes. I added a note and a disable a warning on the code.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.