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

Add libuv support as a replacement of systemd + some CMake fixes #420

Merged
merged 10 commits into from
Jun 2, 2024
Merged

Conversation

Thor-x86
Copy link
Contributor

@Thor-x86 Thor-x86 commented Jun 1, 2024

This PR solves:

For further commit description regarding libuv support, see 7928671.

The option() function only dedicated for boolean type. For enumerated string, better use both set(... CACHE STRING ...) and set_property(CACHE ... PROPERTY STRINGS ...).

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
For further information, visit the documentation at https://cmake.org/cmake/help/latest/command/set.html#set-cache-entry

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
This commit prevents other new contributors from mistakenly blame CMakeLists.txt. Therefore, I added a warning just in case they forgot to turn on BUILD_ELINUX_SO while modifying BACKEND_TYPE.

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
Signed-off-by: Athaariq Ardhiansyah <[email protected]>
Not all embedded systems can include systemd due to their constrained resource limit. Our requirement from libsystemd is only event loop (sd-event). Therefore, libuv is perfect as drop-in replacement of sd-event. I tested the changes on Raspberry Pi 5 with Buildroot (yes, I am working on it too) and a x86-64 laptop with Arch Linux. Both are working as intended. Interestingly, libuv makes flutter-elinux smoother on my laptop. I have no idea how to benchmark it, but it is a good sign for us.

For now, I am assuming users are still relying on libsystemd. Therefore, libuv only be used if the target device has no systemd. If maintainer want to drop the systemd dependency, I suggest to deprecate it gracefully and plan to drop it later. Otherwise, it would be a breaking change.

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
Signed-off-by: Athaariq Ardhiansyah <[email protected]>
@HidenoriMatsubayashi HidenoriMatsubayashi added enhancement New feature or request drm Topics of DRM backend labels Jun 1, 2024
@HidenoriMatsubayashi
Copy link
Contributor

Thank you for sending this PR.

I would like to confirm one thing regarding this PR. It's unclear whether we can contribute this software to flutter/engine, but do you agree to delegate all rights related to this PR to Sony?

@Thor-x86
Copy link
Contributor Author

Thor-x86 commented Jun 1, 2024

do you agree to delegate all rights related to this PR to Sony?

Yeah sure! As long as it keep open sourced :)

@HidenoriMatsubayashi
Copy link
Contributor

Thank you.

Please check the CI failure.

@Thor-x86
Copy link
Contributor Author

Thor-x86 commented Jun 1, 2024

Please check the CI failure.

I am not sure if you will like this, but I fixed all styling errors that will disturb the CI. This is a huge change by the way.

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
@Thor-x86
Copy link
Contributor Author

Thor-x86 commented Jun 1, 2024

Sorry, the commit 13b9206 was removed because I forgot to exclude the src/third_party/*. Wonder why you didn't use git submodule for the source code dependencies.

I realized that clang-format is inconsistent between its versions. So, Arch Linux (clang v17) and Ubuntu Jammy (clang v14) will output different formatting result. For Arch Linux users, the clang14 package has no clang-format included. You need to compile the entire clang on your own until the downstream maintainer include it.

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
On some distributions with non-latest CMake, it will fail on configuration due to its incapability of substition from unset variable to an empty string. To fix this, we need to add double quotes between variables that will be tested by EQUAL, LESS, GREATER, and other related keywords. For better compatibility, use STREQUAL instead of EQUAL if possible.

Signed-off-by: Athaariq Ardhiansyah <[email protected]>
@Thor-x86
Copy link
Contributor Author

Thor-x86 commented Jun 2, 2024

I discovered a quirk on clang-format: its output won't be consistent between clang-format versions. Ubuntu Jammy has clang v14 and Arch Linux has clang v17. Their formatter always output different result. I'm still looking for a solution how to make .clang-format be universal. Because this problem also affects Debian users since they prefer to stay on most stable version.

For the CMake, this is my mistake. I supposed to consider to use STREQUAL instead of EQUAL due to compatibility issue.

Copy link
Contributor

@HidenoriMatsubayashi HidenoriMatsubayashi left a comment

Choose a reason for hiding this comment

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

LGTM.

I'm still looking for a solution how to make .clang-format be universal. Because this problem also affects Debian users since they prefer to stay on most stable version.

Thank you. I'll wait for your comment about this.

@Thor-x86
Copy link
Contributor Author

Thor-x86 commented Jun 2, 2024

I'll wait for your comment about this.

It's going to be a new PR in the future. For now, you can safely merge the changes.

@HidenoriMatsubayashi
Copy link
Contributor

Okay, thank you so much.

@HidenoriMatsubayashi HidenoriMatsubayashi merged commit 595f7f5 into sony:master Jun 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drm Topics of DRM backend enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider replace systemd with libuv? Does this project run without systemd?
2 participants