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

Eliminate Conan, CUnit #1767

Merged
merged 2 commits into from
Jul 18, 2023
Merged

Conversation

eboasson
Copy link
Contributor

We have been using Conan to get the prerequisites in the CI, but that's become problematic: Conan 2.0 dropped the model for integrating with CMake builds that used to be the way in Conan 1.x, but the new models assume a tighter integration with Conan than I think is wise for Cyclone. So Conan has to go at some point.

The only prerequisites for which we used Conan were CUnit and OpenSSL. Azure has OpenSSL pre-installed, so we might as well use that. That leaves only CUnit, which is easy to get on macOS and Ubuntu (via homebrew and apt), but turns out to be hard on Windows without using Conan, and that recipe got broken recently. We have simply been lucky because of some caching on Azure ...

Building CUnit from the Azure build scripting is feasible and takes only a few seconds, but the problem with that is finding a good set of sources. The old CUnit sources depend on GNU autoconf/automake, which Cyclone should not start depending on, and a more recently updated fork that uses CMake only supports static builds. And as it happens, a statically linked CUnit breaks the security tests in Windows because some of the assertions are in a DLL ...

While we could probably rewrite the problematic tests, it turns out we use such a tiny bit of CUnit that it takes a mere 600 lines of C code+headers to replace it altogether. That way, we don't have to rewrite the tests and we drop the dependency.

Incidentally fixes #1678.

@poetinger poetinger self-requested a review July 17, 2023 11:35
@poetinger poetinger added the enhancement Enhance existing functionality label Jul 17, 2023
@@ -315,6 +316,7 @@ CU_Test(dds_log, newline_terminates, .fini=reset)
CU_ASSERT_PTR_NULL_FATAL(msg);
DDS_ERROR("baz\n");
CU_ASSERT_PTR_NOT_NULL_FATAL(msg);
assert(msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add these asserts, but remove them elsewhere (e.g. string.c)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I first added some, then realised I could get rid of those but only used a few simple patters to look for them. This one didn't get picked up the regexes I used. (Looking at everything single assert was a bit too much!)

Thanks for noticing it, though. Now I know to remove it 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For good measure, I had another look and removed a few more asserts

@eboasson eboasson merged commit d9d6d55 into eclipse-cyclonedds:master Jul 18, 2023
18 of 20 checks passed
This was referenced Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor Grammar Mistakes in README
2 participants