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

Make sure ARBORX_VERSION and ARBORX_VERSION_STRING always match #1201

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Jan 11, 2025

Follow-up on #1190. Make versions consistent.

@aprokop aprokop added build Build and installation API User visible interface modifications labels Jan 11, 2025
Comment on lines 19 to 21
#define ARBORX_VERSION_MAJOR @ARBORX_VERSION_MAJOR@
#define ARBORX_VERSION_MINOR @ARBORX_VERSION_MINOR@
#define ARBORX_VERSION_PATCH @ARBORX_VERSION_PATCH@
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we need these, but should not hurt.

src/ArborX_Config.hpp.in Outdated Show resolved Hide resolved
Copy link
Contributor

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

One caveat is that it does not let us express that breaking changes occurred since 1.7

@dalg24
Copy link
Contributor

dalg24 commented Jan 13, 2025

Also please add a testCompileOnlyVersionMacros.cpp with a few static assertions along these lines:

static_assert(0 <= ARBORX_VERSION_MAJOR && ARBORX_VERSION_MAJOR <= 99);
// ...
static_assert(ARBORX_VERSION == ARBORX_VERSION_MAJOR * 10000 + ...);

@aprokop
Copy link
Contributor Author

aprokop commented Jan 13, 2025

One caveat is that it does not let us express that breaking changes occurred since 1.7

Yes. I am not sure how to express that. Or any breaking changes in the future. Other than through version major.

@aprokop aprokop force-pushed the arborx_version_followup branch from ac40b2e to 31857fd Compare January 13, 2025 17:23
@@ -0,0 +1,21 @@
#include <ArborX_Config.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be including <Arborx.hpp> instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think either is fine. ArborX_Config.hpp is still the top level file at the moment, so users are allowed to include it without including ArborX.hpp, I think.

Comment on lines +3 to +17
#ifndef ARBORX_VERSION
static_assert(false, "ARBORX_VERSION macro is not defined!");
#endif

#ifndef ARBORX_VERSION_MAJOR
static_assert(false, "ARBORX_VERSION_MAJOR macro is not defined!");
#endif

#ifndef ARBORX_VERSION_MINOR
static_assert(false, "ARBORX_VERSION_MINOR macro is not defined!");
#endif

#ifndef ARBORX_VERSION_PATCH
static_assert(false, "ARBORX_VERSION_PATCH macro is not defined!");
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

These are fine if you really want them but it is covered by the static assertions below.

Copy link
Contributor

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

My last suggestion stands but I am ok with the current state

@aprokop aprokop merged commit 09c9c1f into arborx:master Jan 13, 2025
2 checks passed
@aprokop aprokop deleted the arborx_version_followup branch January 13, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API User visible interface modifications build Build and installation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants