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

Update bn256 to c++20 #17

Merged
merged 17 commits into from
Aug 2, 2023
Merged

Update bn256 to c++20 #17

merged 17 commits into from
Aug 2, 2023

Conversation

greg7mdp
Copy link
Contributor

No description provided.

src/array.h Outdated
} // namespace bn256
#endif
template <typename T, std::size_t S>
using array = std::array<T, S>;
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be removed and the code should be updated from array to std::array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

CMakeLists.txt Outdated
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)
project(bn256 VERSION 1.0.0)
Copy link
Member

Choose a reason for hiding this comment

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

I think it is worth updating the version on changing from C++-17 to C++20. Maybe 1.1.0. Would be good to create a release/1.0 branch with current code. I could see projects that are using C++-17 liking to have a C++17 version of the library available.

Note the README.md also needs to be updated with the correct version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

CMakeLists.txt Outdated
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)
Copy link
Member

Choose a reason for hiding this comment

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

needs to be updated to 3.12 to understand CMAKE_CXX_STANDARD=20

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@greg7mdp greg7mdp marked this pull request as draft July 31, 2023 19:08
@greg7mdp greg7mdp marked this pull request as ready for review July 31, 2023 19:10
CMakeLists.txt Outdated
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(bn256 VERSION 1.0.0)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be 1.1.0 now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, missed that, done!

CMakeLists.txt Outdated
string(REPLACE "." ";" version_list ${version}) # transform into list
list(GET version_list 0 version_major)

project(bn256 VERSION ${version})
Copy link
Member

Choose a reason for hiding this comment

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

I think you can do project(bn256 VERSION 1.1.0) here and then use bn256_VERSION_MAJOR elsewhere, instead of doing that parsing stuff.

But it seems to me like this ought to be a 2.0.0 version instead, since don't these changes break the ABI?

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 you can do project(bn256 VERSION 1.1.0) here and then use bn256_VERSION_MAJOR elsewhere,

yes, that works, thanks!

But it seems to me like this ought to be a 2.0.0 version instead

Hum, I'm not sure how to tell for sure, but I'm happy to switch to 2.0.0.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's mostly academic on 1.0.0 vs 1.1.0 vs 2.0.0 for many reasons.. but setting things like

bn256/CMakeLists.txt

Lines 23 to 25 in b20f7f5

set_property(TARGET bn256 PROPERTY SOVERSION ${bn256_VERSION_MAJOR})
set_property(TARGET bn256 PROPERTY INTERFACE_bn256_MAJOR_VERSION ${bn256_VERSION_MAJOR})
set_property(TARGET bn256 APPEND PROPERTY COMPATIBLE_INTERFACE_STRING bn256_MAJOR_VERSION)

shows an intent to version and since std::span is part of the public interface, switching from "not really std::span" to std::span breaks usage of the library if it had been built as a shared library and installed. Again.. that seems like a stretch of a use case.. but maybe.

README.md Outdated
@@ -1,5 +1,5 @@
# BN256 Cryptographic Library
## Version : 1.0
## Version : 1.1
Copy link
Member

Choose a reason for hiding this comment

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

probably want 2.0 here too

@greg7mdp greg7mdp merged commit eae77bf into main Aug 2, 2023
@greg7mdp greg7mdp deleted the c++20_update branch August 2, 2023 11:45
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