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

Move lvgl-sys to a separate repository. #176

Open
AlixANNERAUD opened this issue Jul 1, 2024 · 19 comments
Open

Move lvgl-sys to a separate repository. #176

AlixANNERAUD opened this issue Jul 1, 2024 · 19 comments

Comments

@AlixANNERAUD
Copy link
Collaborator

Since lv_binding_rust appears unlikely to be updated for LVGL v9.X anytime soon, could lvgl-sys be moved to a separate repository to allow for regular updates independently of lv_binding_rust/lvgl?

@AlixANNERAUD AlixANNERAUD changed the title Put lvgl-sys into another repository Move lvgl-sys to a separate repository. Jul 1, 2024
@AlixANNERAUD AlixANNERAUD changed the title Move lvgl-sys to a separate repository. Move lvgl-sys to a separate repository. Jul 1, 2024
@C47D C47D mentioned this issue Dec 19, 2024
11 tasks
@AlixANNERAUD
Copy link
Collaborator Author

AlixANNERAUD commented Dec 19, 2024

I already have a repository ready, we just need to change ownership, do some tweaking and refactoring in the build script and add automatic release for previous versions (down to v8.0.0 ? maybe).

@C47D
Copy link
Collaborator

C47D commented Dec 27, 2024

Hi,

If a user wants to use the lvgl rust bindings what should they include, this repo or the lvgl-sys repo?

I have the impression that this repo is more an examples repo and moving lvgl-sys to a separated repo sound like a good thing to do. I guess we should also need update it when main lvgl make a new release. Am I missing something else?

Any thoughts @kisvegabor?

@AlixANNERAUD
Copy link
Collaborator Author

AlixANNERAUD commented Dec 27, 2024

Regular end users should rely on the safe Rust bindings. However, advanced users might choose to use the unsafe raw bindings (via the lvgl-sys C library generated by bindgen), either as a complement (to use API unsupported by the safe one) or directly, depending on their needs.

The release schedule for the repositories should be as follows:

  • Raw (lvgl-sys): Automatically (CI) released whenever a new version of LVGL is released (major, minor, or patch).
  • Safe bindings: Released when ready, typically aligned with major LVGL versions. The lvgl-sys dependency version should be set to any minor or patch updates, as these do not introduce breaking API changes, thus no change in the safe part code generator.

So you are mostly right, I added that for precision purpose.

@C47D
Copy link
Collaborator

C47D commented Dec 28, 2024

Regular end users should rely on the safe Rust bindings. However, advanced users might choose to use the unsafe raw bindings (via the lvgl-sys C library generated by bindgen), either as a complement (to use API unsupported by the safe one) or directly, depending on their needs.

The release schedule for the repositories should be as follows:

  • Raw (lvgl-sys): Automatically (CI) released whenever a new version of LVGL is released (major, minor, or patch).
  • Safe bindings: Released when ready, typically aligned with major LVGL versions. The lvgl-sys dependency version should be set to any minor or patch updates, as these do not introduce breaking API changes, thus no change in the safe part code generator.

So you are mostly right, I added that for precision purpose.

And the safe bindings are this repo? They have to be done manually? Sorry for the dumb questions tho

@AlixANNERAUD
Copy link
Collaborator Author

AlixANNERAUD commented Dec 28, 2024

Don't worry. This repository currently includes both the safe and unsafe bindings. The safe bindings are generated using the lvgl-codegen lib (check its folder) which takes the raw unsafe bindings (lvgl-sys) and generate safe / rust idiomatic bindings (check the build.rs script in the lvgl folder). If we separate out the unsafe bindings, what remains will be the generated safe bindings (lvgl) and their generator library (lvgl-codegen).

@kisvegabor
Copy link
Member

It might be a little off topic, but also related to the schedule of the releases and stability. In the the lvgl repo we have a test which should be added for all bindings. This UI needs to be created. This is the C code. For MicroPython we have the equivalent test which uses the very same reference image. Both test are part of LVGL's CI so we test MicroPython on each commit.

In order to support Rust in a serious level we need to add a similar test to make sure that the binding is not broken.

What do you think about it?

@C47D
Copy link
Collaborator

C47D commented Jan 3, 2025

It might be a little off topic, but also related to the schedule of the releases and stability. In the the lvgl repo we have a test which should be added for all bindings. This UI needs to be created. This is the C code. For MicroPython we have the equivalent test which uses the very same reference image. Both test are part of LVGL's CI so we test MicroPython on each commit.

In order to support Rust in a serious level we need to add a similar test to make sure that the binding is not broken.

What do you think about it?

