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

Set minimum supported version of Clang to 17 #4528

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

Conversation

randombit
Copy link
Owner

@randombit randombit commented Jan 3, 2025

@randombit randombit added this to the Botan 3.8.0 milestone Jan 3, 2025
@randombit randombit force-pushed the jack/min-clang-is-18 branch from caa293f to 3ca1c65 Compare January 3, 2025 19:17
@coveralls
Copy link

coveralls commented Jan 3, 2025

Coverage Status

coverage: 91.285% (+0.02%) from 91.267%
when pulling 353dc8d on jack/min-clang-is-18
into 2c1135f on master.

@randombit randombit changed the title Set minimum supported version of Clang to 18 Set minimum supported version of Clang to 17 Jan 4, 2025
Copy link
Collaborator

@reneme reneme left a comment

Choose a reason for hiding this comment

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

All for it, but what about semver guarantees?

Comment on lines -109 to -124
// TODO: C++20 introduces std::source_location which will allow to eliminate this
// macro altogether. Instead, using code would just call the C++ function
// that makes use of std::source_location like so:
//
// template<typename T, uint32_t M, typename F>
// int botan_ffi_visit(botan_struct<T, M>* obj, F func,
// const std::source_location sl = std::source_location::current())
// {
// // [...]
// if constexpr(...)
// {
// return ffi_guard_thunk(sl.function_name(), [&] { return func(*p); })
// }
// // [...]
// }
#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🥳

@randombit
Copy link
Owner Author

All for it, but what about semver guarantees?

Personally I view SemVer and the minimum supported compiler version as distinct issues. Admittedly this is not spelled out so concretely, only alluded to in statements in the docs like

we fix the minimum required compiler version and aim to maintain that support

In retrospect specifying the minimum Clang version in 3.0.0 rather than floating it like XCode/NDK was a mistake, since it was known at the time that Clang was well behind on C++20 features. Alas.

I can't find many comparable situations wrt required toolchain updates. C is pretty stagnant so it doesn't come up much. In Rust you just bump the minor version. Apps like Chrome do this (I guess they just recently started requiring Clang 16) but it's not quite the same situation as for a library that has direct downstream consumers.

For context main motivation here is that with a bit of work we can capture the location of all exception throws with std::source_location which would IMO be a quite useful debugging facility for end users. The typename stuff/etc is an annoyance but not a blocker.

Maybe not worth it though.

@reneme
Copy link
Collaborator

reneme commented Jan 6, 2025

it's not quite the same situation as for a library that has direct downstream consumers.

That's exactly my concern.

With a bit of work we can capture the location of all exception throws with std::source_location which would IMO be a quite useful debugging facility for end users.

I believe std::source_location also "works" (read: compiles) in clang 14, it just returns the wrong results. I may be wrong, though. Nevertheless: for this particular use case we might be able to get away with some compiler-specific special cases, no?

Maybe not worth it though.

Newer compiler is always worth it, in my personal opinion. Though, I feel we did upset some users with the jump to C++20 (most notable the automobile industry that is bound to MISRA, and thus C++17).

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.

3 participants