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
Make framebuffer an optional feature #55
Conversation
Some users of libremarkable might want to use it only for its input handling, but not for its framebuffer functionality. By disabling the framebuffer feature, users can also avoid lots of dependencies (73 instead of 151 dependencies to install), some of which (e.g., zstd) even need a C compiler. The default features will build everything as before, so this will not cause any compatibility issues.
7ab5005
to
170ba36
Compare
@lluchs The addition of the dimensions module and the splitting into various features makes sense to me, plus I'd like to see usage of libremarkable in reStream (and others) and would love to help get your PR over there closer to being merged. Could you rebase your PR? |
The changes seem alright to me. 👍 |
Quick thoughts:
If folks are open to the latter bullet, I'd be happy to make an attempt at another branch. If that doesn't make sense to folks, agree this PR is still better than status quo! |
I guess concretely, looking at the specific dep list:
My impression is that 3. is necessary for most (but not all!) apps, 2. is sometimes used but not as essential, and 1. is not used much. (But I haven't searched exhaustively of course.) So I guess the specific proposal would be to move 1. and 2. behind the (Also happy to just merge some version of this and have that discussion as followup.) |
I personally have not much of an opinion on this, yet. Surely this adds a bit of complexity. If the default flags are basically all, applications developers wouldn't notice it on their part while allowing "power developers" do disable stuff they dislike. My gripe was that e.g. libremarkable used a specific zstd version and I later found out for a feature I'm not sure anyone has ever used. (But I kinda rebuilt it in doomarkable by accident). Such a feature seemed sensible to remove though since I have never heard of an application using this component.
I have used the I'm not sure on the best way either, but I find the original pr to be a sensible first step. But I also agree that we could move |
Cargo.toml
Outdated
default = ["framebuffer", "appctx"] | ||
|
||
framebuffer = ["rusttype", "mmap", "image", "ioctl-gen", "line_drawing", "zstd"] | ||
appctx = ["aabb-quadtree", "hlua"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add "framebuffer"
to the list here... enabling appctx
without framebuffer
would break the build.
Yeah. My main worry is that it introduces configurations that are difficult to test. (For example, even the two features added here have a problem interaction.)
Yeah, fair enough. I also use Anyways, maybe we should put the |
Good catch!
Agreed. While optimizing dependencies a lot would be cool, having features at all is already a lot better than before (where you needed all dependencies even if you e.g. not used the framebuffer at all). We can always iterate on this later. |
It sounds like we're roughly on the same page, but this branch has bitrotted a bit... unless anyone objects or wants to grab it first, I can merge / make those changes directly on this branch? |
382e905
to
0556552
Compare
Okay, merged and applied the minor changes we discussed. I've also added checks for the two new build features into the |
(I've also tested with one of my apps that does not use |
with: | ||
command: check | ||
use-cross: true | ||
args: --target ${{ env.TARGET }} --no-default-features --features framebuffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two features are introduced but only one is checked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically: after this PR, there are three interesting cases to check: []
, [framebuffer]
, and [framebuffer, appctx
]. default = [framebuffer, appctx]
, so that combination was already being tested by the existing check... this commit adds checks for the other two options.
I agree it's nonobvious, though. Maybe I should add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably missing something otherwise please add another check in CI :)
I'll let you both be the judge when this is ready. Seems pretty much finished to me if nothing else comes up. |
Some users of libremarkable might want to use it only for its input
handling, but not for its framebuffer functionality. By disabling the
framebuffer feature, users can also avoid lots of dependencies (73
instead of 151 dependencies to install), some of which (e.g., zstd) even
need a C compiler.
The default features will build everything as before, so this will not
cause any compatibility issues.
See rien/reStream#46 for an example of a libremarkable use that does not need any framebuffer functionality.