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 project to require C++17 #1241

Open
antoninbas opened this issue Apr 11, 2024 · 9 comments
Open

Update project to require C++17 #1241

antoninbas opened this issue Apr 11, 2024 · 9 comments

Comments

@antoninbas
Copy link
Member

antoninbas commented Apr 11, 2024

The project has been requiring / supporting C++11 since its inception.
It think it may be time to bump this requirement up to C++14, so that contributors can start using features introduced in C++14. I would personally be fine with C++17, but C++14 is more conservative.
One immediate advantage would be to remove the boost/thread/shared_mutex.hpp dependency, since C++14 includes a shared mutex (With support for RW lock) as part of the standard library.
Most of the required changes would be targeted at the build system and documentation.

Edit: based on discussion below, C++17 seems preferred to C++14. So that should be the plan unless there is a timely objection from someone.

@fruffy
Copy link
Contributor

fruffy commented Apr 11, 2024

We have updated P4C to C++17 a while ago. I think requiring C++17 at minimum is fair.

@antoninbas
Copy link
Member Author

We should check with @smolkaj if that's acceptable to him, but if it's fine for p4c it should be fine for bmv2 as well.

@smolkaj
Copy link
Member

smolkaj commented Apr 11, 2024

Yes, the newer the better from my side.
We're on C++20 internally at Google.

@antoninbas antoninbas changed the title Update project to require C++14 Update project to require C++17 Apr 11, 2024
@OsamaRab3
Copy link
Contributor

Hello ,

I would like to take this up as my very first contribution to get into open source.
I've never done this before and would really appreciate it if you could help me get started.
Can you tell me where to start contributing?
Any pointers or links to external references would be really helpful. thank you for your time.

@fruffy
Copy link
Contributor

fruffy commented May 15, 2024

Hello ,

I would like to take this up as my very first contribution to get into open source. I've never done this before and would really appreciate it if you could help me get started. Can you tell me where to start contributing? Any pointers or links to external references would be really helpful. thank you for your time.

The pragmatic answer is that you simply switch this flag here: https://github.com/p4lang/behavioral-model/blob/main/configure.ac#L130 and then try to compile the behavioral model. Things will likely break and you may have to fix the issues one after the other.

@jafingerhut
Copy link
Contributor

@OsamaReb3 I saw an email that appears to be a question from you for Fabian, but when I try to reply-all to that email, your email address is not obviously in the list of recipients, so I am responding this way instead.

To create a pull request, you do not need any account on any web site except github.com, which it appears you already do.

The basics are:

  • Use Github's "fork" feature to create your own personally owned copy of the repository p4lang/behavioral-model, which will be called (for you) https://github.com/OsamaRab3/behavioral-model

  • Clone that repository locally on your development system

  • In your local copy, do git checkout -b <some-branch-name-you-make-up-describing-your-changes> to create a branch where your proposed changes will be.

  • Do 1 (or more) commits to that branch in your local repository.

  • When you are ready to publish those changes, go to https://github.com/p4lang/behavioral-model, and Github should show a button near the top that lets you create a PR (Pull Request). Click that.

  • The pull request should now be visible to the public, under the "Pull Requests" "tab" visible near the top of the window at https://github.com/p4lang/behavioral-model

Before your pull request can be merged in, it must be approved by others.

Currently, you must also have digitally signed the Open Networking Foundation CLA. But let's worry about how to jump through that hoop after you get through the steps above.

@antoninbas
Copy link
Member Author

antoninbas commented May 24, 2024

@jafingerhut I suspect someone deleted the comment as it is unrelated to the issue

@OsamaRab3
Copy link
Contributor

I've made the changes to the build system and documentation to reflect this update. Could you please guide me on the best practices for testing these changes? Specifically, I want to ensure that the upgrade does not introduce any issues and that the project remains stable and functional.

@fruffy
Copy link
Contributor

fruffy commented May 28, 2024

I've made the changes to the build system and documentation to reflect this update. Could you please guide me on the best practices for testing these changes? Specifically, I want to ensure that the upgrade does not introduce any issues and that the project remains stable and functional.

Just open a pull request to this repository. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request

The continuous integration will automatically test your changes and we can review them.

antoninbas pushed a commit that referenced this issue Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants