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

DPP: De-const have_voice option and add coroutines support. #4824

Merged
merged 11 commits into from
Aug 5, 2024

Conversation

Nk125
Copy link
Contributor

@Nk125 Nk125 commented Aug 2, 2024

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first. [✔️]
  • Write good commit messages and use the same coding conventions as the rest of the project. [✔️]
    • Across the whole pull request conventional commits are used.
  • Please commit code to dev branch and we will merge into master branch in feature [✔️]
  • Ensure your edited codes with four spaces instead of TAB. [✔️]

Nk125 added 3 commits August 2, 2024 01:07
De-const have_voice option and enables optional download of voice libraries
Adds a configurable option to enable coroutine support
@Nk125
Copy link
Contributor Author

Nk125 commented Aug 2, 2024

Before committing, the changes were tested using the test.lua script in this repo with my machine (Windows 10 21H1 x86_64).

@Nk125 Nk125 marked this pull request as draft August 2, 2024 18:05
@@ -53,7 +53,9 @@ package("dpp")

add_deps("nlohmann_json", "openssl", "zlib")

add_configs("have_voice", { description = "Enable voice support for the library.", default = true, type = "boolean" , readonly = true})
add_configs("have_voice", { description = "Enable voice support for the library.", default = true, type = "boolean" , readonly = false})
Copy link
Member

Choose a reason for hiding this comment

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

please rename have_voice to voice, we need not any have_ with_ enable_ preifx.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was changed but the main issue is that this change will break the current user code bases, the flag was left unchanged since 2022 (introduced here), the most reliable solution I was considering is showing a deprecation warning to anyone is using have_voice flag and then in later DPP versions erase it from the next versions.

Another solution I propose is doing a temporal alias from have_voice to voice internally in the script, and doing the same as before, show a deprecation warning and then delete the flag.

Copy link
Member

Choose a reason for hiding this comment

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

you can reserve have_voice and add some deprecated warnings.

and add new voice config , then tell user to use voice instead of have_voice

Copy link
Contributor Author

@Nk125 Nk125 Aug 4, 2024

Choose a reason for hiding this comment

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

Added in the last commit, please review it for other advices, thanks for the support!

Nk125 added 8 commits August 3, 2024 18:30
As mentioned in the same pull request, prefixes like have_ are discouraged in xmake packages.

BREAKING CHANGES: This WILL break xmake scripts that use the have_voice flag, IMO it's better to keep the previous have_voice flag as a deprecated alias of the new voice flag, and in the next version of D++ completely remove it from the package.
If coroutines are enabled, C++20 is required or the compilation will fail even though the test only requires C++17 to work, as dpp automatically includes coroutines if the macro is defined without checking C++ version
The current configuration wasn't proper and when coroutines were enabled, the C++ version would change to C++17 sporadically, ignoring the later C++20 specification that was done later. Now the C++ version will adjust correctly to the coro flag.
This will bring up again have_voice to avoid codebase breakage, but with many deprecation warnings around to prevent new users to define it.
@Nk125 Nk125 marked this pull request as ready for review August 4, 2024 15:41
@waruqi waruqi merged commit a450552 into xmake-io:dev Aug 5, 2024
65 checks passed
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.

2 participants