lv_binding_rust icon indicating copy to clipboard operation
lv_binding_rust copied to clipboard

Move `lvgl-sys` to a separate repository.

Open AlixANNERAUD opened this issue 1 year ago • 22 comments

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 avatar Jul 01 '24 00:07 AlixANNERAUD

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).

AlixANNERAUD avatar Dec 19 '24 12:12 AlixANNERAUD

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?

C47D avatar Dec 27 '24 19:12 C47D

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.

AlixANNERAUD avatar Dec 27 '24 23:12 AlixANNERAUD

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

C47D avatar Dec 28 '24 07:12 C47D

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).

AlixANNERAUD avatar Dec 28 '24 10:12 AlixANNERAUD

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?

kisvegabor avatar Jan 03 '25 21:01 kisvegabor

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

C47D avatar Jan 03 '25 23:01 C47D

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.

AlixANNERAUD avatar Jan 04 '25 23:01 AlixANNERAUD

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

C47D avatar Jan 08 '25 02:01 C47D

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?

kisvegabor avatar Jan 09 '25 09:01 kisvegabor

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 https://github.com/lvgl/lv_binding_rust/issues/158#issuecomment-2579169093

C47D avatar Jan 09 '25 19:01 C47D

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

kisvegabor avatar Jan 13 '25 09:01 kisvegabor

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

Exactly

AlixANNERAUD avatar Jan 14 '25 22:01 AlixANNERAUD

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 avatar Jan 14 '25 23:01 C47D

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

C47D avatar Jan 15 '25 05:01 C47D

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.

AlixANNERAUD avatar Jan 15 '25 08:01 AlixANNERAUD

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?

C47D avatar Jan 16 '25 00:01 C47D

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.

AlixANNERAUD avatar Jan 16 '25 15:01 AlixANNERAUD

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

C47D avatar Jan 22 '25 01:01 C47D

Sorry for the delay. 🙁

I'm ok with having 2 repos for the safe and unsafe binding as it seems they are really separate things (different code base, different issues, different versioning). However for versions I think we should use the branches as it was proposed by @C47D I can't comment on the Rust related details , but having a repo for each version would make the lvgl GitHub organization nosiy.

kisvegabor avatar Feb 06 '25 12:02 kisvegabor

Any updates on that ?

AlixANNERAUD avatar Aug 20 '25 19:08 AlixANNERAUD

I can't understand why you are saying "noisy" @kisvegabor, i have looked into the organization and its already pretty much exactly noisy, i have no clue what doing this is changing, seems just like moving goal posts.

It has been several months, maintainers are waiting to actually do work, don't block the flow.

Sorry for the delay. 🙁

I'm ok with having 2 repos for the safe and unsafe binding as it seems they are really separate things (different code base, different issues, different versioning). However for versions I think we should use the branches as it was proposed by @C47D I can't comment on the Rust related details , but having a repo for each version would make the lvgl GitHub organization nosiy.

Jiiua avatar Oct 04 '25 14:10 Jiiua