Sounds like a good first step to keep this binding working. I will travel tonight back to home, so I can work on this this weekend

@AlixANNERAUD
Copy link
Collaborator Author

AlixANNERAUD commented Jan 4, 2025

It might be a little off topic, but also related to the schedule of the releases and stability. In the the lvgl repo we have a test which should be added for all bindings. This UI needs to be created. This is the C code. For MicroPython we have the equivalent test which uses the very same reference image. Both test are part of LVGL's CI so we test MicroPython on each commit.

In order to support Rust in a serious level we need to add a similar test to make sure that the binding is not broken.

What do you think about it?

Yeah that makes sense and it is easy to implement. However there is some stuff like img in this test that wasn't supported before so I don't expect it to fully pass anytime soon.

@C47D
Copy link
Collaborator

C47D commented Jan 8, 2025

@kisvegabor With regards of separating the lvgl-sys repo from this, do you agree, see any issue?

@kisvegabor
Copy link
Member

However there is some stuff like img in this test that wasn't supported before so I don't expect it to fully pass anytime soon.

That binding test is quite complete. If he binding is capable of doing all these, most of the people should be happy with it. So I think it's also good measure for readiness.

With regards of separating the lvgl-sys repo from this, do you agree, see any issue?

Basically there would be 2 bindings: a safe and an unsafe? If so, I suggest focusing on the simpler first, and if it ready, working, and we have positive feedback, we can create a repo for the other too. What do you think?

@C47D
Copy link
Collaborator

C47D commented Jan 9, 2025

Basically there would be 2 bindings: a safe and an unsafe? If so, I suggest focusing on the simpler first, and if it ready, working, and we have positive feedback, we can create a repo for the other too. What do you think?

Correct, the unsafe bindings (located in lvgl-sys) are created automatically, but having lvgl-sys in a separated repo would allow us to generate unsafe bindings for multiple LVGL versions. Currently the unsafe bindings available in this repo are 'stuck' in LVGLv8.

See this another comment about it #158 (comment)

@kisvegabor
Copy link
Member

What about using branches like release/v8.3, release/v8.4, release/v9.0, etc?
Same as we do in the lvgl repo?

@AlixANNERAUD
Copy link
Collaborator Author

What about using branches like release/v8.3, release/v8.4, release/v9.0, etc? Same as we do in the lvgl repo?

Exactly

@C47D
Copy link
Collaborator

C47D commented Jan 14, 2025

Ok then, I'll create a new branch with the current version and then move the lvgl submodule to v9, then we can start patching it as @AlixANNERAUD did in their repo.
Does that sound ok?

@C47D
Copy link
Collaborator

C47D commented Jan 15, 2025

I've just created the release/v8.3 branch, does it sounds ok? If so I can create new branches with all the other releases taking the main LVGL repo as reference.

image

@AlixANNERAUD
Copy link
Collaborator Author

AlixANNERAUD commented Jan 15, 2025

I've just created the release/v8.3 branch, does it sounds ok? If so I can create new branches with all the other releases taking the main LVGL repo as reference.

image

In the current repository ? I meant to create a separate repository + synced branch with upstream LVGL for lvgl-sys.

@C47D
Copy link
Collaborator

C47D commented Jan 16, 2025

I think @kisvegabor is more in favor of having it in the same repo. Having lvgl-sys (a.k.a. FFI bindings) will allow us to include them without all the other bindings, isn't?

@AlixANNERAUD
Copy link
Collaborator Author

AlixANNERAUD commented Jan 16, 2025

The main point of my original issue is that moving lvgl-sys to a separate repository would give users the flexibility to choose between the unsafe bindings or the full-fledged safe bindings in Rust.

The current proposal is impractical and confusing, as it requires maintaining a compatible version of the safe lvgl bindings for each version of the lvgl-sys bindings, which is hardly achievable since safe bindings would require adaptation for future release (e.g. the current v9).

Decoupling the two would simplify this process, allowing users to choose more easily and enabling lvgl-sys bindings to be released promptly whenever a new LVGL version is available since it is automatically generated and would not require adaptation for any future release (since raw C to rust bindings generation are stable).

This approach mirrors the structure of the LittleFS Rust bindings, where the safe bindings are hosted in one repository and the unsafe bindings in another, providing a clear and modular separation.

If after that you still think that using the same repository is a good idea, we can move on anyway.

@C47D
Copy link
Collaborator

C47D commented Jan 22, 2025

Any updates @kisvegabor ? I see the LittleFS repo as a good example on how splitting both bindings in separated repos is useful

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

No branches or pull requests

3 participants